Repository navigation
Support GeoTIFF raster layers in the library - #307
Merged
Merged
Conversation
Library entries previously always loaded as GeoJSON. Entries now derive their format from the URL extension, and the format is passed through LoadFromLibrary to the network loader, which already routes rasters to the GeoTIFF loader. Adds two World rasters (Natural Earth 50m shaded relief, grayscale and color), hosted as 4096x2048 tiled COGs in the rgis-library bucket, and a test that every library entry has a recognized format.
frewsxcv
enabled auto-merge
October 8, 2026 04:14
frewsxcv
disabled auto-merge
October 8, 2026 04:26
frewsxcv
enabled auto-merge
October 8, 2026 04:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The app could already load and render GeoTIFF rasters from a file, but every library entry was loaded as GeoJSON because the format was hardcoded in
render_add_layer_window.rgis-library:Entry::format()derives the format from the URL extension (.geojson/.tif/.tiff), so existing entries don't need a new field. A test makes sure every entry has a recognized extension.rgis-ui:AddLayerOutput::LoadFromLibrarynow carries afile_format, which is passed toLoadFileMessage::FromNetworkinstead ofGeoJson. Entries with an unknown format get a disabled Add button.Raster files
Both come from Natural Earth's 50m rasters (10800×5400, stored in strips). The GeoTIFF loader only reads tiled files, so I downsampled them to 4096×2048 and converted them to tiled COGs (512px blocks, no overviews):
World/Shaded-Relief.tifWorld/Natural-Earth-Shaded-Relief.tifBoth files are already uploaded to the
rgis-librarybucket and can be downloaded from their public URLs.Testing
cargo test -p rgis-librarypasses.geo_raster::GeoTiffSourceas 4096×2048 rasters with EPSG:4326 and a full-world extent. The JPEG file's average R/G/B values matchgdalinfo -statsto within 0.1, so the YCbCr colors decode correctly.