I am using ArcGIS Pro and the Location Referencing extension (from ArcGIS Roads & Highways) to try to digitize (create) a new route in an LRS dataset.
I run the ArcPy code below to create an empty LRS dataset and network.
import arcpy
arcpy.env.overwriteOutput = True
sr = arcpy.SpatialReference("GCS_WGS_1984")
# Create empty TestLRS dataset and TestLRSNetwork for testing, and copying schema from
# Create empty LRS dataset (TestLRS), with default names for three feature classes (Calibration_Point,Centerline,
# Redline) and an LRS Hierarchy (TestLRS) within it, and three tables (Centerline_Sequence, Lrs_Edit_Log,Lrs_Locks)
gdb = r"C:\temp\test.gdb"
if arcpy.Exists(r"{0}\{1}".format(gdb,"TestLRS")):
arcpy.management.Delete(r"{0}\{1}".format(gdb,"TestLRS"))
if arcpy.Exists(r"{0}\{1}".format(gdb,"Centerline_Sequence")):
arcpy.management.Delete(r"{0}\{1}".format(gdb,"Centerline_Sequence"))
if arcpy.Exists(r"{0}\{1}".format(gdb,"Lrs_Edit_Log")):
arcpy.management.Delete(r"{0}\{1}".format(gdb,"Lrs_Edit_Log"))
if arcpy.Exists(r"{0}\{1}".format(gdb,"Lrs_Locks")):
arcpy.management.Delete(r"{0}\{1}".format(gdb,"Lrs_Locks"))
if arcpy.Exists(r"{0}\{1}".format(gdb,"TestLRS")):
arcpy.management.Delete(r"{0}\{1}".format(gdb,"TestLRS"))
print("Creating LRS dataset named {0}".format("TestLRS"))
arcpy.locref.CreateLRS(gdb,"TestLRS","Centerline","Calibration_Point","Redline","Centerline_Sequence",sr,
"8.98315284119521E-09 DecimalDegrees","0.001 Meters",
"0.000000001 DecimalDegrees","0.0001 Meters")
print("Creating LRS Network ({0}) in LRS dataset ({1}".format("TestLRSNetwork","TestLRS"))
arcpy.locref.CreateLRSNetwork(gdb, "TestLRS", "TestLRSNetwork",
"RouteId", "RouteName", "FromDate", "ToDate", "DO_NOT_DERIVE", '',
"DO_NOT_INCLUDE", "LineId", "LineName", "LineOrder", "KILOMETERS")
The resultant file geodatabase has this structure:
In an ArcGIS Pro project (created from the Map template), I drag and drop the TestLRS feature dataset into the Map.
That causes the Location Referencing tab to appear on the ribbon.
From here I would expect the creation of my first route would be as simple as clicking the Create button on the far left of the Location Referencing tab and starting to digitize. However, when I click the Create button the Location Referencing pane:
On that there are only two things I can do:
- Select one or more centerlines (which I cannot do because my centerline feature class is empty)
- Run the tool (which I cannot do because I have no centerline(s) selected
How do I digitize a route into an empty LRS dataset?