Select to view content in your preferred language

Extract Values to Table: wrong number of pixels

315
0
02-28-2022 07:42 AM
Labels (1)
RArosio
Emerging Contributor

Hello

I am iterating through a shapefile using a SearchCursor to extract the pixel values of a raster for each polygon in the shapefile using the Extract Values to Table (Geostatistical Analyst) tool. However, I noticed something strange - the number of pixel extracted for each polygon does not correspond to the right number of pixel encompassed by the polygon. I have attached a figure as example - the polygon contains 20 pixels (figure 1), however only 9 are extracted by the tool (figure 2). This is a snippet of the code I am using:

with arcpy.da.SearchCursor(in_features,['SHAPE@', 'FID']) as cursor:
    for row in cursor:
        try:
            print('processing row '+str(row[1]))
            arcpy.ga.ExtractValuesToTable(row[0], input_raster, workspace + 'dev')

Any idea of what is going on?

0 Kudos
0 Replies