[gdal-dev] gdal_translate takes negative values as an option (?)

Ivan Lucena ivan.lucena at princeton-ma.us
Fri Jun 1 08:17:46 PDT 2012


It turns out that gdal_translate -scale doesn't parse exponential by using the function ArgIsNumeric:

http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_translate.cpp#L1258

It works fine with -0.0000000000000000000000000000000000034

Users be aware!

>  -------Original Message-------
>  From: Ivan Lucena <ivan.lucena at princeton-ma.us>
>  To: gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
>  Subject: [gdal-dev] gdal_translate takes negative values as an option (?)
>  Sent: Jun 01 '12 06:17
>  
>  Hi there,
>  
>  I tried to re-scale some of the values of a image just like this one here:
>  
>  $ gdalinfo in.tif
>  ...
>    Minimum=2401.740, Maximum=2936.040, Mean=2685.227, StdDev=125.518
>    NoData Value=-3.4e+38
>  
>  By using the -scale option in gdal_translate:
>  
>  $ gdal_translate in.tif out.tif -scale -3.8e+38 0 0 0 -a_nodata 0
>  Option -3.8e+38 incomplete, or not recognised.
>  
>  But it seems like the "-" was interpreted as the beginning of an option.
>  
>  That happens at that line of code here:
>  
>  http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_translate.cpp#L457
>  
>  It looks like a bug but it might have some other implications that I can't see.
>  
>  Other parameters, like -a_ullr, doesn't have that problem because the values are not optional as in -scale.
>  
>  Any suggestion?
>  
>  Regards,
>  
>  Ivan
>  
>  _______________________________________________
>  gdal-dev mailing list
>  gdal-dev at lists.osgeo.org
>  http://lists.osgeo.org/mailman/listinfo/gdal-dev
>  


More information about the gdal-dev mailing list