locationtech / locationtech/geotrellis
Int32 cells interpreted as float32 cells
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.4k
- Forks
- 360
- Avg merge
- 6h 57m
- Merged PRs (30d)
- 12
Description
Describe the bug
When trying to read geotiffs saved as Uint32 using GdalRasterSource, the tile is interpreted as float32 and all data come back as no data.
To Reproduce
Provide as able:
-
Steps to reproduce the behavior
Open UInt32 raster using GDALRasterSource and read pixel valiue -
Inputs
Presigned link to input file (expires April 15, happy to update link if required).
This file is saved using datatype=UInt32 and nbits=17
Same file but using datatype=UInt32 and nbits=32 (same result)
-
Actual output
Float32 tile, all pixel values are no-data (see screenshot) -
Expected output
Uint32 tile with correct pixel values
Expected behavior
Return Uint32 tile with correct pixel values
Screenshots
Annotated screenshot for relevant code section with debugger on.
https://wri-users.s3.amazonaws.com/tmaschler/geotrellis/screenshots/uint32_debug.png
Environment
- Scala version: 1.12
- GeoTrellis version: 3.5.1
- GDAL 3.1.2
Contributor 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.
Research direction
Start at the GdalRasterSource entry point and reproduce the issue with the provided UInt32 GeoTIFF inputs. Trace how the raster datatype becomes Float32, then verify completion when reading the files returns a UInt32 tile with the correct pixel values rather than no-data values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100