If I have “node/331283698” how can I get its information using geodesk’s gol command line tool.
I have tried this but it returns 0 features: gol query finland “na[id=123456]”
If I have “node/331283698” how can I get its information using geodesk’s gol command line tool.
I have tried this but it returns 0 features: gol query finland “na[id=123456]”
Geodesk doesn’t index by ID so this isn’t a straightforward lookup.
A workaround I’ve used in Geodesk for Python is next(f for f in my_features.ways if f.id == 123)
. This will iterate over my_features until it finds a way with ID 123.
Tagging @GeoDeskTeam in case they have anything to add.
I’d like to use cli tool. But ok, I think it’s not possible then
Unfortunately, querying by OSM ID isn’t possible in the current version. For Python scripting, you can use the workaround proposed by @osmuser63783. This will be slow for large GOLs, since the query engine has to perform a full scan (IDs aren’t currently indexed), but you can mitigate this by constraining the query set if you know the node’s general geographic area and/or tags.
ID indexing is coming in the next major version (It is a required part of fast minutely updates). However, there are no currently plans to support it in the GOL Tool, so I opened this enhancement issue on GitHub. The core of the issue is deciding on the query syntax – if you have any preferences, please leave a comment.
Thanks for your patience!