[gdal-dev] Suspected 'bug' in GDAL conversion of openstreetmap_ids

Even Rouault even.rouault at spatialys.com
Sat Feb 23 00:22:37 PST 2019


On samedi 23 février 2019 01:56:19 CET mick howe wrote:
> I'm trying to convert a series of Open Street Map files to MapInfo and the
> node files fail on negative osm_id
> Has GDAL been updated to handle 64 bit ids that were introduced several
> years ago?

Yes, but negative ids require particular action

$ ogr2ogr /vsimem/foo.gpkg test_with_negative_id.osm 
ERROR 1: Unsupported node id value (-1). Use OSM_USE_CUSTOM_INDEXING=NO
0...10...20...30...40...50...60...70...80...90...100 - done.

https://gdal.org/drv_osm.html :
"""For indexation of nodes, a custom mechanism not relying on SQLite is used 
by default (indexation of ways to solve relations is still relying on SQLite). 
It can speed up operations significantly. However, in some situations (non 
increasing node ids, or node ids not in expected range), it might not work and 
the driver will output an error message suggesting to relaunch by defining the 
OSM_USE_CUSTOM_INDEXING configuration option to NO."""

So

$ ogr2ogr /vsimem/foo.gpkg test_with_negative_id.osm \
	 --config OSM_USE_CUSTOM_INDEXING NO
0...10...20...30...40...50...60...70...80...90...100 - done.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list