I'm trying to create a geojson file with a few shapes of roads from OSM. Now, I've been able to get shapefiles of the greater region (province) these roads are in from http://download.geofabrik.de/ . I've also been able to convert a shape file to geojson using ogr2ogr. My problem is that it contains way too much data. Is there a way to filter a shapefile or geojson file by name, type or ID?

  • The usual approach is to import source OSM data into postgis, or to do a simple extract using the overpass API. Otherwise, which of your 4 questions is the one that should be answered?
    – BradHards
    Commented Apr 20, 2014 at 5:37
  • Thanks. You're right. I've cleaned up the post a bit. The main issue is filtering. Thanks for your answer, that's very helpful. Commented Apr 20, 2014 at 5:53

1 Answer 1


ogr2ogr supports filtering, by using the where clause. http://www.gdal.org/ogr2ogr.html

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.