Using ArcGIS Desktop 10.1, I have 2 Feature Datasets in a geodatabase. One dataset contains bus routes and the other contains bus stops for each route. I want to create a script that will snap the bus stops to the vertex of the relevant bus route. There are over 100 routes and stops. They are stored in each dataset in order. They are named like this S102, S104 etc. for stops and B102, B104 for routes. I'm unsure about how to do a for loop that will get a stop and then get the right bus route
I've started writing a script. What I'm trying to do is get the last 3 characters of the stops ID (for S102 that would be 102) and then search for B + those characters in the routes dataset. I haven't gotten to the searching bit yet but I'm getting a Parsing error SyntaxError: invalid syntax (line 20) which is arcpy.env.workspace = RoutesD
import arcpy
StopsD = "C:\College Stuff\Dissertation\POWSCAR2011\Practice.gdb\Stops_temp"
RoutesD = "C:\College Stuff\Dissertation\POWSCAR2011\Practice.gdb\Routes_temp"
arcpy.env.workspace = StopsD
arcpy.env.overwriteOutput = True
StopsList = arcpy.ListFeatureClasses()
for Stops in StopsList:
Stopname = Stops[1:4]
Stopname2 = "B" + Stopname
StopnameEx2 = "\"" + Stopname2 + "\""
Routes = str(RoutesD) + "//" + "B"+ Stopname
arcpy.env.workspace = RoutesD
RoutesList = arcpy.ListFeatureClasses(Stopname2)
for routes in RoutesList
print routes
arcpy.env.workspace = StopsD