Skip to content
nvkelso edited this page Jul 11, 2012 · 5 revisions

#Usage:

This will create a series of tables in your PostGIS database that you can then access from Mapnik.

osm2pgsql -smucK new-york.osm.bz2  -S default.style -U osm -d planet_osm

Where:

osm2pgsql - the command

-smucK - the options: slim, mercator projection, uft-8 text encoding, create a new table (remove old if present; use a to append instead), and Keep coastlines

new-york.osm.bz2 - the data file

-S default.style - the style file with flag

-U osm - which user to access PostGIS

-d planet_osm - which datatable space to store in PostGIS

Read more at the manual page »

#Gotcha's

  • You'll need a -S style file, available from OSM's Trac as default.style.

  • If you're using High Road for grouping OpenStreetMap streets by zoom using views, you'll need to drop the views before the osm2pgsql import and rebuild them after. Read more »