Since I was working with some geometry, a small demo
Start with a polygon from a featureclass
I have helper functions to get what I need from the geometry. There are other ways to get the data into a numpy array, so not a big deal. I also have a helper function to calculate interpoint distances.
# -- array_poly and npg.eucl_dist my helper functions, nice but not needed
p = array_poly([b0], p_type="POLYGON", sr=None, IFT=None)[0][0]
p.getPart(0)
arr = np.asarray([[i.X, i.Y] for i in p.getPart(0)])
dist = npg.eucl_dist(arr[:-1], arr[1:])
max_idx = np.unravel_index(np.argmax(dist, axis=None), dist.shape)
# -- you can get the x,y pairs
p.getPart(0) # -- the first part (outer-ring) of the first polygon
<Array [<Point (0.0, 0.0, #, #)>, <Point (2.0, 8.0, #, #)>, <Point (8.0, 10.0, #, #)>, <Point (10.0, 10.0, #, #)>, <Point (10.0, 8.0, #, #)>, <Point (9.0, 1.0, #, #)>, <Point (0.0, 0.0, #, #)>]>
arr # -- points to array
array([[ 0.00, 0.00],
[ 2.00, 8.00],
[ 8.00, 10.00],
[ 10.00, 10.00],
[ 10.00, 8.00],
[ 9.00, 1.00],
[ 0.00, 0.00]])
dist # -- the distance matrix
array([[ 8.25, 12.81, 14.14, 12.81, 9.06, 0.00],
[ 0.00, 6.32, 8.25, 8.00, 9.90, 8.25],
[ 6.32, 0.00, 2.00, 2.83, 9.06, 12.81],
[ 8.25, 2.00, 0.00, 2.00, 9.06, 14.14],
[ 8.00, 2.83, 2.00, 0.00, 7.07, 12.81],
[ 9.90, 9.06, 9.06, 7.07, 0.00, 9.06]])
max_idx
(0, 2) # row, col
dist[max_idx]
14.142308257222451
The results If you are interested in the helpers let me know.
But this only works for convex polygons. For concave polygons, you have to parse out the origin-destination pairs that cross the polygon boundary.
... sort of retired...