Skip to content

Conversation

@JeremyBYU
Copy link

Description of Work

Adds efficient feature lookup by OSM ID using pre-built index files (*-indexes/ directory generated by geodesk-gol). Avoids full tile scans by narrowing search to the specific tile containing the feature.

What Changed

  • New IdIndex class (src/feature/IdIndex.cpp, include/geodesk/feature/IdIndex.h) - Loads and queries index files, maps pile numbers to tile pointers, scans R-tree for matching IDs
  • Public API on FeaturesBase - Added byId(id) method: nodes.byId(123), ways.byId(456), relations.byId(789)
  • FeatureStore integration - Lazy-loads IdIndex on first use
  • Example program (examples/query-id/)
  • IndexFile fix - Minor adjustment in clarisma/store/IndexFile.cpp

Amount of Risk

Targeted change, low risk.

  • Additive only - no modifications to existing query paths
  • Graceful fallback - if index files are missing, byId() returns null
  • Self-contained - new code isolated in IdIndex class

Future Work

  • Update geodesk-gol to expose ID lookup in its query language, enabling syntax like w[id=12345] or /w12345 or a dedicated byId() function. Wanted to get your opinion on best way to handle that.

@cla-assistant
Copy link

cla-assistant bot commented Dec 23, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant