Python code is:

import arcpy

arcpy.FeatureToLine_management("Closestroute", "Featureline", "0.0001 Meters", "ATTRIBUTES")

#Generate points along lines for every 1 km
arcpy.GeneratePointsAlongLines_management("Featureline", "splitPoints", "DISTANCE", "1000 Meters", "", "NO_END_POINTS")

#Split line at point for every 1 km roads,search radius = 20 meters
arcpy.SplitLineAtPoint_management("Featureline", "splitPoints", "split1kpoints", "20 Meters")

#I added SEE field into splitPoints, then I assigned name for each rows.(s1, s2, s3, ...) 

shpFld = arcpy.Describe("splitPoints").shapeFieldName
arcpy.DeleteIdentical_management("splitPoints", shpFld)

i = 0

for row in cursor:    
    row[0] = 's' + str(i)
    i += 1

del row
del cursor

My aim:

I am trying to obtain which start points are used to arrive in destination by using shortest path.

My problem is:

In table below, I have OBJECTID for each points. But, when more than one routes intersect with other route like in the picture below (yellow arrow), although those points are used by two routes, in table, it assigned for just one shortest path. (In table, please check yellow arrow) ex: ORIGIN id 10078 is just assigned to location3-location2. (from location 3 to 2)

enter image description here enter image description here

I just want to get which points are used for each shortest routes and see which points are used by more than once.

How can I do this ?

  • 1
    Again: Please format your code legibly by using the original code and the {} format button – Vince Dec 28 '18 at 21:40
  • 2
    I think that you are presenting far too much data. I recommend creating a test dataset of as few features as possible, while still demonstrating what you are wanting to ask about. – PolyGeo Dec 28 '18 at 22:43
  • I would recommend using M-values on your polyline vertices and then stationing all your points or use the arcmap routing tools. – Gary Lester Aug 25 '19 at 22:31

Your Answer

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

Browse other questions tagged or ask your own question.