TransWikia.com

Determining the Unit of Spatial Resolution of a raster image in Python

Geographic Information Systems Asked by A Merii on February 7, 2021

I have some raster images, and I would like to determine the GSD using Python.

I know that I can use rasterio.transform() or gdal.GetGeoTransform() to extract the spatial resolution of the image.

How do I determine the units of the spatial resolution.

One Answer

You can use the linear_units property in the crs class. For example:

import rasterio

raster = rasterio.open('/path/to/your/raster.tif' )

print(raster.crs.linear_units)

Answered by Aaron on February 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP