Skip to content

Commit 7e5b551

Browse files
committed
c17q3 changes
fixes that include route geo rebuild issue. update scenario numbering.
1 parent 66401af commit 7e5b551

7 files changed

Lines changed: 43 additions & 22 deletions

apply_future_rail_actions.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ filename inrte "&inpath.\Temp\rte_out.txt";
7878
data a2rpt(keep=descr ln reduc); set a2rpt(where=(layover='99'));
7979
ln=substr(tr_line,1,3);
8080
reduc=trv_time*100;
81-
proc sort data=a2rpt nodupkey; by ln;
81+
proc sort data=a2rpt nodupkey; by descr;
8282
data __null__; set a2rpt;
8383
file "&reportpath" mod;
8484
put "--> " descr ": reduced " ln "travel time along entire line by " reduc "percent";

create_Emme_rail_files_GTFS.sas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ________________________________________________________________________________
2929
%let reportpath=&outpath.\&scen.00\rail_changes.txt;
3030
%let maxzone=1961; *** highest zn09 POE zone number;
3131
%let dropnode=48007; *** Exclude South Bend station until zone system expands to include it;
32-
%let basescen=200; *** base year scenario;
32+
%let basescen=100; *** base year scenario;
3333
%let counter=1;
3434
%let tod=0;
3535
%let a1=0;%let a2=0;%let a3=0;%let a4=0;%let a5=0;%let a7=0; *** initialize action code counts;
@@ -72,7 +72,7 @@ data __null__;
7272
put "--> removed scenario = " scenario "people mover link anode = " anode "bnode = " bnode "from network";
7373

7474
*---------------------------------------------------------------*;
75-
*** READ IN FUTURE CODING DATA FOR SCENARIOS 200 - 600 ***;
75+
*** READ IN FUTURE CODING DATA FOR SCENARIOS 200 - 700 ***;
7676
*---------------------------------------------------------------*;
7777
%macro future;
7878
%if &sc>&basescen %then %do;
@@ -223,7 +223,7 @@ run;
223223

224224
* - - - - - - - - - - - - - - - - - - - - - - - - - - *;
225225
**VERIFY THAT ITINERARIES DO NOT STOP AT JUNCTIONS**;
226-
data check; set combine(where=(((itin_b>38999 & itin_b<40000) | (itin_b>48999 & itin_b<50000)) & dw_code=0));
226+
data check; set combine(where=(((itin_b>39000 & itin_b<40000) | (itin_b>49000 & itin_b<50000)) & dw_code=0));
227227
proc print; title "NETWORK &scen.00 ITINERARY SEGMENTS THAT STOP AT A JUNCTION";
228228
* - - - - - - - - - - - - - - - - - - - - - - - - - - *;
229229

create_scenario_files_GTFS.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333

3434
##======================================================================##
3535

36-
## scenario options: beginning with c10q3
36+
## scenario options: beginning with c17q3
3737
## --------------------------------------
38-
## 100 - 2010 network
39-
## 200 - 2015 network
40-
## 300 - 2020 network
41-
## 400 - 2025 network
42-
## 500 - 2030 network
38+
## 100 - 2015 network
39+
## 200 - 2020 network
40+
## 300 - 2025 network
41+
## 400 - 2030 network
42+
## 500 - 2035 network
4343
## 600 - 2040 network
44+
## 700 - 2050 network
4445

4546
##======================================================================##
4647

@@ -66,7 +67,7 @@
6667
f = string.replace(c, "\\", '/') + "/mrn_programs"
6768
newdir = path + "\\" + scenario
6869
current = "all_runs" # current routes
69-
if scenario in ("200","900"):
70+
if scenario in ("100","900"):
7071
current = "all_runs_base" # base year routes
7172
future = "future" # future coding
7273
rail_routes = current

itinerary_node_update_Aug2012.sas

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
*NRF revised 5-30-2017 to use action codes to inform future it_order after split link.;
2-
1+
/*
2+
NRF 5/30/2017 - corrected future it_order overwrite issue using action codes to inform future it_order after split link.
3+
NRF 6/2/2017 - corrected error in rebuilding future route geo. was not using node ID of 0 to find coordinates for new node.
4+
NRF 6/23/2017 - corrected error in rebuiding future route geo. new node coordinates were being used to apply node ids to
5+
route geo based on original node coordinates when node is moved.
6+
*/
37
*================================================================*;
48
*** UPDATE ITINERARY TO REFLECT SPLIT LINKS W/ TEMPORARY ANODE-BNODE VALUES (ONLY IF NEW_MILE.DBF EXISTS) ***;
59
*================================================================*;
@@ -366,16 +370,18 @@ filename delndf "&dir.\Temp\deleted_node.dbf";
366370
input line_num tr_line $ x y m;
367371

368372
proc import datafile="&dir.\Temp\new_node.dbf" out=rail_nodes replace;
369-
data rail_nodes(keep=node point_x point_y); set rail_nodes;
370-
data rail_nodes(drop=point_x point_y); set rail_nodes;
373+
data rail_nodes(keep=node point_x point_y point_x0 point_y0); set rail_nodes;
374+
data rail_nodes(drop=point_x point_y point_x0 point_y0); set rail_nodes;
371375
x=point_x;
372-
y=point_y;
376+
y=point_y;
377+
x0=point_x0;
378+
y0=point_y0;run;
373379

