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
  • MapnikCoreConcepts

MapnikCoreConcepts · Changes

Page history
clone mapnik wiki from github. authored May 14, 2021 by 周峰's avatar 周峰
Hide whitespace changes
Inline Side-by-side
MapnikCoreConcepts.md 0 → 100644
View page @ 8516de00
# Core Concepts of Mapnik
Mapnik can be used with XML, Python or C++, but the key concepts are the same across these technologies. For details on how to use the different APIs, see [[LearningMapnik]].
Mapnik creates maps. The *map* object is therefore central to Mapnik's API. The map object provides methods for rendering a map to a graphical output format (usually PNG or PDF).
Maps are (mainly) made up of arbitrary numbers of *layers*. Each layer has a *datasource* that provides the geometry data (provided by one of several *plugins* that read and parse the data). For rendering the data, each layer can be assigned one or multiple styles.
A *style* defines how the objects in a layer are rendered. A style contains one or more *rules* that can optionally constrain its output to *filter* out a subset of the objects provided by the layers datasource, for example to show only these objects who have a specific attribute set. Filters are optional – a common case for simple maps is to have one rule for each layer without any filters. Each rule holds one or more *symbolizers* which are responsible for actually drawing geometry in the output. Depending on the symbolizer class and settings, geometry can be rendered in a variety of ways.
The order of layers, rules and symbolizers is generally important in Mapnik, as the layering of output in the result image is not modelled explicitly (like, for example the `z-index` property in CSS), but determined by the order of these elements. It is therefore important to set these elements up in the correct order to produce the desired results.
There are 3 different coordinate systems in Mapnik.
- lat/lon coordinates where geometric objects placed.
- x/y coordinates after map projection applied where you set bbox/envelope.
- pixmap x/y coordinates used in pan function.
## Further Reading
- [[SymbologySupport]]
- [[GettingStartedInPython]]
- [[Mapnik API]]
---
Back to [[LearningMapnik]]
\ 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