[Gdal-dev] gdal_warp question

Frank Warmerdam warmerdam at pobox.com
Thu Apr 27 01:38:57 EDT 2006


Christopher Condit wrote:
> Hi list-
> I'm attempting to use gdal_warp to interpolate and resample an ArcInfo
> ASCII Grid.  I'm getting strange negative values in the output and I'm
> curious as to why that is.
> 
> gdal_translate.exe somedodssource[y][x] -a_srs EPSG:4326 -a_nodata -1
> -of AAIGrid out.txt
> gdalwarp -ot Float32 -wt Float32 -te -179.5 -89.5 179.5 89.5 -tr 1 1
> -srcnodata -1 -of GTiff out.txt test.tif

Chris,

I think you want -180 -90 180 90 as your extents.  The extents should
be from the "outside edge" of the image, not the center of the edge
pixels.

> I'm trying to regrid this data to 1 degree cells centered on the half
> degree.  I do get output - but the range is way off. There are many
> negative values in the output. The range of values in my input ascii
> file is 0.0 to 2736477.5.  They are floats.

I'm afraid I don't know why this is happening.   If the DODS source is
public perhaps you could provide the full commands.  Alternatively
could you send me directly the "out.txt" and I can try the second step?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list