geodesk-py
geodesk-py copied to clipboard
Query features by ID
Allow access to features by ID:
n = features.node(123)
w = features.way(123)
r = features.relation(123)
Challenges:
- GOLs currently do not have an ID index, so queries would be relatively slow
- However, performance could be increased significantly using "spatial hinting" (user supplies a coordinate or bbox that overlaps with the desired feature)
In case anyone else stumbles across this feature request in search for a solution, one possible workaround is:
next(f for f in my_features.ways if f.id == 123)
It doesn't use an index so it may be slow but it will return the way 123 in one line, if it exists.