Repository navigation
Closed
Labels
bugSomething isn't working
Description
Before you start
- I searched the existing issues and did not find a duplicate.
- This is a bug report, not a usage question (questions belong in Discussions).
What happened?
In the desktop app, a plugin command that adds data from the web with layer.addUrl has two problems that Home › Add › From Service doesn't have.
- The window freezes until the download ends.
layer.addUrldownloads on the window's thread (download_blocking/open_url_blockingincrates/engine/src/cmd/layer.rs), so the window doesn't repaint: there is no "Downloading…" notice and no click registers. With a slow server this lasts minutes, and RustGIS looks hung. The From Service dialog downloads the same layer off the frame (ui.addUrl,crates/ui-egui/src/serviceui.rs:90) and says "Downloading…". The web app does that for plugins too:layer.addUrlanswers{"pending": true}(Session::request_url) and the layer is added when it lands. - An ArcGIS query stops at the server's record limit.
ogc::read_pagesreads an ArcGIS…/querythat hit its limit (exceededTransferLimit) again in pages, up to 100,000 features, but only on the dialog's path, whereui.addUrlgets"service": true(and inservice.add). A plugin gets the first page (often 1,000 or 2,000 features), so a catalogue plugin's layer comes in incomplete, and the plugin can only tell the user to zoom in and add it again.
Steps to reproduce
- Load a WebAssembly plugin whose command runs
host::run("layer.addUrl", json!({"url": URL, "name": "Lotes", "zoom": false})), with URL the sample data below: an ArcGIS query of Bogotá's cadastral parcels in a few blocks of the centre. The box holds 10,076 parcels (returnCountOnly), and the server gives 2,000 at once (maxRecordCount,supportsPagination: true). - Run the command in the desktop app. While it downloads, the window doesn't respond and nothing says that something is downloading.
- When it ends, the layer has 2,000 features: the first page, which says
exceededTransferLimit: true.
The same through the engine, with rustgis-cli on main:
layer.addUrl={"url": URL, "name": "Lotes", "zoom": false}gives"features": 2000.service.add={"url": "https://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/catastro/lote/MapServer", "layer": "0", "bbox": [-74.0802, 4.6175, -74.0577, 4.6354]}gives"features": 8186, the whole box (8,184 counted), read page by page.
Expected behavior
A plugin's layer.addUrl behaves in the desktop app as the From Service dialog's download does:
- It downloads off the frame. The command answers
{"pending": true, "url": ...}, as in the web app, "Downloading…" shows, and the layer is added when it lands. Plugins already handle that answer, since the web app gives it. One way to get there: a session flag the desktop UI sets, so thatlayer.addUrlfrom a plugin command goes throughSession::request_url. The UI already takes those requests every frame and runsui.addUrl.rustgis-cli,gp.runand scripts keep waiting for the layer, as they need. - An ArcGIS
…/queryis read past the server's record limit in pages, up toMAX_PAGED_FEATURES, as the dialog's is. That could happen whenever the address is an ArcGIS query that doesn't ask for a window of its own (noresultOffset/resultRecordCount), or with"service": truedocumented as alayer.addUrlparameter.
How are you running RustGIS?
Desktop app
Version
main (7bf2e20)
Operating system, browser and graphics
Linux (Fedora 44 Kinoite / Bazzite)
Sample data
https://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/catastro/lote/MapServer/0/query?where=1%3D1&outFields=*&returnGeometry=true&outSR=4326&f=geojson&geometry=-8246500,515500,-8244000,517500&geometryType=esriGeometryEnvelope&inSR=3857&spatialRel=esriSpatialRelIntersects
Screenshots or logs
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
jgregoriorincon commentedon Oct 29, 2026
I'd like to take this one.
Plan, in two steps, one pull request each:
layer.addUrlrun from a plugin command goes throughSession::request_url, as in the web app. The command answers{"pending": true}, "Downloading…" shows, and the layer is added when it lands.rustgis-cli,gp.runand scripts keep waiting for the layer as today.…/querythat hits the server's record limit is read in pages (ogc::read_pages, up toMAX_PAGED_FEATURES), as the From Service dialog reads it.One question before step 2. Should every ArcGIS query that doesn't ask for a window of its own (no
resultOffset/resultRecordCount) be read in pages, or only when the caller asks with"service": true, documented as alayer.addUrlparameter? Paging every such query changes whatlayer.addUrlgives scripts today (more than the first page). The flag keeps today's answer unless asked. I'd lean to the flag, unless you prefer pages by default.fix(plugins): a plugin's layer.addUrl downloads off the frame on the …
test(ui): tests that fetch through the tile cache take turns
fix(plugins): the same address asked for another way is another download
jgregoriorincon commentedon Nov 15, 2026
An update on what's left here.
layer.addUrlwith"service": trueis read byserviceui::read_pages, in pages, as protocol buffers when the layer lists them, and since feat(data, engine, ui): an ArcGIS layer says why it comes in without its service's symbology (#2152) #2163 with its service's symbology or a notice saying why not.What's left is the engine's path:
rustgis-cli, scripts and tasks. Therelayer.addUrlwith"service": truestill downloads the address once, so an ArcGIS query gives its first page only (2,000 of Manzana's 44,529 blocks, say), with RustGIS's single symbol.service.addalready reads the whole layer on that path, throughservice::download_layer.I'll close it with one small pull request: that branch of
service.addbecomes a shared function, whichlayer.addUrlwith"service": trueuses too when there is no app to leave the download to. A test adds a paged ArcGIS query throughlayer.addUrlon a session without the app and counts every page's features.fix(engine): layer.addUrl with service reads a service's features in …
fix(engine): a GeoTIFF with service keeps its own path, and bad bound…
fix(engine): layer.addUrl with service reads a service's features in …