Extracting or clipping X amount of area from a polygon

1135
6
02-02-2017 07:41 AM
by Anonymous User
Not applicable

Hi! Is there a tool that can extract X amount of area from a polygon? For example, if you want to extract or clip 25% of a polygon going in a direction from north to south. Is that possible in ArcGIS?

0 Kudos
6 Replies
IanMurray
Frequent Contributor

xander_bakker‌, Dan_Patterson‌, seems like your sort of playing with geometries stuff. 

ChrisDonohue__GISP
MVP Alum

I'm not sure if this would do exactly what you want, but I will throw it out there as a possibility:

If the data can be loaded into a Parcel Fabric, there are some tools to work with that may be of help.  Note that you would need access to a Standard or Advanced license level.

Dividing parcels by area—Help | ArcGIS Desktop 

Chris Donohue, GISP

XanderBakker
Esri Esteemed Contributor

Sure Ian Murray , you can create script that will part the polygon trying to get 25% of the area with a horizontal line. Sounds like a nice challenge. However, you will have to define what to do with certain complex cases (will a multipart polygon be accepted, for instance?).

The option Chris Donohue, GISP provides, sounds like the easiest way to get there (I think). I would try that first.

If you decide to write a script in Python just let me know and I can see if I can collaborate with you, if that's what you want.

DanPatterson_Retired
MVP Emeritus

The horizontal or vertical moving dividing line is one of the most common ways of doing it since you can control the points that form the left or top of the moving dividing plane.  Implementation in numpy using the 'shoelace formula' has provide me with a way of looking at this  since you can incrementally calculate area rapidly.  In arcpy, there are builtin intersection methods which will facilitate this as well as calculating area.  I kind of dropped the idea because people were going on about wanting to subdivide by any angle they wanted... the bisecting plane need not be the same during the division process... they wanted to optimize the shape of the resultant parcels... yaddity yaddity.  In the end, a rough split, calculation and a dividing line shuffle was probably just as fast for the limited number of times that this has been requested.  Sometimes, you can account for all the specifications required and sometimes people can't articulate exactly how to do the division in the first place... other than 'equal'  Good luck

DarrenWiens2
MVP Honored Contributor

You can make this more complicated (e.g. input direction, evaluation threshold/precision), but here's a script that will result in approximately 25% polygons:

>>> fc = 'recs' # polygon feature class
... sr = arcpy.Describe(fc).spatialReference # get spatial reference
... outpolys = [] # placeholder
... ratio = 25 # 25% polygons
... step = 1 # evaluate every 1%
... with arcpy.da.SearchCursor(fc,'SHAPE@',spatial_reference=sr) as cursor:
...     for row in cursor: # loop through polygons
...         extent = row[0].extent # get polygon extent
...         height = extent.height # get polygon height
...         TL = extent.upperLeft # top left corner
...         TR = extent.upperRight # top right corner
...         for i in range(0,100-ratio,step): # evaluate every scenario from 25-100%
...             BY = extent.YMax-((ratio+i)/100.0*height) # get current bottom Y of evaluation polygon
...             BR = arcpy.Point(extent.XMax,BY) # bottom right corner
...             BL = arcpy.Point(extent.XMin,BY) # bottom left corner
...             poly = arcpy.Polygon(arcpy.Array([TL,TR,BR,BL]),sr).intersect(row[0],4) # intersect evaluation polygon with current polygon
...             area_ratio = poly.area/row[0].area # calculate area ratio
...             if area_ratio*100 >= ratio: # if ratio is >= to threshold
...                 outpolys.append(poly) # remember the polygon
...                 break # stop evaluating larger polygons
... arcpy.CopyFeatures_management(outpolys,r'in_memory\outpoly') # write polygons‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

AbdullahAnter
Occasional Contributor III

Same Question was asked . see this link:

https://community.esri.com/thread/181265