I am looking to compare the first and last point between features in two different feature classes. The features share a common ID. My thought was to create two arrays via FeatureClassToNumPyArray. Then combined them. There is some magic in FeatureClassToNumPyArray where you can use tokens to pull out different geometry parts, but there isnt a token for first or last point. Dan Patterson offers some context, but doesnt address pulling out specific points from a line geometry.
You use the ‘explode to points’ parameter and get the individual points, but only as additional rows and I don’t know if the point order (to determine first and last) is maintained, particularly if I was to pivot the table to it all in one row.
Here is the outline of the final array (or dictionary or list of list etc.) be based on:
[ID,FX1, FY1, FX2, FY2, LX1, LY1, LX2, LY2, DFX, DFY, DLX, DLY]
where F is first point, L is last point, 1&2 are the two feature classes, XY are the coordinates, D is the delta between the two.
The only other way I know to do this is using nested searchcursors and loops to loop through each feature while cracking option the geometry and comparing.