AnsweredAssumed Answered

Area of a raster in Python

Question asked by nata.ocampo on Nov 8, 2012
Latest reply on Nov 9, 2012 by nata.ocampo
Hello,

I have a file full of rasters with a Value of 1, the rest is NoData.
I need to extract the Count for each raster, to then calculate the area, by multiplying by the cellsize.

I was trying to do this with the Get Raster Properties tool, using UNIQUEVALUECOUNT as the property type yin the script but instead of returning the count, it would return a 1.

  count = arcpy.GetRasterProperties_management (fileName, "VALUETYPE")

Is there an automated way to extract the count from a raster, using Python????

I would really appreciate your help.

thanks!

Outcomes