[gdal-dev] Re: The world is flipped redux

Roger André randre at gmail.com
Mon Aug 11 11:50:26 EDT 2008


Cool, thanks.  I'll add some print statements to the script to see what's
being written, will flip the y-axis coords in the output, and will verify
that the origin values and pixel dimensions are properly expressed in the
output.

It's neat that you can do this sort of thing with gdal.
--

On Sun, Aug 10, 2008 at 10:21 AM, Jamie Adams <jaadfoo at gmail.com> wrote:

> It looks like Matt's script doesn't modify the geotransform, just reverses
> the rows in the image.  You probably need to calculate a new ulx and make
> sure the pixel dimensions are expressed correctly (+/-).
>
> From the sound of it, your original image would actually be right if the
> viewer software read the corner coordinates and displayed the image based on
> those.  :-)
>
> -Jamie
>
> On Fri, Aug 8, 2008 at 4:51 PM, Roger André <randre at gmail.com> wrote:
>
>> My apologies to Matt, the flip_raster.py does flip something, as when I
>> compare the images in OpenEV, I can see that they are reversed.  But when I
>> compare their corner coords with gdalinfo, they appear identical.
>>
>> $ gdalinfo test.tif
>> <snip>
>> Corner Coordinates:
>> Upper Left  ( -71.3600000, -23.5000000)
>> Lower Left  ( -71.3600000,  -8.5000000)
>> Upper Right ( -55.7000000, -23.5000000)
>> Lower Right ( -55.7000000,  -8.5000000)
>>
>> $ gdalinfo bolivia_fullres.tif
>> <snip>
>> Corner Coordinates:
>> Upper Left  ( -71.3600000, -23.5000000)
>> Lower Left  ( -71.3600000,  -8.5000000)
>> Upper Right ( -55.7000000, -23.5000000)
>> Lower Right ( -55.7000000,  -8.5000000)
>>
>> My head hurts.
>> --
>>
>>
>> On Fri, Aug 8, 2008 at 4:24 PM, Roger André <randre at gmail.com> wrote:
>>
>>> Ok, this is driving me nuts, I can't handle "South is up" anymore.  I
>>> have NetCDF derived GMT grids which have a flipped y-axis.  This makes for
>>> georeferencing that looks like this:
>>> Corner Coordinates:
>>> Upper Left  ( -90.0000000, -90.0000000)
>>> Lower Left  ( -90.0000000,   0.0000000)
>>> Upper Right (   0.0000000, -90.0000000)
>>> Lower Right (   0.0000000,   0.0000000)
>>>
>>> I've seen some old discussions about this, but haven't really found a
>>> good solution.  I've tried a "flip_raster.py" utility that Matt Perry wrote,
>>> but it doesn't seem to do anything with my data.  (probably due to my crappy
>>> data, not Matt's tool) I've also read that there have been some rewrites of
>>> the NetCDF driver that are supposed to be able to deal with this, but I'm
>>> not sure about that.
>>>
>>> How have others out there dealt with this issue?  I'd like to be able to
>>> convert the grids into GeoTIFF's and have the TIFF's be "right" side up.
>>>
>>> Thanks,
>>>
>>> Flipped-off Roger
>>> --
>>>
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080811/ea53d4fd/attachment.html


More information about the gdal-dev mailing list