I have a polyline SHP (with only one feature) that I have converted to a route using
arcpy.CreateRoutes_lr(). I have a separate points SHP that is spatially scattered about the line. I want to "collapse" the points onto the route, and then for each FID in the points file, find the distance of the collapsed point along my route, relative to the start of the route.
I tried Locate Features Along Routes just in ArcMap from the toolbox, as suggested by "gisnside" here, but the distance returned is the distance between the point and the line (exactly the same output as Near Analysis gives), not the distance of the collapsed point along the line.
- Both polyline and points SHPs are in the same UTM projection.
- The "route_id" layer is correct in the route file.
- All of the points have a unique integer id in a "pointid" field
- Must be accomplished in ArcPy; process to run many times.
# file location setup myline = r'mypath\line_projected.shp' mypoints = r'mypath\points_prpjected.shp' arcpy.AddGeometryAttributes_management(myline, "LENGTH_GEODESIC", Length_Unit = "METERS") outroute = mypath + '\\' + 'myroute.shp' arcpy.CreateRoutes_lr(myline, "route_id", outroute, "LENGTH", coordinate_priority = "LOWER_LEFT") # ... what tool to use ...