[Feature]: Read an ESRI ASCII grid from a web address, and let crs place it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
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.
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?
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.
- 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