I have a python program to extract peaks in a DEM raster. After reclassifying the raster at various contours (e.g., 2 classes, above or below 130 m) and then converting the resultant raster to polygons, I extract zonal statistics (MAXIMUM value). The program iterates through various contour cutoffs, for instance from 100-140 in intervals of 10.
My problem is that one level (only) produces a zonal statistics raster that is striped and all the black areas have the same value. It is an intermediate level (120) while 110 and 130 give results that are fine. It is reproducible across machines. This level should have 4 different zones corresponding to the red polygons in the first image. Any ideas? The relevant zonal statistics statement is:
zoneField = "FID" # Execute ZonalStatistics outZonalStatistics = ZonalStatistics(OutPolygons_lyr, zoneField, master_raster, "MAXIMUM", "NODATA") outZonalStatistics.save("outZonalStatistics.tif") arcpy.AddMessage ("Finished zonal stats")