374380
proc sql noprint;
375381
create table rte_nodes as
376-
select rte_geo.line_num,rte_geo.tr_line,rte_geo.x,rte_geo.y,rte_geo.m,rail_nodes.node
382+
select rte_geo.line_num,rte_geo.tr_line,rail_nodes.x,rail_nodes.y,rte_geo.m,rail_nodes.node
377383
from rte_geo,rail_nodes
378-
where rte_geo.x=rail_nodes.x & rte_geo.y=rail_nodes.y;
384+
where rte_geo.x=rail_nodes.x0 & rte_geo.y=rail_nodes.y0;
379385
proc sort data=rte_nodes;
380386
by line_num m;
381387

@@ -390,6 +396,8 @@ filename delndf "&dir.\Temp\deleted_node.dbf";
390396
set tmpnode;
391397
itin_a=anode;
392398
itin_b=bnode;
399+
if tempa>90000 then itin_a=0;
400+
if tempb>90000 then itin_b=0;
393401

394402
proc sort data=rte_itin;
395403
by itin_a itin_b;

update_network_edits_Aug2012.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
# 08-07-2012: Revised to iterate through & update all route systems. #
2828
# 05-30-2017: revised to pass future route action codes to SAS for #
2929
# processing split links. #
30+
# 06-23-2017: revised to remove point_x0 and point_y0 fields from final #
31+
# node feature class. #
3032
# #
3133
#############################################################################
3234

@@ -185,6 +187,7 @@
185187
arcpy.AddMessage("---> Updating Node Feature Class")
186188
arcpy.MakeXYEventLayer_management(new_node_dbf, "point_x", "point_y", temp_node_Layer, "PROJCS['NAD_1927_StatePlane_Illinois_East_FIPS_1201',GEOGCS['GCS_North_American_1927',DATUM['D_North_American_1927',SPHEROID['Clarke_1866',6378206.4,294.9786982]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-88.33333333333333],PARAMETER['Scale_Factor',0.999975],PARAMETER['Latitude_Of_Origin',36.66666666666666],UNIT['Foot_US',0.3048006096012192]];IsHighPrecision")
187189
arcpy.FeatureClassToFeatureClass_conversion(temp_node_Layer, mrn_gdb, "temp")
190+
arcpy.DeleteField_management(temp, ["point_x0", "point_y0"])
188191
arcpy.SelectLayerByAttribute_management(railnet_node, "CLEAR_SELECTION", "")
189192
arcpy.DeleteRows_management(railnet_node)
190193
arcpy.Append_management(temp, railnet_node, "TEST", "", "")
@@ -239,6 +242,7 @@
239242
env.workspace = "C:/Master_Rail/mrn.gdb/railnet" ## point inside feature dataset
240243
fcs = arcpy.ListFeatureClasses('',"arc")
241244
fcs.remove("railnet_arc")
245+
242246
i = 0
243247
for fc in fcs:
244248
arcpy.AddMessage("---> Updating Geometry for " + fcs[i] + " Route System ...")
@@ -275,7 +279,7 @@
275279
f -= 1
276280
arcpy.AddMessage("---> Geometry Written for " + str(f) + " Future Routes")
277281
outFile.close()
278-
282+
279283
## Run SAS to Update Itineraries ##
280284
# -- finish set up to run SAS
281285
y2 = c + "$" + orig_itinerary_dbf + "$X$3$X$X$" + orig_future_routes_dbf

update_nodes.sas

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
3. new nodes due to added link - new XY coordinates will be calculated automatically, will need node number
1414
4. new nodes due to split links - extra processing required to determine which node(s) are new because arc
1515
table will show duplicate entries of original link with anode & bnode values.
16-
*/
16+
17+
6/23/17 NRF: revised to retain original coordinates (point_x0, point_y0) in new_node.dbf for use when rebuilding route geo.
18+
*/
1719

1820

1921
%let tot=0;
@@ -115,13 +117,13 @@ proc sort data=keepnodes; by node;
115117

116118
*** READ IN CURRENT NODE DATA AND ATTACH ATTRIBUTE DATA TO NEW NODE DATASET ***;
117119
proc import datafile="&dir.\Temp\temp_node.dbf" out=c replace;
118-
data c(drop=point_x point_y); set c; proc sort; by node;
120+
data c(rename=(point_x=point_x0 point_y=point_y0)); set c; proc sort; by node;
119121
data keepnodes(drop=_type_ _freq_); merge keepnodes (in=hit) c; by node; if hit;
120122
if pspace=. then pspace=0; if pcost=. then pcost=0;
121123

122124

123125
*** RE-ORDER VARIABLES TO MATCH FEATURE CLASS ORDER ***;
124-
data final; retain node label pspace pcost ftr_pspace ftr_pcost point_x point_y; set keepnodes;
126+
data final; retain node label pspace pcost ftr_pspace ftr_pcost point_x point_y point_x0 point_y0; set keepnodes;
125127

126128
proc export data=final outfile="&dir.\Temp\new_node.dbf" dbms=dbf replace;
127129

update_split_itinerary_Aug2012.sas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Craig Heither, revised 08/07/2012
33
44
Program updates the values of itin_a and itin_b in the itinerary coding for rail routes whose links have been split.
5+
6+
NRF 6/2/2017 - added logic to set dwell code and dwell time in itin as no stop if node ID represents junction.
57
68
*/
79

@@ -38,6 +40,10 @@ data a(drop=c newc); set a;
3840
data itin(drop=newa newb); merge x (in=hit) a; by itin_a itin_b; if hit;
3941
if newa>0 then itin_a=newa;
4042
if newb>0 then itin_b=newb;
43+
if not(index(tr_line,'*')) and (39000<itin_b<40000 or 49000<itin_b<50000) then do;
44+
dw_code=1;
45+
dw_time=0;
46+
end;
4147
proc sort; by tr_line it_order;
4248

4349
*** RE-ORDER VARIABLES ***;

0 commit comments

Comments
 (0)