QGIS project import runs off the window, with progress and Cancel

Aperta
#2,476 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
38/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, desktop

Direzione di ricerca

Start by reading the import command and the existing background execution paths, especially workflows::ahead_on_copy, reads::prepare, and service.add / layer.addData. Compare the proposed read-ahead and session-copy approaches, then add the import to long_commands in crates/engine/src/tests/cancellation.rs and extend the cancellation tests. Done means import progress and Cancel work without holding the window, cancellation leaves the session unchanged, and the cancellation tests cover the command.

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

Descrizione

project.importQgis runs on the UI thread. It adds a project's layers one after another, each through the command that adds its kind, and no step looks at Cancel. Since #2471 a QGIS project's web service layers come in from their services: each asks for the service's capabilities, then a WFS, OGC API or feature service layer's features (page by page, within the read limits) or a WCS coverage. A project with several such layers, or a slow service, holds the window until every service has answered. Before #2471 only file reads and a WMS layer's capabilities did this.

What's wanted (AGENTS.md, "Never hold the window"): the import runs off the window, with progress (layers done of layers in the project) and Cancel. Cancelling leaves the project as it was, as other cancelled commands do.

Why it isn't a small change:

  • The import changes the session as it goes. Later layers, groups and relations read the layers added before them, and tile layers that land on the same tiles are merged.
  • There is no background path yet for a command that runs other commands on the session. Models and scripts run on a copy (workflows::ahead_on_copy), whose results are then taken. Read-ahead commands (reads::prepare) read one source before they run.

Possible approaches:

  • Read ahead. Collect every file and service read the import will make: each layer's source is known from the project text before anything is added. Read them all off the window with progress and Cancel, then add the layers from what was read, as service.add and layer.addData already take fetched documents and files.
  • Run on a copy. Run the import on a copy of the session, as models and scripts do, and take its result.

The import would then also go in long_commands (crates/engine/src/tests/cancellation.rs), and the cancellation tests would cover it.

Related: #882 (piece 10b, #2471).

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.