[Feature]: Reusable spatial indexing for map queries and snapping

Aperta
#2,330 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Before you start
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:

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

Lingua principale
Rust
Stelle
1.9k
Fork
268
Merge medio
11h 1m
PR unite (30g)
942

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opengeos/RustGIS

Tutte le issue di opengeos/RustGIS

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.