[gdal-dev] Geotransform for non-North-up images?

Javier Jimenez Shaw j1 at jimenezshaw.com
Mon Dec 21 04:03:29 PST 2020


What I do to compute the (single) GSD (or pixel size) when there is a
rotation is this:

GSD = sqrt(abs(determinant([2x2 top left corner])))

see that pixel size can be different in X and Y directions. If you know
your raster has no such distortion, you can just take the sqrt.
abs is important. Usually Y goes from top to bottom in images files, while
the other way around in coordinate systems. That produces a negative
determinant.

Cheers
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.



On Mon, 21 Dec 2020 at 12:55, Javier Jimenez Shaw <j1 at jimenezshaw.com>
wrote:

> Those transformation parameters can be seen as a 3x3 transformation matrix
> like this
>
> Xg     GT1 GT2 GT0     Xp
> Yg  =  GT4 GT5 GT3  *  Yp
>  1      0   0   1       1
>
> Where [Xp, Yp] is the coordinate in pixels, and [Xg, Yg] is the
> "geographic" coordinate (whatever it means ;)
>
> the 2x2 top left corner of the transformation matrix can be seen as a 2D
> rotation-scaling matrix:
> https://en.wikipedia.org/wiki/Transformation_matrix#Examples_in_2_dimensions
> [GT0, GT3] is the "geographic" coordinate of the pixel [0, 0] (regardless
> rotation or scaling)
>
> Cheers
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
>
> On Mon, 21 Dec 2020 at 12:34, G Seiffert <hh1 at posteo.de> wrote:
>
>> Hi all from GDLA.
>>
>> Thanks for the opportunity to as a question. It's regarding the Geotransform
>> Tutorial (https://gdal.org/tutorials/geotransforms_tut.html). Tried to
>> get info in the web but since this seems a tricky one, my searches failed.
>>
>> The tutorial only deals with the ideal case of 'North up' images, for
>> which GT(2) and GT(4) are zero. However, my images are 'East up' and
>> potentially 'any direction up' (underwater photomosaic surveys by ROV). The
>> rotation works with '90' for GT(2, 4). But the scaling seems completely
>> ignored. Any hint? If it would be easy, I assume your tutorial would give
>> an example for how to deal with "non-N-up' images, but ...
>>
>> My pics are 1920x1080, with pixel resolution of 0.0015 (yes, 0.15cm per
>> pixel, we're flying just 3m above the bottom).
>>
>> In case I rotate the images prior to geotransform (in Photoshop),
>> geotransform works perfect, with GT(2, 4) = 0. Scaling spot on. I can live
>> with that for our last survey but I'm also looking for a solution in case
>> our survey heading cannot be 0, 90, 180, or 270, but has to be something
>> like 35° (due to bottom currents etc.).
>>
>> Best regards, any hint qappreciated,
>> Gerhard
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201221/7b03c536/attachment.html>


More information about the gdal-dev mailing list