pixel2world
gis.util.pixel2world(gtf, x, y)Calculate coordinates based on pixel location.
(Thanks to the ogr cookbook!)
Parameters
| Name | Type | Description | Default | 
|---|---|---|---|
| gtf | tuple | The geotransform of a grid dataset. Has the following shape: (left, xres, xrot, upper, yrot, yres). | required | 
| x | int | Column number of the pixel | required | 
| y | int | Row number of the pixel | required | 
Returns
| Name | Type | Description | 
|---|---|---|
| tuple | Return the x, y coordinates of the upper left corner of the cell. | 
Examples
# Load a dataset
gs = fiat.fio.GridSource(<some raster file>)
# Get the geotransform
gtf = gs.geotransform
# Calculate the coordinates
x, y = pixel2world(gtf, <column>, <row>)