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...
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
Curtis recommended this procedure if you have the appropriate license level
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.
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.
thank you everyone, I am new to arcmaps so apologies for seemingly odd questions. I will try what you suggested, hopefully it works
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.
With a side note that the Eliminate Polygon Part tool is only available if you have an Advanced license...
Thank you Xander and everyone who has contributed, what a great community!
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
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:
def main(): import arcpy fc = r'D:\Xander\GeoNet\EliminateHoles\gdb\data.gdb\roads_buf_sp' fc_out = r'D:\Xander\GeoNet\EliminateHoles\gdb\data.gdb\result01' sr = arcpy.Describe(fc).spatialReference lst_feats =  with arcpy.da.SearchCursor(fc, ('SHAPE@')) as curs: for row in curs: polygon = row polyline = polygon.boundary() first_part = polyline.getPart(0) polygon_new = arcpy.Polygon(first_part, sr) lst_feats.append(polygon_new) arcpy.CopyFeatures_management(lst_feats, fc_out)if __name__ == '__main__': main()
Thank you everyone, what a great online community!
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?
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?
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.
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.
true... but the area above your blue oval in the second image is what got me thinking about it, the geometry seems quite generalized in spots... but that type of generalization could be readily done after the holes are removed, rather than relying on buffering to close them.
Retrieving data ...