AnsweredAssumed Answered

Polyline Types Based on Endpoints

Question asked by vshah6 on Nov 28, 2018

I'm currently working on a custom tool that will first convert endpoints of a polyline feature class into a new point feature class. The idea is to then use these points to determine what sort of the polyline it is (Backbone or Lateral).


A backbone will be connected to other polylines on both sides (so endpoints from both sides of that polyline will be connected to endpoints from other polylines). A lateral will be connected to one polyline on either side, never both sides (so one of the endpoints will be connected to an endpoint from another polyline).


My current code looks like the following:


import arcpy
import os
import arcpy.mapping as map
from arcpy import env

fiberFeatures = r'CL Mapping Layers\sdm_Fiber Segments'

mxd = arcpy.mapping.MapDocument("CURRENT")
mxdPath = arcpy.mapping.MapDocument("CURRENT").filePath
mxdName = os.path.basename(mxdPath)
mxdCharCount =(len(mxdName)) + 1
workingPath = mxdPath[:-mxdCharCount]

df = arcpy.mapping.ListDataFrames(mxd)[0]

folderLoc = workingPath
folderName = 'Temp'

arcpy.CreateFolder_management(folderLoc, folderName)

outputLoc = os.path.join(workingPath, folderName)
fgdbName = 'temp'

arcpy.CreateFileGDB_management(outputLoc, fgdbName)

arcpy.env.workspace = os.path.join(workingPath, folderName, "temp.gdb")
inFeature = fiberFeatures
outputFeature = 'fiber_end_points'

arcpy.FeatureVerticesToPoints_management(inFeature, outputFeature, "BOTH_ENDS")

# Space to add code to determine if fiber is backbone or endpoint

# Write backbone/lateral to polyline feature class

# At the end to delete temp folder and temp fgdb.

Writing to the polyline feature class is easy, as well as deleting the temp folder at the end. How do I use the endpoints to determine if the fiber segment (polyline) is a backbone or a lateral?