# How to expand a polygon to a minimum allowable distance?

I am looking for a method to expand certain areas of a single polygon to meet a minimum distance requirement. For example, the screenshot shows a polygon in green where I want to expand areas to a minimum distance of 2.5 km. The solid black polygon is a rough example of what I hope to accomplish. Buffering everything by X distance will not work because I am trying to preserve as much of the original shape and area as possible. How can I expand certain areas to meet the minimum 2.5 km requirement and minimize any increase in total area?

I am interested in any vector or raster based approaches and I am using ArcGIS for Desktop with a Basic license and the ArcGIS distribution of Python.

• a minimum distance of/from what? – Midavalo Aug 3 '16 at 3:28
• Is your end goal to make the green polygon look like the black polygon? Or you just want to expand the green by 2.5km and limit by the black? How about a buffer and a clip? – Fezter Aug 3 '16 at 3:35
• @Aaron is the assumption that the 2.5km (min) line is perpendicular to the one side or the other? Otherwise your corners will always be an issue – Midavalo Aug 3 '16 at 4:27
• You need medial axis. Euclidian distance from it will define areas to grow. Buffer of 1.25 will do – FelixIP Aug 3 '16 at 4:28
• These posts might help for finding medial centrelines: gis.stackexchange.com/q/5305/7424 and gis.stackexchange.com/q/177/7424 and gis.stackexchange.com/q/2775/7424 – Fezter Aug 3 '16 at 6:11

## 2 Answers

Input:

Action, field calculator, python:

``````!Shape!.convexHull()
``````

Output:

Please note that above is not solution for OP.

Possible workaround:

Inputs:

Output and "prove":

As one can see definition of "opposite" sites is crucial. It is near obvious in your example though.

I have my own script to create axis, it is untidy and I don't want to share it. Let me know if you are struggling with axis drawing, I'll post raster solution

Raster solution to get axis:

@Aaron Create empty polyline feature class, start editing it, select original polygon, copy/paste it to the line. All this is because of Basic type license, so that you cannot use feature to line tool.

You need this line for 1st step:

``````arcpy.gp.EucDistance_sa("Converted_Graphics_2", "D:/Scratch/distance", "", "20", "")
``````

This shows hillshade of above distance raster:

``````arcpy.gp.Slope_sa("distance", "D:/Scratch/slope", "DEGREE", "1")
arcpy.gp.RasterCalculator_sa("""Con("distance" == 0,200,"slope")""", "D:/Scratch/cost")
arcpy.SelectLayerByAttribute_management("Source_Dest", "NEW_SELECTION", "Name" = 'A')
arcpy.gp.CostBackLink_sa("Source_Dest", "cost", "D:/Scratch/blink", "", "")
arcpy.gp.RasterCalculator_sa("""Int(Power(2,"blink"-1))""", "D:/Scratch/flowdir")
arcpy.SelectLayerByAttribute_management("Source_Dest", "NEW_SELECTION","Name" = 'B')
arcpy.gp.CostPath_sa("Source_Dest", "flowdir", "flowdir", "D:/Scratch/path", "EACH_CELL", "FID")
arcpy.gp.StreamToFeature_sa("path", "flowdir", "D:/Scratch/axis.shp", "SIMPLIFY")
``````

Result shows AXIS created at the last step by blue arrows line:

• Note: You must be in an edit session for this to work, since you are modifying the geometry. – jbalk Aug 3 '16 at 6:24
• It is not a case unless there is related table in database. Most of field calculations including geometry field can be done outside of editing session – FelixIP Aug 3 '16 at 6:58
• @Aaron see update. When using this approach make sure your environment extent is slightly bigger than your polygon, so that points A,B sitting inside it. Use reasonable cell size to make it work faster – FelixIP Aug 4 '16 at 1:31

It is unlikely that you will be able to perform this task automatically. You may be able to get close using convex hull. This will create a polygon that encloses the shape like this:

• If you are not comfortable using the field calculator and have access to QGIS, there is a convex hull tool in the vector toolbox in QGIS. – jbalk Aug 3 '16 at 5:58
• There's a Convex Hull tool in ArcGIS too, doesn't just need to be done through field calculator. – Midavalo Aug 3 '16 at 6:04
• @Midavalo note that the Minimum Bounding Geometry is available at an ArcGIS Basic level, but (annoyingly) the Convex Hull is not – Stephen Lead Aug 3 '16 at 6:15
• You can download "Create Convex Hull" tool from this link: arcgis.com/home/item.html?id=7ce38f8d64dd44f7873051069e56461f and add it to ArcToolbox. It works with all license levels. – ahmadhanb Aug 3 '16 at 6:20
• OK since you changed the language of the answer, I am removing my down vote, though solution is not valid – FelixIP Aug 3 '16 at 7:02