I have a point feature class (BUS_STATIONS), and an M-enabled line feature class (ROADS)
We are trying to build an attribute rule on the BUS_STATIONS feature class, that would populate a field with the M-value of the nearest point of the road. NOTE: I don't want the M-value of the nearest vertex (which could be far away) but rather the nearest portion of the line. What I was thinking to do was the following:
1. Find the coordinates of that nearest point (not vertex) on the line
2. Then find the M-values of the vertex before and after that point and calculate the M value.
But right now I'm stuck with step #1. Any ideas how to achieve that?
Thank you
Chaim
a point feature class, that will populate the M value of the nearest li
Solved! Go to Solution.
We eventually got it to work, thanks to our amazing developers Eduard and Sara. The logic we use is basically:
1. Calculate the distance between the BUS_STATION point and all the vertices in the adjacent ROAD.
2. For all segments between vertices, calculate the nearest distance from the BUS_STATION to that segment (length of line perpendicular to that segment).
3. Choose the shortest of all outcomes and retrieve the M-value of that point.
Since you want the calculated M for that location, I am guessing that https://developers.arcgis.com/arcade/function-reference/geometry_functions/#nearestcoordinate will not work?
All the logic you need to get the nearest points and the two bounding vertex to calculate the M is in this rule:
We eventually got it to work, thanks to our amazing developers Eduard and Sara. The logic we use is basically:
1. Calculate the distance between the BUS_STATION point and all the vertices in the adjacent ROAD.
2. For all segments between vertices, calculate the nearest distance from the BUS_STATION to that segment (length of line perpendicular to that segment).
3. Choose the shortest of all outcomes and retrieve the M-value of that point.