Changeset 305 in tmcsimulator for trunk/src/cptms/prep_cctv.py
- Timestamp:
- 03/12/2019 09:49:19 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/cptms/prep_cctv.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cptms/prep_cctv.py
r304 r305 1 1 import collections,math,sys 2 2 # Scan the cctv file to find the nearest vds 3 # This is a one-time job to create the static file of cctv locations and nearest vds 4 # The output of this program needs to be manually modified before input to cptms_map.html 5 # 1. The vds column is appended to cctvFile (yes, adding a new column to the original input). 6 # 2. Convert this csv file to json (using cctvToJson.awk) 7 # 3. Remove tabs from json. Trim any blanks from nearVDS field. 3 8 # jdalbey Mar 2019 4 postmileFile = "d12_vds_uniq_sorted.csv"9 vdsFile = "vds_fromhighwaysmap.csv" 5 10 cctvFile = "cctv_locations_D12.csv" 6 11 orientationLookup = {'N':0,'S':1,'E':0,'W':1} … … 8 13 def loadHighways(): 9 14 10 f = open( postmileFile,'r')15 f = open(vdsFile,'r') 11 16 lines = [line.split(',') for line in f.readlines()] 12 17 # 5,N,0.65,4 S. LUIS REY 13 18 # Create a set containing just the route numbers 14 19 routeNums = set() … … 43 48 44 49 f = open(cctvFile,'r') 50 #5,S,42.11,-117.978854,33.856288,SB 5 N/O MAGNOLIA AVE (S/O 91),12-005-CCTV-0001 45 51 lines = [line.split(',') for line in f.readlines()] 46 52 … … 68 74 highways = collections.OrderedDict() 69 75 loadHighways() 76 dumpHighways() 70 77 print "CCTV\tnearestVDS" 71 78 findNearest()
Note: See TracChangeset
for help on using the changeset viewer.
