calculate zonal statistics using overlapping polygons

10168
14
Jump to solution
05-15-2015 09:35 AM
HannahPomella
New Contributor II

Hello! I'm trying to calculate zonal statistics with a grid as input and overlapping circles in a feature class as areas. As I understud the software is converting the feature class with the polygons in a raster file in the background and clips the polygons. Can I avoid this somehow or is there an other possibility to extract this spatial information from the grid? What I would need is the number of cells with specific values within a 2000m radius around points. Thanks!

Tags (3)
14 Replies
HannahPomella
New Contributor II

0 Kudos
HannahPomella
New Contributor II

A ok, now  I sow there is a ) missed at the end.

solved this error

got a new one 🙂

DarrenWiens2
MVP Honored Contributor

What type of feature class are you working with? Where clauses are data-specific (see the help for Make Feature Layer, where clause section). My example used a shapefile - fields are enclosed by double quotes. File GDB fields have no quotes. Personal GDB fields are enclosed by []. A nice way to figure it out is to run Make Feature Layer once through the normal tool dialog to figure out the syntax. Once you get it to work once, you can export the result from the results window to a Python snippet and inspect the syntax more fully in a text editor or IDE

0 Kudos
curtvprice
MVP Esteemed Contributor

Another reason to eschew mdb.

You can generate the correct delimeters with arcpy.AddFieldDelimeters. The code below would return "[POI_Nr]" if ZoneFC was in a pGDB.

arcpy.AddFieldDelimeters(
    os.path.dirname(arcpy.Describe("ZoneFC").catalogPath),
    "POI_Nr")
HannahPomella
New Contributor II

Hi!

I was using a personal GDB. Now I export the data to shapefile and run the code again.

Its working at least a bit 🙂

It creates a table with one entry and then stops with a error.

0 Kudos