Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add read-only raster driver, SNAP_TIFF, for Sentinel Application Processing GeoTIFF files #10867

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Sep 24, 2024

Such files are formulated in a way that makes it difficult to read them with the generic GTiff driver:

  • single strip of uncompressed Float32 data type (1.7 GB on the sample file I worked on)
  • more than 65,535 GCPs in the GeoTIFF TiePoints tag (> 1 million), which make it impossible to read with libgeotiff. Furthermore those tiepoints form actually a geolocation array, and are thus best represented using the GDAL GEOLOCATION formalism
  • a unknown TIFF tag of code 65000, which happens to contain XML DIMAP metadata of several megabytes. Part of it contains information on the nodata value, offset and scale, and thus must be parsed to report appropriate band properties

All that combined calls for a specialized driver, instead of cluttering even more the generic GTiff driver.
To help for that, I've developed a simple TIFF reader in https://github.com/libertiff/libertiff and included it here.

@rouault rouault added this to the 3.10.0 milestone Sep 24, 2024
@rouault rouault force-pushed the snaptiff branch 2 times, most recently from ec3525a to 822385e Compare September 24, 2024 13:34
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 69.427% (+0.007%) from 69.42%
when pulling 822385e on rouault:snaptiff
into 6aa2e2e on OSGeo:master.

…essing GeoTIFF files

Such files are formulated in a way that makes it difficult to read them with the
generic GTiff driver:
- single strip of uncompressed Float32 data type (1.7 GB on the sample file I worked on)
- more than 65,535 GCPs in the GeoTIFF TiePoints tag (> 1 million), which make it
  impossible to read with libgeotiff. Furthermore those tiepoints form
  actually a geolocation array, and are thus best represented using the
  GDAL GEOLOCATION formalism
- a unknown TIFF tag of code 65000, which happens to contain XML DIMAP
  metadata of several megabytes. Part of it contains information on the
  nodata value, offset and scale, and thus must be parsed to report
  appropriate band properties

All that combined calls for a specialized driver, instead of cluttering
even more the generic GTiff driver.
To help for that, I've developed a simple TIFF reader in https://github.com/libertiff/libertiff
and included it here.
@rouault rouault merged commit 68a230b into OSGeo:master Oct 9, 2024
36 checks passed
@jratike80
Copy link
Collaborator

It seems a bit like new QGIS nightly builds are now offering this SNAP_TIFF format as a default output format for some processes like clip raster. It may be only a QGIS bug but I make a note here. I can investigate the QGIS side better later but now I have a real work that I must do first.

@rouault
Copy link
Member Author

rouault commented Oct 16, 2024

It may be only a QGIS bug

much likely, because on the GDAL side, we don't expose any creation capabilities

@rouault
Copy link
Member Author

rouault commented Oct 16, 2024

It seems a bit like new QGIS nightly builds are now offering this SNAP_TIFF format as a default output format for some processes like clip raster.

I don't reproduce this with my QGIS dev build against a GDAL version with SNAP_TIFF. The GTiff driver is correctly selected. That said there was definitely a known issue with format selection in QGIS processing, but it has been fixed in qgis/QGIS#57702

@jratike80
Copy link
Collaborator

Raster Extraction - Clip raster by extent for example creates a GDAL command

gdal_translate -projwin 360853.6639 6714413.7697 360961.8182 6714257.3265 -of SNAP_TIFF C:\data\dem2m.tif C:/Users/JRAHKONEN/AppData/Local/Temp/processing_giGcnu/ad37cba320a145848a03c12bed16db8d/OUTPUT.tif

My QGIS version is from OSGeo4W:

3.39.0-Master
QGIS code revision
40246d3509

Similar error has happened before because Interlis format got selected https://gis.stackexchange.com/questions/477614/polygonize-error/477617, maybe that does not happen any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants