Calculate polygon area inside extent

4083
5
02-15-2013 10:26 AM
Sam_Evans
New Contributor
This is a crosspost from stackexchange

We're using ArcMap 10.0 sp5, creating a tool in C# using ArcObjects.

Is there a built in function or simple set of steps that calculates the area of each feature of a polygon layer within a specific extent? What we want to do is calculate the area inside a set of bounds for each of the polygon layer�??s features that reside within those bounds (defined by minimum and maximum X and Y). This process would be repeated multiple times, as we traverse a grid. Ideally, the function would also return the area not occupied by any features.

For example, consider a polygon layer in which there are three polygons (A, B, and C) Split the layer into a grid and look exclusively at one cell of that grid. Say the cell contains pieces of each polygon as well as some empty space, and that the polygons do not overlap.

We would like to get a measurement of the area that each feature occupies within that cell, along with a measurement of the "empty" area of the cell. The measurements could be in actual area (square feet, square meters, etc.) or merely a percentage of the area of the grid cell.
So either: A takes up 35 percent of the area of the cell, B takes up 11 percent of the area of the cell, C takes up 10 percent of the area of the cell, and 44 percent of the area is empty
or: A's area is 35 sq. m, B's area is 11 sq. m, C's area is 10 sq. m, and 44 sq. m is empty

We'd also like to keep in mind the case of overlapping polygons. Suppose C resides entirely within A (at least within the bounds of the cell).
Our ideal solution would give us: A takes up 35 percent of the area of the cell, B takes up 11 percent of the area of the cell, C takes up 10 percent of the area of the cell, but 54 percent of the area is now empty
or: A's area is 35 sq. m, B's area is 11 sq. m, C's area is 10 sq. m, and now 54 sq. m is empty

In this case, the sum of the area covered by each polygon would be greater than the total area covered by the grid cell. A and C both occupy the same area as in the first example, but their areas are not distinct.

We would either need to receive the values adding up to 110% (or 110 sq. m), or receive new percentages along the lines of: A takes up 31.8181818 percent of the area of the cell, B takes up 10 percent of the area of the cell, C takes up 9.0909091 percent of the area of the cell, and 49.0909091 percent of the area is now empty

If a function exists that performs the calculations described above, we would need to know exactly what the result of that calculation gives us.

Our current thought is to follow the workflow below, but we wanted to see if anyone had better ideas.


  1. Create a fishnet of the desired cell size and extent (to handle multiple grid cells at a time)

  2. Union the fishnet with the polygon feature class

  3. Calculate the area of all resultant features

  4. Traverse the resultant features (by grid cell) to read the area of each unioned feature manually. (In this case, features without an FID from the original polygon layer would be the area not occupied by any features)

  5. Sum the area of all features in the cell

  6. Compute the percentage for each feature based on the calculated sum from 5.

0 Kudos
5 Replies
LeoDonahue
Occasional Contributor III
Something like this?
http://planning.maricopa.gov/oppositioncase/

book: 125
map: 27
parcel: 088

We used geometrybag and geometrycollection, and your standard featurecursors and getting the shapes of the features, unioning them, and then summarizing the area.
0 Kudos
Sam_Evans
New Contributor
That looks very similar to what we're trying to do. I added images to the stackexchange post, if you want to check that out.

What are you using to union the features and calculate the area? I'm fairly new to ArcObjects, and there always seems to be a few different ways to do everything.
0 Kudos
LeoDonahue
Occasional Contributor III
This was all done in ArcObjects Java, but you can apply the process to your language.

We created a buffer polygon by buffering the subject parcel by 300'.

We create a spatialFilter setting the geometry to the buffer polygon

Then we get a featureCursor of all parcels that intersect that buffer polygon by applying the spatial filter to the featurelayer's searchDisplayFeatures method.  We get a featureCursor for opposed, a featureCursor for support and a featureCursor for no response parcels.

We loop through each featureCursor and get the geometry of each parcel in the buffer and then intersect that feature geometry with the buffer polygon and store the resulting geometry in a temporary geometry object - which then gives us the area of the intersecting feature.

I believe the Polygon class has an intersect method that we used.

Let me know if I can answer anything more...
0 Kudos
LeoDonahue
Occasional Contributor III
Oh, we used a geometryCollection and geometry bag to union the subject parcel, if a user entered more than one subject parcel.

The polygon class has a method called constructUnion which we passed the geometry bag as a IEnumGeometry.
0 Kudos
Sam_Evans
New Contributor
We've normally been using the geoprocessor to do things like that. I think it will be great to use ArcObjects functions directly. That's what they are there for, right?

Thanks so much. It will be a bit before I'll be able to try out your solution, but it's looking to be exactly the sort of thing we need. I'll follow up with any results when I get a chance.
0 Kudos