Skip to content

Instantly share code, notes, and snippets.

@aaronlidman
Created September 12, 2013 22:30
Show Gist options
  • Select an option

  • Save aaronlidman/6544694 to your computer and use it in GitHub Desktop.

Select an option

Save aaronlidman/6544694 to your computer and use it in GitHub Desktop.
I had this in the osmly readme, too detailed, will scare people away.

Current flow

  • WARNING: make sure everything is approved by the appropriate OSM authorities like the imports mailing list before importing to the main OSM API, if you aren't sure, ask somebody
  • prep the source
    • remove conflicting duplicates
    • reproject to EPSG:4326 (WGS 84)
    • remove useless attributes (like official internal ids)
      • OSMLY can do this for you, see usePropertyAsTag setting in settings_documentation.md it takes a whitelist of properties you want to use, everything else is ignored
    • rename attributes to their osm equivalents
    • add any needed common attribute like 'source=cityXYZ' or 'leisure=park'
  • convert your source to geojson
    • I suggest ogr2ogr or QGIS
      • ogr2ogr geojson details
      • example ogr2ogr: ogr2ogr -f "GeoJSON" -simplify 0.0001 -t_srs "EPSG:4326" -sql "SELECT NAME as name from parks" -progress parks.geojson parks.shp
  • run python build.py YOURGEOJSON
    • this makes sure geometry is valid, simplifies, seperates easy and difficult items, adds bounds, and converts everything to a sqlite database ready to be served up to the world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment