Pass the start point and end point data of a line using arcade and python to put it in a point feature class

373
0
11-02-2023 04:48 AM
JuanManuelCruzHerrera
New Contributor III

Hello, sorry for writing through a translator but I am Spanish.

The next issue is I need to get the first and last point of a polyline through Arcade, I know it can be done and with the help of the AI and reading the information from Arcade I have a slight idea, I put it in Field Maps because this project is worked on in Field Maps in Offline.
But it is evident that even if it tells me the first and last point, then that must go to an attribute rule and what is more important must be introduced in a goemetry feature class, point without Z or M, only X and Y so that those data that They are basically linear maneuvers against forest fires and then have the possibility of being analyzed knowing the entry and exit point of each maneuver.

var polyline = Geometry($feature); // Get the geometry of the polyline
var paths = polyline['paths']; // Get the paths of the polyline

var startPoint = First(First(paths)); // Get the starting point
var endPoint = Last(Last(paths)); // Get the end point

return {
'startPointX': startPoint[0],
'startPointY': startPoint[1],
'endPointX': endPoint[0],
'endPointY': endPoint[1]
};

But of course then you have to put it in a layer of points and that seems arcadey to me unless I'm wrong, you can't do it. And it would have to be done with python so that either it adds them from the line and that is only used to show it in the dashboard and the python geoprocess should be done either from Arcgis pro itself or from the API

Am I directing my thoughts correctly on how I should do it? Could I be missing something that I don't know? All possible help and recommendations are appreciated.

 

Thank you so much

 

Tags (3)
0 Kudos
0 Replies