3

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.

A Merii
  • 143
  • 1
  • 7

1 Answers1

4

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)

Aaron
  • 51,658
  • 28
  • 154
  • 317