Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#1595 closed defect (fixed)

GDALComputeRasterMinMax is failing on NETCDF subdasets

Reported by: jluis Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.4.3
Component: GDAL_Raster Version: 1.4.0
Severity: normal Keywords:
Cc: warmerdam

Description (last modified by Mateusz Łoskot)

Create a NETCDF file using GMT's example 5 (the mexican hat)

grdmath -R-15/15/-15/15 -I0.3 X Y HYPOT DUP 2 MUL PI MUL 8 DIV COS EXCH NEG 10 DIV EXP MUL = sombrero.grd

Using this example file (sombrero.grd) the following example code returns adfMinMax[0] = adfMinMax[1] = 0

hDataset = GDALOpen(gdal_filename, GA_ReadOnly);
hBand = GDALGetRasterBand(hDataset,1);
GDALComputeRasterMinMax(hBand, FALSE, adfMinMax);

Attachments (2)

sombrero.grd (41.4 KB ) - added by jluis 17 years ago.
test.cpp (772 bytes ) - added by Mateusz Łoskot 16 years ago.
Simple program testing computation of min/max for sombrero.grd

Download all attachments as: .zip

Change History (10)

comment:1 by jluis, 17 years ago

Version: unspecified1.4.0

comment:2 by warmerdam, 17 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Milestone: 1.4.3
Owner: changed from warmerdam to Mateusz Łoskot

Mateusz,

Could you look into this? JLuis, it would be helpful if you could attach a small sample GMT file with demonstrating the issue, saving Matuesz the time to install GMT.

comment:3 by Mateusz Łoskot, 17 years ago

Status: newassigned

JLuis,

I'd appreciate if you could attach sample GMT file I could use to reproduce the problem. If it's a problem with uploading it here, because of size/copying issue, perhaps you could send it on my e-mail (mateusz at loskot dot net). Thank you in advance.

by jluis, 17 years ago

Attachment: sombrero.grd added

comment:4 by Mateusz Łoskot, 16 years ago

Description: modified (diff)

by Mateusz Łoskot, 16 years ago

Attachment: test.cpp added

Simple program testing computation of min/max for sombrero.grd

comment:5 by Mateusz Łoskot, 16 years ago

I prepared and run small test (see test.cpp program attached) and I can not reproduce this problem. GDAL calculates min and max values for sombrero.grd dataset as follows:

mloskot@dog:~/dev/gdal/bugs/1595$ ./test sombrero.grd 
Min: -0.675759
Max: 1

So, I'm inclined to say this bug has been fixed since GDAL 1.4.0.

comment:6 by Mateusz Łoskot, 16 years ago

Resolution: fixed
Status: assignedclosed

JLuis, I'm closing this ticket. Please reopen if the problem still occurs for you when using GDAL in newer version than 1.4.0.

comment:7 by Mateusz Łoskot, 16 years ago

Frank, would it be reasonable to add sombrero.grd file and appropriate test case to the autotest package?

comment:8 by Mateusz Łoskot, 16 years ago

I added sombrero.grd dataset to autotest package and extended NetCDF test cases accordingly (r12456)

Note: See TracTickets for help on using tickets.