0

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:

enter image description here

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.

enter image description here

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:

enter image description here

On that there are only two things I can do:

  1. Select one or more centerlines (which I cannot do because my centerline feature class is empty)
  2. 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?

1 Answer 1

1

In conjunction with reading the Create a route documentation, I realized that I should try digitizing a line (or lines) into the Centerline feature class of the TestLRS feature dataset before trying to use the Create button on the Location Referencing tab.

After digitizing one Centerline feature I tried the Create button on the Location Referencing tab again:

  1. This time I could select a Centerline

enter image description here

  1. Then I clicked the Allow choosing of one or more centerlines button (see red arrow above) and filled in the Start Date (today's date) and Route Name (I called it Route 1 as a test) before clicking Run:

enter image description here

  1. Create Route completed successfully so I opened the Attribute Table of my TestLRSNetwork layer to see its field values:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.