3

This Stack Overflow question shows how to obtain the pixel dimensions of an image using Python.

Is it possible to find an image's height and width using arcpy and ArcGIS?

arcpy.Describe would seem like a logical place to start, but I can't see whether it returns the height and width properties. I looked at File Properties and Raster Dataset Properties - am I missing something obvious?

3
import arcpy

someRaster = arcpy.sa.Raster('TYPE HERE LINK TO YOUR RASTER')
someExtent = someRaster.extent

print someExtent

This should do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.