2

How can I create a point that identifies the outer most point/corner of a polygon (one point per polygon)?.

It is easy to identify the centre point, but I cannot find options for the outer most corner.

  • 2
  • Export the vertices to points. Generate a point for the polygon center. Use the near tool to generate a table of distances from the center point to the polygon vertices. Some knowledge of iterators or some Python/arcpy skills will help. An advanced license is required to use the necessary tools in ArcGIS. – GBG Jul 10 '17 at 15:34
1

I have created this python script, according to your query. please feel free to try it. I hope it helps;

# It is assumed that the polygon feature does not contain multipart 

import arcpy
from arcpy import env


env.overwriteOutput = True   
env.workspace = "c:/data/default.gdb" # define your workspace

in_fc = "polygon"   # input polygon
centre_point_out = "final_centre" # This will contain centre point for each polygon | ORIG_FID field refers to the polygon OID
final_points = "final_points" # This will contain furthest vertices from centre point | POLY_ID field refers to the polygon OID 

sr = arcpy.Describe(in_fc).spatialReference


arcpy.FeatureToPoint_management(in_fc, centre_point_out, "")

# Create empty point featureclass
poly_verts_out = arcpy.CreateFeatureclass_management(env.workspace, "poly_verts", "POINT", "", "","", sr)
arcpy.AddField_management(poly_verts_out, "POLY_ID", "LONG")

ic = arcpy.da.InsertCursor(poly_verts_out, ["POLY_ID", "SHAPE@"])


# Get points from the polygons
sc = arcpy.da.SearchCursor(in_fc, ["OID@", "SHAPE@"])
for row in sc:
    poly_id = row[0]
    print "POLYGON : {}".format(poly_id)
    for p in row[1].getPart(0):
        ic.insertRow((poly_id, p))
    del row

del sc
del ic

# Now iterating through original polygon OID to analyze each polygon individually
poids = []

sc = arcpy.da.SearchCursor(in_fc, ["OID@"])
for row in sc:
    poids.append(row[0])
del sc

# Creates an empty Point featureclass to contain the furthest point for each polygon. This will be the final output

arcpy.CreateFeatureclass_management(env.workspace, final_points, "POINT", "", "","", sr)
arcpy.AddField_management(final_points, "POLY_ID", "LONG")
ic = arcpy.da.InsertCursor(final_points, ["SHAPE@", "POLY_ID"])

# Iterate over each OID and calculates furthest ponit in each polygon feature
for poid in poids:
    temp_origin = arcpy.Select_analysis(centre_point_out, "temp_origin", "{} = {}".format(arcpy.AddFieldDelimiters(in_fc, "OBJECTID"), int(poid)))
    temp_verts = arcpy.Select_analysis(poly_verts_out, "temp_verts", "{} = {}".format(arcpy.AddFieldDelimiters(poly_verts_out, "POLY_ID"), int(poid)))
    arcpy.Near_analysis(temp_verts, temp_origin)
    sc = arcpy.da.SearchCursor(temp_verts, ["SHAPE@", "NEAR_DIST"])
    marker = ["", 0.0]
    for row in sc:
        if marker[1] < row[1]:
            marker[0] = row[0]
            marker[1] = row[1]
    ic.insertRow((marker[0], poid))
    del marker
    del sc
del ic
| improve this answer | |

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