[GIS] Maximum distance to polygon edge

arcgis-desktoparcpydistancepolygon

I have a point feature class and a polygon feature class, and each point is located within one polygon. Is there a way to programmatically calculate the distance from each point to the farthest location on its containing polygon's edge (see example below)?

I have an ArcGIS Desktop basic licence.

Example

Best Answer

As you have specified that the line from the point can pass in/out of the polygon then I think all you need to do is extract the Envelope of the polygon. You also state in the comment above you are look for an arcpy solution and you have a Basic license level.

You can get most of the way with model builder and a sneaky use of the fishnet tool to extract the Envelope. You could take that logic and convert it into a python script.

The image below was created by:

  • Using the fishnet tool to create a grid of one cell around the extent of the selected polygon.
  • I then ran the Intersect tool using the polygon and the generated envelope. This created the red points.
  • The Dashed line is the distance you are seeking. Unfortunately all the tools that would compute this require at least standard license level, very frustrating!

At this point you need to be using arcpy and cursors to cycle through the points and extracting the distance. What you want to look at is the method DistanceTo. So it's all achievable with the basic license level.

Example