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?
xander_bakker, Dan_Patterson, seems like your sort of playing with geometries stuff.
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
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.
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:
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> fc <SPAN class="operator token">=</SPAN> <SPAN class="string token">'recs'</SPAN> <SPAN class="comment token"># polygon feature class</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> sr <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN>fc<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>spatialReference <SPAN class="comment token"># get spatial reference</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> outpolys <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="comment token"># placeholder</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> ratio <SPAN class="operator token">=</SPAN> <SPAN class="number token">25</SPAN> <SPAN class="comment token"># 25% polygons</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> step <SPAN class="operator token">=</SPAN> <SPAN class="number token">1</SPAN> <SPAN class="comment token"># evaluate every 1%</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>fc<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'SHAPE@'</SPAN><SPAN class="punctuation token">,</SPAN>spatial_reference<SPAN class="operator token">=</SPAN>sr<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN> <SPAN class="comment token"># loop through polygons</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> extent <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>extent <SPAN class="comment token"># get polygon extent</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> height <SPAN class="operator token">=</SPAN> extent<SPAN class="punctuation token">.</SPAN>height <SPAN class="comment token"># get polygon height</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> TL <SPAN class="operator token">=</SPAN> extent<SPAN class="punctuation token">.</SPAN>upperLeft <SPAN class="comment token"># top left corner</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> TR <SPAN class="operator token">=</SPAN> extent<SPAN class="punctuation token">.</SPAN>upperRight <SPAN class="comment token"># top right corner</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="keyword token">for</SPAN> i <SPAN class="keyword token">in</SPAN> range<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">100</SPAN><SPAN class="operator token">-</SPAN>ratio<SPAN class="punctuation token">,</SPAN>step<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="comment token"># evaluate every scenario from 25-100%</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> BY <SPAN class="operator token">=</SPAN> extent<SPAN class="punctuation token">.</SPAN>YMax<SPAN class="operator token">-</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>ratio<SPAN class="operator token">+</SPAN>i<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">/</SPAN><SPAN class="number token">100.0</SPAN><SPAN class="operator token">*</SPAN>height<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># get current bottom Y of evaluation polygon</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> BR <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Point<SPAN class="punctuation token">(</SPAN>extent<SPAN class="punctuation token">.</SPAN>XMax<SPAN class="punctuation token">,</SPAN>BY<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># bottom right corner</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> BL <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Point<SPAN class="punctuation token">(</SPAN>extent<SPAN class="punctuation token">.</SPAN>XMin<SPAN class="punctuation token">,</SPAN>BY<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># bottom left corner</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> poly <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Polygon<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>Array<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>TL<SPAN class="punctuation token">,</SPAN>TR<SPAN class="punctuation token">,</SPAN>BR<SPAN class="punctuation token">,</SPAN>BL<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>sr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>intersect<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># intersect evaluation polygon with current polygon</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> area_ratio <SPAN class="operator token">=</SPAN> poly<SPAN class="punctuation token">.</SPAN>area<SPAN class="operator token">/</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>area <SPAN class="comment token"># calculate area ratio</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="keyword token">if</SPAN> area_ratio<SPAN class="operator token">*</SPAN><SPAN class="number token">100</SPAN> <SPAN class="operator token">>=</SPAN> ratio<SPAN class="punctuation token">:</SPAN> <SPAN class="comment token"># if ratio is >= to threshold</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> outpolys<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>poly<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># remember the polygon</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> <SPAN class="keyword token">break</SPAN> <SPAN class="comment token"># stop evaluating larger polygons</SPAN> <SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CopyFeatures_management<SPAN class="punctuation token">(</SPAN>outpolys<SPAN class="punctuation token">,</SPAN>r<SPAN class="string token">'in_memory\outpoly'</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># write polygons</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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
Same Question was asked . see this link:
https://community.esri.com/thread/181265
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.