Skip to content

Commit cfe4f77

Browse files
authored
Merge pull request #143 from CMAP-REPOS/c23q2
c23q2
2 parents 3d68c35 + b44607b commit cfe4f77

37 files changed

Lines changed: 70 additions & 69 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# Ignore temporary files generated by tools.
2+
temp/
3+
14
# Compiled source #
25
###################
6+
src/__pycache__/
37
*.com
48
*.class
59
*.dll

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
CMAP-REPOS/mhn_programs
2-
=======================
1+
# CMAP-REPOS/mhn_programs
2+
33
The MHN Programs repository is a collection of (mostly) Python scripts used to administer the [Chicago Metropolitan Agency for Planning (CMAP)](http://www.cmap.illinois.gov)'s Master Highway Network [geodatabase](http://www.esri.com/software/arcgis/geodatabase). This geodatabase is used, in conjunction with the Master Rail Network, to generate travel demand modeling networks, which we use for all of our modeling needs, including [transportation conformity](http://www.cmap.illinois.gov/conformity-analysis).
44

5-
The MHN itself contains information about all of the major roads within the 21-county CMAP modeling area, as well as all major road construction projects scheduled between now and 2040, all current CTA and Pace bus routes, and planned future bus routes (like [CTA's Ashland BRT](http://www.transitchicago.com/ashlandbrt)).
5+
The MHN itself contains information about all of the major roads within the 21-county CMAP modeling area, as well as all major road construction projects scheduled between now and 2050, all current CTA and Pace bus routes, and planned future bus routes.
66

77
The scripts in this repository are used to import new GTFS bus data and road construction project details, maintain the integrity of the network after geometric edits have been made, and export data in a format suitable for input into [Emme](http://www.inrosoftware.com/en/products/emme) modeling networks. This repository includes an ArcGIS Toolbox (mhn_tools.tbx), which has been configured such that each of the main scripts can (and should!) be run within the ArcMap/ArcCatalog/ArcGIS Pro GUI out of the box!
8+
9+
## Getting Started
10+
See the [wiki](https://github.com/CMAP-REPOS/mhn_programs/wiki/Getting-Set-Up).
2.9 MB
Binary file not shown.
21.2 KB
Binary file not shown.

mhn_tools.tbx

12.5 KB
Binary file not shown.

MHN.py renamed to src/MHN.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,15 @@ def __init__(self, mhn_gdb_path, zone_gdb_path=None):
289289

290290
# Directories
291291
self.root_dir = os.path.dirname(self.gdb)
292-
self.imp_dir = self.ensure_dir(os.path.join(self.root_dir, 'import'))
293-
self.out_dir = self.ensure_dir(os.path.join(self.root_dir, 'output'))
294-
self.temp_dir = self.ensure_dir(os.path.join(self.root_dir, 'temp'))
295292
self.script_dir = sys.path[0] # Directory containing this module
296293
if os.path.basename(self.script_dir) == 'utilities':
297-
self.prog_dir = os.path.dirname(self.script_dir)
294+
self.src_dir = os.path.dirname(self.script_dir)
298295
self.util_dir = self.script_dir
299296
else:
300-
self.prog_dir = self.script_dir
301-
self.util_dir = os.path.join(self.prog_dir, 'utilities')
297+
self.src_dir = self.script_dir
298+
self.util_dir = os.path.join(self.src_dir, 'utilities')
299+
self.temp_dir = self.ensure_dir(os.path.realpath(os.path.join(self.src_dir, '../temp')))
300+
self.in_dir = os.path.realpath(os.path.join(self.src_dir, '../input'))
302301
self.mem = 'in_memory'
303302

304303
# MHN geodatabase structure, projection
@@ -688,7 +687,7 @@ def submit_sas(self, sas_file, sas_log, sas_lst, arg_list=None):
688687
arg_str = ''
689688
else:
690689
arg_str = '$'.join(str(arg) for arg in arg_list)
691-
bat = os.path.join(self.prog_dir, 'sasrun.bat')
690+
bat = os.path.join(self.src_dir, 'sasrun.bat')
692691
cmd = [bat, sas_file, arg_str, sas_log, sas_lst]
693692
# arcpy.AddMessage('{}: {}'.format(sas_file, arg_str)) # Helpful for debugging
694693
return subprocess.check_call(cmd, startupinfo=startupinfo)

0 commit comments

Comments
 (0)