8

I'm trying to get detailed geojson data for various African countries. I think I found a good source at http://download.geofabrik.de/. The problem is that the downloaded file is in osm format. I know of the osmtogeojson tool, but there is no way this would work on the 32.2GB (!) file I got from Geofabrik. I also have the pbf file which is 1.2 GB.

My question is:

  • Is it a way to split an OSM file (in my example, I could extract data country by country and hopefully feed them to osmtogeojson then)
  • Is it any other way to get detailed geojson info at the subnational level (provinces)?
4
  • 2
    well, what data exactly are you after? just the provinces? try Natural Earth. for osm sourced try overpass-turbo.eu or QuickOSM via QGIS. Commented Mar 14, 2016 at 12:53
  • What about Overpass API? Commented Mar 14, 2016 at 12:54
  • Yes mainly country and provinces boundaries, as precise as possible - I'll have a look at overpass right now!
    – Martin
    Commented Mar 14, 2016 at 13:05
  • Thanks @bugmenot123 - Natural Earth had the info I was looking for in .shp format, which is easy to convert to GeoJson - easier than working with my big files.
    – Martin
    Commented Mar 15, 2016 at 9:58

1 Answer 1

8

You can use osmosis or osmfilter to split your OSM source file for specific bounds or tags.

Geofabrik uses osmosis to cut their extracts out of the planet OSM, while osmfilter is quicker if you have certain tags to search for.

You can translate the osm data to other GIS formats using ogr2ogr.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.