A 'planet extract' from http://www.geofabrik.de . </li></ul><li>Coastline & Population Centres data (for small sale maps).
Ideas about what information you would like to display, and how you would like to display it. </li></ul>
Why is it so complicated? <ul><li>The mapnik library that is discussed in this presentation is a general purpose map drawing utilitiy.
It is very powerful and can do all sorts – take data from different data sources, plot it in different ways depending on the map scale etc. With power comes complexity.
The main issue is that the usual way of using OSM data with mapnik is not to have mapnik read the data directly, but load the data into a database first, and mapnik gets the data from there. This means that you need a lot of tools to draw a map. </li></ul>
Is there an alternative? <ul><li>Yes – there are a few different renderers for OSM data – try searching the OSM wiki for: </li><ul><li>Osmarender
Maperitive </li></ul><li>But I understand mapnik better than these, so they are not considered further here. </li></ul>
The OSM Mapnik Rendering Tools Key OSM Data file (.osm) PostgreSQL / postGIS database mapnik Mapnik stylesheet (.xml) Extra Data (Coastline Shapefiles etc.) generate_image.py or generate_tiles.py osm2pgsql default.style Files to be Edited / Customised Fixed data / programs / libraries
osm2pgsql <ul><li>osm2pgsql is the tool that loads OSM data into the postgresql database.
It does three important things: </li><ul><li>Filters the data to limit the amount of data in the database.
Reprojects the data from lat,lon values to mercator projection x,y positions.
Creates points, lines and polygons from the OSM nodes, ways and relations, to be compatible with mapnik. </li></ul></ul>
osm2pgsql style file <ul><li>osm2pgsql takes a file (called default.style by default), which tells it which data to put into the database.
It is a list of keys (highway, natural, waterway etc.). Only OSM entities with keys listed in default.style will be put into the database.
This means you need to think about which osm keys you will need to use to create your map before you import the database! </li></ul>
The osm2pgsql database <ul><li>The database contains a number of tables. </li><ul><li>planet_osm_point : OSM nodes.