[gdal-dev] Python-GDAL - How do I create a GeoTIFF from this array?

Javier Jimenez Shaw j1 at jimenezshaw.com
Fri Aug 2 04:39:33 PDT 2024


Oh, that is one step further.

There are two things:
 - the difference between center of the pixel and corner of the pixel (that
I was "reporting" in my previous email)
 - row from top down or bottom up.

Tiffs usually have the rows ordered top down. Technically can be also
bottom up, but it may be a problem with some software. It is a strange
thing. Avoid that.
In the top-down mode (that is the usual one), in the geotransform the pixel
size in the Y direction is negative, because the Y direction in the image
goes in the oposite direction as the CRS.

On Fri, 2 Aug 2024 at 07:00, Stefan Gofferje <lists at home.gofferje.net>
wrote:

> On 8/1/24 11:11, Javier Jimenez Shaw wrote:
> > IIRC the x,y for SetGeoTransform are for the top left corner of the top
> > left pixel. Not the center of the pixel. It can be confusing.
> > (that means that it does not change with the pixelsize if you downscale
> > or upscale ;)
>
> Oh, yeah, that would have caused some confusion because the data starts
> with the lower left corner...
>
> --
>   (o_   Stefan Gofferje            | SCLT, MCP, CCSA
>   //\   Reg'd Linux User #247167   | VCP #2263
>   V_/_  https://www.gofferje.net   | https://www.saakeskus.fi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240802/eb32962a/attachment.htm>


More information about the gdal-dev mailing list