Changeset 305 in tmcsimulator for trunk/src/cptms/prep_cctv.py


Ignore:
Timestamp:
03/12/2019 09:49:19 AM (7 years ago)
Author:
jdalbey
Message:

cptms_map.html v 0.6 adds dynamic cctv images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cptms/prep_cctv.py

    r304 r305  
    11import collections,math,sys 
    22# 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.  
    38# jdalbey Mar 2019 
    4 postmileFile = "d12_vds_uniq_sorted.csv" 
     9vdsFile = "vds_fromhighwaysmap.csv" 
    510cctvFile = "cctv_locations_D12.csv" 
    611orientationLookup = {'N':0,'S':1,'E':0,'W':1} 
     
    813def loadHighways(): 
    914 
    10     f = open(postmileFile,'r') 
     15    f = open(vdsFile,'r') 
    1116    lines = [line.split(',') for line in f.readlines()] 
    12      
     17    # 5,N,0.65,4 S. LUIS REY 
    1318    # Create a set containing just the route numbers  
    1419    routeNums = set() 
     
    4348 
    4449    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 
    4551    lines = [line.split(',') for line in f.readlines()] 
    4652 
     
    6874highways = collections.OrderedDict()     
    6975loadHighways() 
     76dumpHighways() 
    7077print "CCTV\tnearestVDS" 
    7178findNearest() 
Note: See TracChangeset for help on using the changeset viewer.