OpenStreetMap

I’ve long searched for a straightforward way to convert OSM XML Data into shapefiles for use in common GIS applications. I’ve even set up my own PostgreSQL/PostGIS server for this task - a long and painful way to get data into QGIS.

But today I found a much simpler and faster approach (at least for points):

  • Load data into JOSM
  • Save as .geojson (use file-ending .geojson, not .json!)
  • in GGIS, Layer -> Add Vector Layer… : choose type GeoJSON, open file.
  • in Layers tab, right click “Save As… : ESRI Shapefile”

Note: for ways and polygons, you have to split up the data in JOSM first. Export an extra .geojson for nodes, ways and polygons each because QGIS only handles one datatype a time.

Comment from ingalls on 9 June 2013 at 21:54

This might speed things up:

http://wiki.openstreetmap.org/wiki/Ogr2osm Use Pnorman’s Updated Version

It can deal with far larger datasets than JOSM can.

Comment from ingalls on 9 June 2013 at 21:54

oops, I misread that, this does the other way round!

Comment from ab_fab on 10 June 2013 at 09:45

Hi species,

You may also have a look at this service: http://www.osm974.re/osm2gis/

Bye

Comment from species on 10 June 2013 at 09:50

Hi ab_fab,

osm2gis has some limitations, e.g. you cannot choose the attributes/columns - I’m looking for a way to convert my own selection of tags used in the osm data into attributes in the shapefiles.

greetings, Michael


Login to leave a comment