bdon / OSMExpress

Fast database file format for OpenStreetMap
BSD 2-Clause "Simplified" License
238 stars 20 forks source link

Crash when querying tagless nodes #51

Open brawer opened 1 week ago

brawer commented 1 week ago

When looking up a node such 6058479131, which has only coordinates but no tags, the osmx query tool currently crashes:

$  curl https://osmx1.protomaps.com/results/b1bbdd89-12e6-4390-b9a2-42a54fc65948.osm.pbf >sample.osm.pbf
$ ./osmx expand sample.osm.pbf sample.osmx
$ ./osmx query sample.osmx node 6058479131
(7.4311092,46.9522392)
MDB_NOTFOUND: No matching key/data pair found, file /Users/sascha/src/OSMExpress/src/storage.cpp, line 74.
Abort trap: 6
bdon commented 1 week ago

I think this is just a CLI UI issue and not an underlying data problem - it should be fine for a node ID to exist in the Locations db and not in the Nodes db, that means it has no tags, so check for existence in Nodes and ignore if not found. PR would be welcome!