What tool do I use to generate points along a line from an input list of lengths?
Length_km 0.12 0.2 0.38 etc.
ArcPy solutions are okay.
testOut = outpath + '\\' + 'testOut' arcpy.LocateFeaturesAlongRoutes_lr('pts.shp', 'polyline.shp', route_id_field = 'OBJECT_ID', radius_or_tolerance = "", out_table = testOut, out_event_properties = "", route_locations = "ALL", distance_field = "DISTANCE", zero_length_events = "ZERO", in_fields = "FIELDS", m_direction_offsetting = "M_DIRECTON")
& received the following error:
ERROR 000709: The type of out_event_properties does not match the type of in_features. Failed to execute (LocateFeaturesAlongRoutes).
Based on @jbalk 's suggestions, I tried the following code (note that my .py script and .shp, .dbf files are in the same directory, so just calling .shp without a path works here):
makeRoute = outpath + '\\' + 'make2route.shp' arcpy.CreateRoutes_lr('polyline.shp', "routeID", makeRoute, "LENGTH") testOut = outpath + '\\' + 'testOut.shp' arcpy.MakeRouteEventLayer_lr(makeRoute, "routeID", 'pts.dbf', "routeID", testOut)
And it gives the following error:
File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\lr.py", line 528, in MakeRouteEventLayer raise e arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Event Table Properties: Value is required Failed to execute (MakeRouteEventLayer).
Below are screenshots of the attribute tables for:
- input 'polyline.shp'
- output 'make2route.shp'
- input 'pts.shp'
Just to reiterate my objective:
- I have "polyline.shp"
- I have "pts.shp" that are not located on the line. However, there is an attribute field that gives the distance along the line ("Dist_km"). I don't care to recalculate/collapse to the line; I must use the "Dist_km" field for this analysis.
- I need coordinates for these distances ("Dist_km") along this line ("polyline.shp")