Skip to content

Instantly share code, notes, and snippets.

@aawiseman
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aawiseman/49ed2e1a5ecba2eee796 to your computer and use it in GitHub Desktop.
Save aawiseman/49ed2e1a5ecba2eee796 to your computer and use it in GitHub Desktop.
Workflow for importing OpenStreetMap data into QGIS or ArcGIS shapefiles

#Exporting OpenStreetMap roads to shapefile I’ve been having a bear of a time recently trying to get OpenStreetMap data into a usable format in QGIS or ArcGIS. Here’s what I did.

  1. Download the OpenStreetMap xml (.osm) from the OpenStreetMap.org Export window
  2. Open that file in JOSM (Java OpenStreetMap editor, it's free). Don’t add anything else, turn on imagery or download anything from within JOSM
  3. Select all and copy and paste that data into a new layer in JOSM (that erases all the ID numbers, which are causing the problem as they’re 64 bit and QGIS can’t handle 64 bit IDs)
  4. Save that layer out to a new .osm file
  5. If you don’t already have it, download the OpenStreetMap Plugin in QGIS (it's free)
  6. In QGIS, click Load OSM from File
  7. Check whatever features you need (doesn’t hurt to add them all)

And voila, you have OpenStreetMap data in point, line and polygon with all the attributes. Or at least all the ones I care need most, namely Name and highway type (residential, tertiary, etc.)

Then save that to shapefile and you are in business.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment