clarisma / geodesk-py

Fast and storage-efficient spatial database engine for OpenStreetMap data
https://docs.geodesk.com/python
GNU Lesser General Public License v3.0
36 stars 0 forks source link

Query features by ID #24

Open clarisma opened 11 months ago

clarisma commented 11 months ago

Allow access to features by ID:

n = features.node(123)
w = features.way(123)
r = features.relation(123)

Challenges:

osmuser63783 commented 3 months ago

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.