##Converters to turn .osm data into other data types:
###Smaller datasets:
####To GeoJSON:
- osm-and-geojson : an easy web-based tool where you just paste in your OSM XML and click a button
- osm2geo: JavaScript that you can add to a webpage to make the browser do the work
- osmtogeojson: another tool written with JavaScript, can be used as a NodeJS library or a script on a webpage
####To Shapefile:
- Several things called "osm2shp": http://wiki.openstreetmap.org/wiki/Shapefiles#Create_your_own_shapefiles
- OSMLib (Ruby): http://osmlib.rubyforge.org/osmlib-export/rdoc/index.html
####To various formats, including GeoJSON and Shapefile:
- QGIS: native support in version 2.0, OSM plugin for earlier versions
- After importing or downloading OSM data, select the features you want and then do Save As… to select a new format and/or projection
###Larger datasets:
Note: most of these require using the command line. If you're not used to that, don't be afraid--it can save you a lot of time!
####To various formats:
-
Osmium: built with C++ and JavaScript, powers a number of other tools
-
ogr2ogr (part of GDAL): convert to GeoJSON, Shapefile, PostGIS, and a variety of other formats
- OSM driver documentation: http://www.gdal.org/ogr/drv_osm.html
- Do each geometry type separately for best results:
ogr2ogr -f GeoJSON points.json data.osm.pbf points ogr2ogr -f GeoJSON lines.json data.osm.pbf lines ogr2ogr -f GeoJSON multilinestrings.json data.osm.pbf multilinestrings ogr2ogr -f GeoJSON multipolygons.json data.osm.pbf multipolygons ogr2ogr -f GeoJSON other_relations.json data.osm.pbf other_relations
####To PostGIS:
- osm2pgsql: the standard for rendering full tilesets with Mapnik. Mac, Linux, and even Windows compatible.
- Imposm: Python-powered and optimized for visualization
- osm2posgresql: Linux script
- TileMill and QGIS can use PostGIS tables directly
- Built-in pgsql2shp: http://manpages.ubuntu.com/manpages/lucid/man1/pgsql2shp.1.html
- Built-in ST_AsGeoJSON function: http://postgis.net/docs/ST_AsGeoJSON.html
- ogr2ogr
###Going the other direction: