Moving a point to a line
Need some assistance, I'm building a workflow that allows a user to right click on the map to create new points; problem is, I need those new points to be ‘snapped’ to the road line before it gets written to the feature service. When I create a point at an existing intersection, this is not an issue, a simple reverse geocode with the option to return intersection gets me what I need.
Where I'm currently struggling is when points are created mid-block, not at an intersection. I'm able to identify the closest road to the point by buffering the point and querying the roads layer. Where I'm having issues is when I try to identify the closest part of the road (ideally perpendicularly) and then moving the point.
Any Ideas would be appreciated.
-
The easiest way would be to enable snapping on the Road Lines layer. This will make sure that a selected point will be located on a road. (unless the point is too far from the road to begin with, but that's easily tested)
Calculating the nearest point on a line can of course be done, too. Unfortunately the ArcGIS Geometry service does not have a useful function to do that, but a GP tool with arcpy should do the trick. Another way would be to create a custom workflow activity that does the hard work in JavaScript.
Doing this in a workflow is also possible, but would require you to dust of your high school Trigonometry books, I guess ;-) I don't think such a workflow would be fun to write though
0
Please sign in to leave a comment.
Comments
1 comment