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

gdalwarp: Using -dstnodata nan with output format COG is creating .aux.xml file #4847

Closed
maawoo opened this issue Nov 18, 2021 · 0 comments
Closed
Assignees

Comments

@maawoo
Copy link

maawoo commented Nov 18, 2021

Expected behavior and actual behavior.

Expected:
gdalwarp -of COG -co COMPRESS=DEFLATE -srcnodata 0 -dstnodata nan in.tif out.tif
behaves similar to
gdalwarp -of GTiff -co COMPRESS=DEFLATE -srcnodata 0 -dstnodata nan in.tif out.tif

Actual:
Using the COG driver as output format creates an additional .aux.xml file with the following content:

<PAMDataset>
  <PAMRasterBand band="1">
    <Description>Gamma0_VH</Description>
    <NoDataValue le_hex_equiv="000000000000F87F">nan</NoDataValue>
  </PAMRasterBand>
</PAMDataset>

I wasn't able to find much information regarding this. Other than that I don't see any important differences in both files and nan is successfully used as the nodata value in both:

Metadata:
  AREA_OR_POINT=Area
  Band_1=Gamma0_VH
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
  LAYOUT=COG

Band 1 Block=512x512 Type=Float32, ColorInterp=Gray
  Description = Gamma0_VH
  Minimum=0.000, Maximum=4321.163, Mean=0.060, StdDev=0.534
  NoData Value=nan
  Overviews: 14574x11382, 7287x5691, 3643x2845, 1821x1422, 910x711, 455x355
  Metadata:
    STATISTICS_MAXIMUM=4321.1630859375
    STATISTICS_MEAN=0.060035507447176
    STATISTICS_MINIMUM=3.781369173339e-08
    STATISTICS_STDDEV=0.53371453663701
    STATISTICS_VALID_PERCENT=63.98
Metadata:
  AREA_OR_POINT=Area
  Band_1=Gamma0_VH
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND

Band 1 Block=29148x1 Type=Float32, ColorInterp=Gray
  Description = Gamma0_VH
  Minimum=0.000, Maximum=4321.163, Mean=0.060, StdDev=0.534
  NoData Value=nan
  Metadata:
    STATISTICS_MAXIMUM=4321.1630859375
    STATISTICS_MEAN=0.060035507447113
    STATISTICS_MINIMUM=3.781369173339e-08
    STATISTICS_STDDEV=0.53371453663706
    STATISTICS_VALID_PERCENT=63.98

Steps to reproduce the problem.

See above

Operating system

Windows 10

GDAL version and provenance

GDAL 3.3.1 via conda

@rouault rouault self-assigned this Nov 21, 2021
rouault added a commit that referenced this issue Nov 22, 2021
GDALPamRasterBand::CloneInfo(): deal correctly with NaN nodata to avoid generating useless .aux.xml file (fixes #4847)
github-actions bot pushed a commit that referenced this issue Nov 22, 2021
GDALPamRasterBand::CloneInfo(): deal correctly with NaN nodata to avoid generating useless .aux.xml file (fixes #4847)
rouault added a commit that referenced this issue Nov 22, 2021
[Backport release/3.4] GDALPamRasterBand::CloneInfo(): deal correctly with NaN nodata to avoid generating useless .aux.xml file (fixes #4847)
maawoo added a commit to SAR-ARD/s1ard that referenced this issue Jun 23, 2022
OSGeo/gdal#4847
Issue is closed, but this might still occur. Was observed in GDAL 3.5
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

No branches or pull requests

2 participants