Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M mapnik3
  • Project information
    • Project information
    • Activity
    • Members
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
Collapse sidebar
  • 周峰
  • mapnik3
  • Wiki
  • ExampleCode

ExampleCode · Changes

Page history
clone mapnik wiki from github. authored May 14, 2021 by 周峰's avatar 周峰
Hide whitespace changes
Inline Side-by-side
ExampleCode.md 0 → 100644
View page @ 8516de00
<!-- Name: ExampleCode -->
<!-- Version: 11 -->
<!-- Last-Modified: 2009/11/10 17:42:39 -->
<!-- Author: springmeyer -->
# Example Code
The Mapnik source comes with some example code in the [mapnik/demo](https://github.com/mapnik/mapnik/tree/master/demo) directory.
Here are some other sets of Example Code to learn from.
----
## C++ Code
### California
* *Name*: `cali.cpp`
* *Description*: A sample program, adapted from demo/c++/rundemo.cpp which demonstrates how one might use the Mapnik C++ API to render the state of California from USGS Shapefile data.
* *Source*: https://gist.github.com/lwu/5009
* *Tested On*: Mac OS 10.5
* *Added by:* lwu
### Servers
* https://github.com/openstreetmap/mod_tile/
### C++ profiling tests
* http://github.com/jflemer/mapnik-glitz-demo
* http://bitbucket.org/mishok13/mapnik-perf-testing/
### FreeMap
* http://svn.openstreetmap.org/applications/rendering/fmapgen/
----
## Python Code
### Hello World
* *Name*: `world_map_and_styles.py`, `world_map.py`
* *Description*: A mirror of the GettingStarted tutorial along with sample data.
* *Source*:
* ~~[Pure Python example](http://mapnik-utils.googlecode.com/svn/example_code/hello_world/pure_python/)~~ Code removed
* ~~[Python with XML Mapfile](http://mapnik-utils.googlecode.com/svn/example_code/hello_world/xml_config)~~ Code Removed
* ~~[Sample Data for each example](http://mapnik-utils.googlecode.com/svn/example_code/hello_world/data/)~~ Code removed
* *Tested On*: Mac OS 10.5
* *Added by:* (original mapnik tutorial)
### World Population
* *Name*: `world_population.py`
* *Description*: A mirror of the [XmlGettingStarted](/wiki:XMLGettingStarted/) tutorial along with sample data.
* *Source*: [Python Script, XML Mapfile, and data](http://mapnik-utils.googlecode.com/svn/example_code/world_population)
* *Tested On*: Mac OS 10.5
* *Added by:* springmeyer
### Cairo Renderer
[Code samples](MapnikRenderers) for writing to SVG and PDF
### mapnik-utils
The mapnik-utils project includes some example code as well: http://code.google.com/p/mapnik-utils/
### ShieldSymbolizer
An e-mail on [Mapnik ShieldSymbolizer](http://groups.google.com/group/cugos/browse_thread/thread/b62b4890e1933bba). Also describes use of
```python
$ python
>>>import mapnik
>>>dir(mapnik)
>>>help(mapnik)
```
and
```sh
$ pydoc -p 8080
```
and then open a browser and go to : [http://localhost:8080/mapnik.html](http://localhost:8080/mapnik.html)
\ No newline at end of file
Clone repository
  • A perfect testcase
  • API changes between v2.0 and v2.1
  • API changes between v3.0 and v3.1
  • AWS Lambda
  • About Mapnik
  • AlsoFilter
  • Api changes between v2.1 and v2.2
  • Api changes between v2.2 and v2.3
  • Api changes between v2.3 and v3.0
  • ArchInstallation
  • Aspect Fix Mode
  • Benchmark Notes
  • BoundsClipping
  • BrokenExceptions
  • BuildingSymbolizer
View All Pages