Hi Filippo,
raster = gdal.Open(src_raster)
georef = raster.GetGeoTransform()
xmin, ymax = georef[0], georef[3]
Will work for a regular north-to-top image. More details at
http://www.gdal.org/gdal_tutorial.html under "Getting Dataset Information"
heading.
If you need to get extent of data, e.g. strip the nodata collar, have a
look at
http://gis.stackexchange.com/questions/45159/finding-minimum-bounding-extent-of-given-pixel-value-within-raster/
.
cheers,
Matt
On Mon, Jun 15, 2015 at 7:26 AM, Filippo Gualla <[email protected]>
wrote:
> Hi everybody,
> a quich question: I have a raster and I want to get the extent (xmin,
> xmax, ymin and ymax). I expected to find something like
> "gdal.GetExtent()"... I don“t think I have to run through all the
> coordinates with a loop...
> Regards,
> Filippo
>
> _______________________________________________
> Qgis-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user