[Feature]: Reusable spatial indexing for map queries and snapping
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- data-visualization
Research direction
Start with Map::hits_at and hits_in in crates/map/src/lib.rs, then read the snapping entry points in crates/engine/src/cmd/design.rs and related work in issues #818, #2051, #1065, and #2032. Decide how reusable indexes should be owned and kept valid across geometry, projection, and streamed-content changes while preserving feature and vertex identities. Done means a map-level query and snapping API handles the stated visibility, scale, filter, and exclusion rules; the issue provides no tests or benchmark criteria.
Written by the indexing model from the issue text.
Description
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
What problem does this solve?
Problem and proposal
Looking at main as of November 17, 2026 (cca86cb):
- Map::hits_at and hits_in primarily iterate over loaded features.
- Snapping scans feature vertices and segments, and its public entry points still require a Session.
- The snapping path calls Geometry::extent(), which traverses coordinates to calculate the bounding box.
Relevant code: map queries, snapping.
Projection and some query results are cached, but continuous interaction with large layers or complex geometries may still incur substantial scanning costs. This is a source-level observation; I have not benchmarked these paths.
Could RustGIS provide a reusable spatial query/snapping API that works with an existing Map, independently of Session?
Ideally, it would:
- Reuse indexes across queries, updating or invalidating them when geometry, projection, or streamed content changes.
- Respect layer visibility, scale ranges, and feature filters.
- Preserve source feature/vertex identities and snapping exclusion rules.
- Handle both many features and individual geometries with many vertices efficiently.
Related work
RustGIS already has file-level and analysis indexes. This proposal focuses on map interaction:
- #1119, #1148, #1928 added indexing to analysis and topology operations.
- #818 and #2051 improved snapping identity handling and cache invalidation.
- #1065 and #2032 track streamed rendering and per-layer coordinate systems, which this design should coordinate with.
Proposed solution
QGIS reference
QGIS separates these responsibilities into:
- QgsSpatialIndex: a general-purpose feature R-tree.
- QgsPointLocator: indexed, layer-level location queries.
- QgsSnappingUtils: shared snapping configuration and queries, with full-layer, local, and hybrid indexing strategies.
This is a reference for reusable APIs and ownership boundaries, not a request to copy a particular implementation.
Estimated scope
Medium: a broader feature that is feasible in a reasonable timeframe
Alternatives considered
No response
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 11h 1m
- Merged PRs (30d)
- 942
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPossibly taken @jgregoriorincon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opengeos/RustGIS#2621 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
opengeos/RustGIS#1446 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
postgresql-rules / queue-rules: implicit KEY SHARE before a parent key update, and job self-overlapOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jonathanong/no-mistakes#3879 ·
Maintainers usually reply within 1 day
-
area:index v0.35.0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
nautechsystems/nautilus_trader#5741 ·
Maintainers usually reply within 1 day
-
RunPlugin derives Hash over all fields while PartialEq compares only location and configurationOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
zellij-org/zellij#5969 ·
Maintainers usually reply within 1 day
-
eth_get_proof reports another account's fields for an absent accountPossibly taken @Indian-boult claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day