Replies: 2 comments 2 replies
-
So my two findings. Usage:target_node = find_node_by_id(features, 2762334883) But using this, I can find node - 7733744933 This node has no tags. It is used to form a way. I get why it might not be imported by default, but is there an option to force them to be included? thanks again |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for opening this discussion! Unfortunately, there's currently no way to quickly query features solely based on their ID. (We're working on this for the next major version, because this is a common complaint). See also clarisma/geodesk-py#24 So for now, you would need to perform a linear search over the set of nodes (i.e. your approach above) -- but of course that is quite slow. One way to improve performance significantly is to narrow down the search space -- either spatially or via a GOQL query (e.g. if you know your node is in the Sydney area, you can use a bbox query). However, this still will not give you anonymous nodes (nodes that have no tags, whose whole purpose is to provide the geometry of ways), since these are not stored as features. Instead, you could query the ways of interest (e.g. If you want to create a search envelope (e.g. to determine what's within 50 meters of a path), you can also turn the way into a Shapely geometry ( Do you have a specific use case where you will have to be able to identify untagged nodes by their ID? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thanks for geodesk, it looks amazing.
I have been using osm2postgres -- hoping this will make life easier and faster :)
Getting my head around it with the Python examples.
But I am stuck trying to create an object of nodes, based on their OSM ID. I assumed this would be easy, but I am missing something.
(My plan after that is to get info on each, then query based on a line between them and a buffer.)
Can you point by in the right direction?
thanks
Beta Was this translation helpful? Give feedback.
All reactions