[FWTools] gdalwarp -geoloc

combal at free.fr combal at free.fr
Sat Mar 12 15:38:10 EST 2011


hi!

I've got a dataset containing 3 images:
lat for each pixel, lon for each pixel and value (in this case SST).
I think that gdalwarp would let me use the 2 first bands to reproject by using
the -geoloc arrays.
For that, I extracted the bands to a new dataset (in geotiff), adding the
meta-information, gdal_info shows:

Driver: GTiff/GeoTIFF
Files: mydataset.tif
Size is 2048, 1080
Coordinate System is `'
Metadata:
 SRS=EPSG:4326
 X_BAND=2
 Y_BAND=1
 PIXEL_OFFSET=0
 LINE_OFFSET=0
 PIXEL_STEP=1
 LINE_STEP=1
Image Structure Metadata:
 COMPRESSION=LZW
 INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1080.0)
Upper Right ( 2048.0,    0.0)
Lower Right ( 2048.0, 1080.0)
Center      ( 1024.0,  540.0)
Band 1 Block=2048x1 Type=Float32, ColorInterp=Gray
Band 2 Block=2048x1 Type=Float32, ColorInterp=Undefined
Band 3 Block=2048x1 Type=Float32, ColorInterp=Undefined


now, I'm trying to gdalwarp it:
gdalwarp -of gtiff -co "compress=lzw" -s_srs "EPSG:4326" -t_srs "EPSG:4326"
-geoloc mydataset.tif warped.tif

which fails with:
ERROR 1: Unable to compute a GEOLOC_ARRAY based transformation between
pixel/line
and georeferenced coordinates for mydataset.tif.

I can't figure out what is wrong or missing. I also tried to export the input
image to a VRT file, add some
geo-location+coordinate system: same error.

Does anyone know how this works?

Bruno


More information about the FWTools mailing list