[Feature]: Read an ESRI ASCII grid from a web address, and let crs place it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start by reading the existing CRS handling cases in crates/engine/src/cmd/layer.rs and sniff_extension in crates/data/src/io.rs; the ASCII grid reader is in crates/data/src/raster/mod.rs. Check how existing raster formats are recognized and how caller-provided CRS is applied. Done means a remote ESRI ASCII grid is recognized from its header and can be added with the supplied crs; verify both cases with focused tests for URL loading and CRS handling.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
What problem does this solve?
Many WCS services publish elevation only as ESRI ASCII grids. GUGiK's surface model and its EVRF2007 terrain are two of them. RustGIS reads such a grid from a file, but not from the GetCoverage address a WCS answers with, so the coverage cannot be added in one call. Two gaps block it.
An address with no extension has no bytes the content sniff knows, so it is refused with not a data format RustGIS reads (…). The same address serving a GeoTIFF is added, because a TIFF starts with magic bytes and an ASCII grid starts with text.
An address that does end in .asc is read, then refused for want of a coordinate system: ASCII grid: unknown coordinate system: put a .prj file next to it. The crs parameter does not apply to a grid, and a .prj beside the address is not fetched.
Measured on 0.7.0 against a local server, so the bytes are the only variable:
| Address and parameters | Answer |
|---|---|
/grid, ASCII bytes |
refused: not a data format |
/tiffdata, GeoTIFF bytes |
added, 200 × 200, one band |
/test.asc |
read, then refused: unknown coordinate system |
/test.asc, with /test.prj beside it on the server |
read, then refused: unknown coordinate system |
layer.addData on a local bare .asc, "crs": "EPSG:2180" |
refused: unknown coordinate system |
The workaround is to download the grid, write a .prj beside it, and add the file with layer.addData. A process plugin for Polish national data does that today, which costs a second step and holds the window for the whole download.
Proposed solution
- Make
crsapply to an ESRI ASCII grid, as it already applies to a Shapefile, a CSV and a DXF that do not name their system. - Teach the content sniff the ESRI ASCII header:
ncols,nrows,xllcornerorxleftcorner, andcellsizeordx/dy.
Then layer.addUrl {"url": <GetCoverage>, "crs": "EPSG:2180"} behaves as the GeoTIFF case does: from a plugin on the desktop it answers {"pending": true}, and the grid lands off the frame.
Estimated scope
Small. Both changes are cases in code that already exists: the crs handling beside the Shapefile, CSV and DXF cases in crates/engine/src/cmd/layer.rs, and sniff_extension in crates/data/src/io.rs. The reader itself is there, in crates/data/src/raster/mod.rs, where asc is already an extension it reads.
Alternatives considered
Converting the grid to GeoTIFF first, with the CRS embedded, works, and is what a WCS command already does for the coverages that serve TIFF. It still needs the bytes in hand, so the window still waits. Pointing the user at a downloaded file also works and needs no service call, but it defeats Add Data From URL. Fetching a .prj beside the address, as world files are read for images, helps in general but does not cover a service that publishes none; the caller already knows the system, so crs answers it for one file.
Related issues
#1144 (closed) made a plugin's layer.addUrl answer pending instead of freezing the window; this request is its counterpart for ASCII grids. #987 (closed) made the ASCII reader honour independent DX and DY. #2075 (closed) added world files so a plain image opens in place, the sidecar precedent. #347 (closed) added GDAL PAM metadata for raster bands. #1330 and #1204 (closed) added the deferred address reads this would reuse.
- Lingua principale
- Rust
- Stelle
- 1.9k
- Fork
- 268
- Merge medio
- 11h 1m
- PR unite (30g)
- 942
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di 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 stepForse già presa @jgregoriorincon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opengeos/RustGIS#2621 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
opengeos/RustGIS#1446 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opengeos/RustGIS
Issue simili
-
文件夹重大BUG:不支持重命名Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
postgresql-rules / queue-rules: implicit KEY SHARE before a parent key update, and job self-overlapAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jonathanong/no-mistakes#3879 ·
I maintainer di solito rispondono entro 1 giorno
-
area:index v0.35.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
pbakaus/impeccable#1653 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
nautechsystems/nautilus_trader#5741 ·
I maintainer di solito rispondono entro 1 giorno