Skip to content

Commit c23f0aa

Browse files
authored
Merge pull request #27 from nrferguson/master
batchin creation updates
2 parents fb62c68 + 361ca6b commit c23f0aa

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

Master Rail Network Management.tbx

0 Bytes
Binary file not shown.

create_Emme_rail_files_GTFS.sas

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
types if desired.
1414
05-09-2012: Logic revised to process updated future route coding procedures.
1515
06-19-2013: Added logic to choose people mover links.
16-
08-07-2014: Added check for stops at junctions before itinerary batchin creation
16+
08-07-2014: Added check for stops at junctions before itinerary batchin creation
1717
01-08-2016: Corrected itinerary batchin formatting
1818
02-01-2016: Metra headways coded as '99' are replaced by the TOD period duration.
1919
12-20-2016: Updated 'basescen' variable to '200' after base year moved to 2015.
2020
NRF 8/23/2017: Added support for updated future coding of additional service (action = 1)
2121
to include appropriate additional service in all TOD periods.
22+
12/9/2019 NRF: hardcoded OHare Express layover in TOD itinerary file.
23+
12/10/2019 NRF: updated itinerary file formatting for case where there is only one itinerary segment.
2224
2325
------------- -------------
2426
__________________________________________________________________________________________________________________________ */
@@ -29,7 +31,7 @@ ________________________________________________________________________________
2931
%let ct_ramp=%scan(&sysparm,4,$);
3032
%let scen=%eval(&sc/100);
3133
%let reportpath=&outpath.\&scen.00\rail_changes.txt;
32-
%let maxzone=1961; *** highest zn09 POE zone number;
34+
%let maxzone=3649; *** highest zone17 POE zone number;
3335
%let dropnode=48007; *** Exclude South Bend station until zone system expands to include it;
3436
%let basescen=100; *** base year scenario;
3537
%let counter=1;
@@ -50,7 +52,7 @@ data __null__;
5052
*** READ IN NODE INFORMATION ***;
5153
proc import datafile="&inpath.\Temp\temp_rlnode_zone.dbf" out=nodes replace;
5254
data nodes(keep=node label pspace pcost ftr_pspace ftr_pcost point_x point_y zone); set nodes;
53-
rename zone09=zone;
55+
rename zone17=zone;
5456

5557
*** READ IN LINK INFORMATION ***;
5658
proc import datafile="&inpath.\Temp\temp_arc.dbf" out=network replace;
@@ -233,14 +235,15 @@ run;
233235
set itins(where=(itin_a not in (&dropnode) & itin_b not in (&dropnode)));
234236
by tr_line it_order;
235237
retain o 1;
236-
it_order=o;
237-
o=o+1;
238-
if first.tr_line then do;
238+
it_order=o;
239+
o=o+1;
240+
if first.tr_line then do;
239241
o=1;
240-
it_order=o;
241-
o=o+1;
242-
end;
242+
it_order=o;
243+
o=o+1;
244+
end;
243245
if last.tr_line then layover='3';
246+
if (last.tr_line & substr(tr_line, 1, 3) = 'oes') then layover='0'; *** hardcoded layover for OHare Express - needs better solution ***;
244247

245248

246249
data combine; set routes itins; proc sort; by tr_line it_order;
@@ -265,15 +268,17 @@ run;
265268
else if dw_code=5 then d=compress('dwt=*'||dw_time);
266269
else d=compress('dwt='||dw_time);
267270
lag_d=lag(d);
271+
268272

269273
file out1;
270274
if _n_=1 then put "c RAIL TRANSIT BATCHIN FILE FOR SCENARIO &scen.00 TOD &tod" / "c &sysdate" / "c us1 holds segment travel time, us2 holds zone fare" / "t lines init";
271275
if first.tr_line then put 'a' +1 name +2 mode +2 veh_type +2 headway +2 speed +2 desc / +2 'path=no';
272-
else if last.tr_line then put +4 lag_d +(10-length(left(trim(lag_d)))) itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare / +4 'dwt=0.01' +3 itin_b +2 'lay=' +0 layover;
276+
else if (it_order=1 & last.tr_line) then put +4 'dwt=0.01' +3 itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare / +4 'dwt=0.01' +3 itin_b +2 'lay=' +0 layover;
273277
else if it_order=1 then put +4 'dwt=0.01' +3 itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare;
278+
else if last.tr_line then put +4 lag_d +(10-length(left(trim(lag_d)))) itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare / +4 'dwt=0.01' +3 itin_b +2 'lay=' +0 layover;
274279
else if (layov ne '0' and layov ne '') then put +4 lag_d +(10-length(left(trim(lag_d)))) itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare +2 'lay=' +0 layov;
275280
else put +4 lag_d +(10-length(left(trim(lag_d)))) itin_a +2 'ttf=1' +3 'us1=' +0 trv_time +(6-length(left(trim(trv_time)))) 'us2=' +0 zn_fare;
276-
281+
277282
%if &scen=9 %then %do;
278283
proc export data=combine outfile="&outpath.\&scen.00\rail_itinerary_&tod..dbf" dbms=dbf replace;
279284
%end;

create_emme_scenario_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
people_mover = d + "\\mrn.gdb\\" + "people_mover"
8585
scen_itin_dbf = d + "\\Temp\\scen_itin.dbf"
8686
ftr_itin_dbf = d + "\\Temp\\ftr_itin.dbf"
87-
zones = d + "\\zones_2009\\polygon"
87+
zones = d + "\\zones17\\zones17.shp"
8888
temp_rlnode_zone_shp = Temp + "\\temp_rlnode_zone.shp"
8989
outFl = Temp + "\\rte_out.txt"
9090
link_list = newdir + '\\rail_links_all.csv'

0 commit comments

Comments
 (0)