6

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.

enter image description here

11
  • 2
    a minimum distance of/from what?
    – Midavalo
    Commented Aug 3, 2016 at 3:28
  • 2
    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
    Commented Aug 3, 2016 at 3:35
  • 1
    @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
    Commented Aug 3, 2016 at 4:27
  • 1
    You need medial axis. Euclidian distance from it will define areas to grow. Buffer of 1.25 will do
    – FelixIP
    Commented Aug 3, 2016 at 4:28
  • 2
    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
    Commented Aug 3, 2016 at 6:11

2 Answers 2

6

Input:

enter image description here

Action, field calculator, python:

!Shape!.convexHull()

Output:

enter image description here

Please note that above is not solution for OP.

Possible workaround:

Inputs:

enter image description here Output and "prove": enter image description here

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:

enter image description here

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:

enter image description here

3
  • Note: You must be in an edit session for this to work, since you are modifying the geometry.
    – jbalk
    Commented Aug 3, 2016 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
    Commented Aug 3, 2016 at 6:58
  • 1
    @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
    Commented Aug 4, 2016 at 1:31
4

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:Red Line is Convex Hull

This is available with an ArcGIS Basic license level using the field calculator.

6
  • 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
    Commented Aug 3, 2016 at 5:58
  • There's a Convex Hull tool in ArcGIS too, doesn't just need to be done through field calculator.
    – Midavalo
    Commented Aug 3, 2016 at 6:04
  • 1
    @Midavalo note that the Minimum Bounding Geometry is available at an ArcGIS Basic level, but (annoyingly) the Convex Hull is not Commented Aug 3, 2016 at 6:15
  • 2
    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
    Commented Aug 3, 2016 at 6:20
  • 1
    OK since you changed the language of the answer, I am removing my down vote, though solution is not valid
    – FelixIP
    Commented Aug 3, 2016 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.