TopOSM howto

From OpenStreetMap Wiki
Jump to: navigation, search

Very brief instructions on how to render your own TopOSM-style map. To be improved.

Data

  • Download a planet.osm dump, or an extract for your area.

Required software

You'll need (at least) the following software:

  • A working Linux (or Linux-like) system
  • Mapnik
  • PostgreSQL w/ PostGIS
  • Python and mapnik python libs
  • osm2pgsql
  • shp2pgsql (provided in the postgis package on Fedora)
  • The PerryGeo tools (hillshade, colormap)
  • ImageMagick
  • OptiPNG
  • GDAL (including the bundled tools)
  • The TopOSM scripts, config files and symbols. Download here
  • On Fedora you will need the proj-nad package

How to render

  1. Download the data to separate directories. Leave the archives unzipped.
  2. Set up a Mapnik/PostGIS database. Some scripts may assume that it's named osmdb.
  3. Modify and run import_planet (file paths, bounding box) to import OSM data and run some preprocessing.
  4. Modify colors.txt, which defines RGB values for elevation levels, to match your area. Note that the elevation unit in NED (and thus this file) is meter.
  5. Modify and run prepare_ned (file paths etc) to generate hillshading and colormaps for the whole area, and to generate and import contour lines.
  6. Modify and run import_nhd (file paths etc) to import hydrography features into the database.
  7. Modify constants in toposm.py (directories, tile sizes/counts).
  8. Modify include/dbsettings.inc
  9. Modify us-render.py to render the area you're interested in (and, optionally, the mapnik tiles you need).
  10. Run us-render.py. See the comments in that file for how to run it on multiple CPUs/cores/machines.

Note that prepare_ned expects the NED ZIP file to contain directories in the form NED_*/ned_* . The new nationalmap does not follow that. You will need to unzip and re package correctly if you get your files from there.