I need to convert a network buffer polygon (that has gaps) into a solid polygon that extends to the maximum edge?
For example, from this...
to this:
The problem with a negative buffer following a positive buffer, is that the geometry will change. Not sure if that will yield the desired result. Best option IMHO is to have a look at an actual featureclass and get a better understanding of the situation.
Xander, which is why I suggested the buffer out with dissolve, buffer in. And if you look at the very top, a piece that wasn't initially connected is in the 'desired' output. Your code works, but it doesn't give the level of generalization that is implied... I guess it is the choice between the various options that have been proposed.
I have several questions, but it would probably be easier if you could attach a sample featureclass of what you have. I can run the code and send you back the result, and then it will probably be easier to discuss what needs to be changed and it can be changed into a tool so you can run it easily.
One of the things that is not entirely clear to me is that it seems you have overlap in the input polygons:
In the result you posted it seems to be merged into a "single" features:
Is that what you want?
Hi Everyone, I tried those techniques and while the union worked, when I dissolved the polygons, it merged into other separate files. Each polygon is a walkability buffer network, and I need to keep them separate. I want to create a "solid" buffer so that I can analyze other factors such as the amount of PT stops within the buffer. I have eliminate polygon which I also tried and didn't seem to work. Will the python code troubleshoot this do you think?
Thank you everyone, what a great online community!
Thank you Xander and everyone who has contributed, what a great community!
Below a small example of Python in case you have single part features (use the Multipart To Singlepart—Help | ArcGIS for Desktop tool). I digitized some roads and buffered them:
After running the Multipart to Singlepart tool I ended up with two features. When I run the code below (creating a new featureclass, not overwriting the input geometries), I end up with this:
Code used:
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">main</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">import</SPAN> arcpy fc <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'D:\Xander\GeoNet\EliminateHoles\gdb\data.gdb\roads_buf_sp'</SPAN> fc_out <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'D:\Xander\GeoNet\EliminateHoles\gdb\data.gdb\result01'</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 lst_feats <SPAN class="operator 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="punctuation token">(</SPAN><SPAN class="string token">'SHAPE@'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> curs<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> curs<SPAN class="punctuation token">:</SPAN> polygon <SPAN class="operator token">=</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> polyline <SPAN class="operator token">=</SPAN> polygon<SPAN class="punctuation token">.</SPAN>boundary<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> first_part <SPAN class="operator token">=</SPAN> polyline<SPAN class="punctuation token">.</SPAN>getPart<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN> polygon_new <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Polygon<SPAN class="punctuation token">(</SPAN>first_part<SPAN class="punctuation token">,</SPAN> sr<SPAN class="punctuation token">)</SPAN> lst_feats<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>polygon_new<SPAN class="punctuation token">)</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CopyFeatures_management<SPAN class="punctuation token">(</SPAN>lst_feats<SPAN class="punctuation token">,</SPAN> fc_out<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">if</SPAN> __name__ <SPAN class="operator token">==</SPAN> <SPAN class="string token">'__main__'</SPAN><SPAN class="punctuation token">:</SPAN> main<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</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>
If one doesn't have an Advanced License to use the Eliminate Polygon Part geoprocessing tool, there is a workflow posted on Stack Exchange that looks like it would work:
1. Use Union (Analysis) on the layer, being sure to uncheck the checkbox for "Gaps allowed (optional)". This will cause new polygons to be created wherever there are gaps.
2. Run Dissolve (Analysis) on the output of the Union to combine all the polygons.
Source: How to remove only donut holes from polygons using ArcGIS Desktop? - Geographic Information Systems Stack Exchange
Chris Donohue, GISP
With a side note that the Eliminate Polygon Part tool is only available if you have an Advanced license...
You can use Eliminate Polygon Part , in (Arc toolbox > Data Management Tools > Generalization > Eliminate Polygon Part ) specify area well and it will fill interior gabs.
thank you everyone, I am new to arcmaps so apologies for seemingly odd questions. I will try what you suggested, hopefully it works
Xander, yes None separates the inner and outer part or disjoint parts. You have to check the ring orientation or extent (or centroid)? of the parts to ensure one is a ring and not a disjoint part though. Even something as simple as discarding everything after the first duplicate point is reached works in most cases. Can be done with a search cursor, python or numpy, if the known bits are donuts, then it is simpler, because you just take the first part. I think we covered this before, somewhere.
The alternative would be to use some Python and only write the polygon parts that aren't holes back to the feature. I remember something like the holes being identified with a Point that is None. I guess it should be possible and possible with each license level.
One quick way, is to buffer out by an amount necessary to collapse the gaps, dissolving the buffers, then buffer than layer back in by the same amount. A bit cludgy, but it works and it doesn't appear that you need any other control since you are also joining parts that aren't currently joining
EDIT
Curtis recommended this procedure if you have the appropriate license level
https://community.esri.com/message/562005?commentID=562005#comment-562005
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.