[gdal-dev] OSM driver won't generate feature for relation
I’m trying to extract water vectors from OSM using my own local Overpass API server and OGR. It works for the most part, but there are some water features missing in my output. One particularly large omission is Lake Huron.
I can see a <relation> in the file that corresponds to Lake Huron, it’s the last element near the end of the file, <relation id=”1205151”>. It’s got 12797 <member> elements that reference the 12797 <way> elements in the file (I think).
I’ve been looking at
http://www.gdal.org/drv_osm.html and saw a few tips, like setting OGR_INTERLEAVED_READING to YES and using the example do/while loop. Here’s my Python translation:
fc = geojson.FeatureCollection(features=[geojson.loads(feat.ExportToJson()) for feat in feats])
When I load output.geojson into QGIS and look at the line strings and polygons, I don’t see a multipolygon for Lake Huron. I do see the outline as a bunch of line strings, but no polygon. I get a similar result if I load the OSM file into
QGIS directly... no lake polygon. Just a few random smaller polygons around the perimiter. It seems like OGR just isn’t producing a feature for that last relation.
Is there some setting I’m missing in osmconf.ini that would result in a multipolygon for the lake? The relation is there and it has a “type” tag set to “multipolygon”.
This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient,
or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received.