[Gdal-dev] Need a sanity check on processing imagery

Frank Warmerdam warmerdam at pobox.com
Sun Mar 11 01:15:42 EST 2007

Stephen Woodbridge wrote:
> Frank,
> Thank you! for the feedback. I have one question one this part:
> Frank Warmerdam wrote:
>>> Does this look like a reasonable process? Or is it flawed?
>> You are generating files for which the top left corner of the
>> top left pixel is at the lat/long location -11.9375,41.4375.
>> Is that want you want?  Sometimes people really want the center
>> of the top left pixel to be at that point.  If that is what you
>> want, you will need to manually adjust the extents "out" by a
>> half pixel.
> What is the easiest way to do this. Is it as simple as offsetting the 
> corners below by 0.5 before doing my projection to latlong?


No, I don't believe that would help.  The pixel size of the output
file is being computed by gdalwarp to roughly match that of the input
file in the new coordinate system.  I see in your earlier message the
output file had this pixel size:

Pixel Size = (0.00001153,-0.00001153)

This will tend to vary a little based on where the image is - but you
could pick an arbirary pixel size around this size - perhaps 0.00001 degrees.
If you do this, you would then offset your extents by half this amount
(0.000005) and specify the pixel size in the gdalwarp ("-tr 0.00001 0.00001").

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 OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list