Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query features by ID #24

Open
clarisma opened this issue Dec 6, 2023 · 1 comment
Open

Query features by ID #24

clarisma opened this issue Dec 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@clarisma
Copy link
Owner

clarisma commented Dec 6, 2023

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)
@clarisma clarisma added the enhancement New feature or request label Dec 6, 2023
@osmuser63783
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants