Re: [gdal-dev] Coordinate space to pixel space with image rotation in python

2020-10-16 Thread Nicolas Cadieux
On 2020-10-16 11:49 a.m., Nicolas Cadieux wrote: Hi again! (a few months later...) What is the best practice for reading a single pixel in the raster? structval = raster_band.ReadRaster(column, row, 1, 1, 1, 1, raster_band.DataType) or structval = raster_band.ReadRaster(int(column), int(row

Re: [gdal-dev] Coordinate space to pixel space with image rotation in python

2020-01-28 Thread Even Rouault
Nicolas, > It's easy to go from coordinate space to pixel space in python using > something like. > > pixel_x = int(-124114.3 - geo_transform[0])/geo_transform[1]) > > What is the trick when there is an image rotation? Compute the inverse geotransform with https://gdal.org/api/raster_c_api

[gdal-dev] Coordinate space to pixel space with image rotation in python

2020-01-28 Thread Nicolas Cadieux
Hi, It's easy to go from coordinate space to pixel space in python using something like. pixel_x = int(-124114.3 - geo_transform[0])/geo_transform[1]) What is the trick when there is an image rotation?  Also, as a second very beginner question, what is the difference between geo_transfor