I am wondering why ogr2ogr is dropping certain features when exporting to GeoJSON and how to change this behavior.

In the following picture, all the features extracted by ogr2ogr are coded in fuchsia. Almost all of the forest is missing.

enter image description here

But when I load the raw OSM extract in JOSM, we see the forest is represented, though its relation is truncated at the northern border of the bounding box.

enter image description here

I have verified that the key-value pair in the OSM xml is landuse -> forest, and I have configured my customized osmconf.ini to include the landuse key for the multipolygon attributes.

So why does ogr2ogr exclude the truncated forest relation from the multipolygon GeoJSON? And is there a way to get it to include the truncated relations?

I should note that there are other instances where ogr2ogr does generate multipoloygons where the original feature has been split along a bounding line.

Here is a link to the region: https://www.openstreetmap.org/#map=12/39.0835/-123.2851

And this is the relation in question: https://www.openstreetmap.org/relation/1015303

  • 1
    Add a short link to that area on OSM map and OSM-ID of one missing forest relation. – user30184 Aug 13 '18 at 18:22
  • 1
    I believe that the GDAL OSM driver needs to get all the ways and further all the nodes of the relations for building the geometries. You say that the data appears truncated in JOSM. Have a try by downloading complete relation from Overpass API wiki.openstreetmap.org/wiki/Overpass_API of via the extracts at geofabrik.de. – user30184 Aug 13 '18 at 20:45
  • You can download the missing feature in JOSM too, and save the result to file. – AndreJ Aug 14 '18 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.