[gdal-dev] GDALComputeRasterMinMax Error
Chaitanya kumar CH
chaitanya.ch at gmail.com
Tue Jul 12 10:54:58 EDT 2011
RSyaoxin,
Check if poBand->GetNoDataValue() is actually returning a nodata value. If
your raster has an out of range nodata value, there is going to be a
problem. poBand->SetNoDataValue(nodata) will unset the nodata value if the
nodata variable is out of range.
On Tue, Jul 12, 2011 at 7:48 PM, RSyaoxin <RSyaoxin at hotmail.com> wrote:
> Hi,all
> I have a 32-float image with much "NoDatavalue",and I want to get the
> minimum value and maximum value.Here is my code:
>
> int bGotMin, bGotMax;
> double adfMinMax[2];
>
> double nodata=poBand->GetNoDataValue();
> poBand->SetNoDataValue(nodata);
> adfMinMax[0] = poBand->GetMinimum( &bGotMin );
> adfMinMax[1] = poBand->GetMaximum( &bGotMax );
> if( ! (bGotMin && bGotMax) )
> GDALComputeRasterMinMax(poBand, FALSE, adfMinMax);
>
> The maximum value(34.3386) I obtained that is right,but the minimum
> value is -1.#INF,not -61.990734. -61.990734 is what I want results. That's
> Why?I hope to get some help.
> Thank you!
> Kind regards.
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/GDALComputeRasterMinMax-Error-tp6575247p6575247.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
--
Best regards,
Chaitanya kumar CH.
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110712/935ec151/attachment.html
More information about the gdal-dev
mailing list