Changes between Version 2 and Version 3 of CPTMS


Ignore:
Timestamp:
02/22/2019 06:04:10 AM (7 years ago)
Author:
jdalbey
Comment:

add formatting

Legend:

Unmodified
Added
Removed
Modified
  • CPTMS

    v2 v3  
    66STMS is our substitute for the ATMS. 
    77 
    8 (List components of STMS here) 
     8The components of the STMS are the postmile file, the Traffic Model Manager (within the CADServer), the highways.json file, and the STMS html file that contains the javascript code for manipulating a Google Map. 
    99 
    1010The key data used by the STMS is the postmile file. It is found in the config folder. Of significance is that it lists postmile locations of VDS in the network and gives the latlong for each so its location can be plotted on a Google Map. 
    1111 
    12 Directions for creating a postmile file. 
    13  
    14 Browse to pems.dot.ca.gov.  In the left margin under "Tools" select "Data Clearinghouse". 
     12== Directions for creating a postmile file. == 
     13Browse to [http://pems.dot.ca.gov pems.dot.ca.gov].  In the left margin under "Tools" select "Data Clearinghouse". 
    1514 
    1615In the selection boxes at the top specify "Type: Station Metadata" and desired district number, then click Submit. 
    1716 
    18 The report page which appears shows two columns, Field Specification and Available Files.  The former describes what is in each field of the data file. In the Available Files column select the most recently dated file. Download and save to your local computer, changing the extension from ".txt" to ".csv". 
     17The report page which appears shows two columns, Field Specification and Available Files.  The former describes what is in each field of the data file. In the Available Files column select the most recently dated file. Download and save to your local computer as `d05_pm_vds_all.csv` (changing the extension from ".txt" to ".csv").  (For this exercise we'll pretend to be working with District 5 and name the files accordingly). 
    1918 
    20 Open the file in Libre Office Calc (or other spreadsheet).  Delete unneeded columns, retaining: Fwy, Dir, State_PM,Latitude, Longitude, and Name.  Save as .csv.  Open in a text editor and remove the first line containing column headers. 
     19Open the file in Libre Office Calc (or other spreadsheet).  Delete unneeded columns, retaining: Fwy, Dir, State_PM, Latitude, Longitude, and Name.  Save as .csv.  Open in a text editor and remove the first row containing column headers.  Also remove quotation marks. 
    2120 
    22 Some postmiles files have duplicate entries, same postmile but slightly different street names.  It is desirable to remove duplicate entries. 
     21Some postmiles files have duplicate entries, that is, they have the same postmile but slightly different street names.  It is desirable to remove these duplicate entries. Run the python script that lets you manually select which one to keep. 
    2322 
    24 Run the python script that lets you manually select which one to keep. 
     23{{{ 
     24python showDupPostmiles.py `d05_pm_vds_all.csv` 
     25}}} 
     26The results are saved in "`uniqFile`" which you should rename, to something like: `d05_postmile_uniq.csv` 
    2527 
    26 python showDupPostmiles.py filename 
     28The next step is to preprocess the csv file which creates perpendicular unit vectors for each postmile: 
    2729 
    28 The results are saved in "uniqFile" which you should rename, to something like:  d12_postmile_uniq.csv 
     30Open "`prep_postmiles.py`" in a text editor and modify the name of the postmileFile string to be the name of your file. 
    2931 
    30 Then preprocess the csv file: 
     32Run it:  
    3133 
    32 Open "prep_postmiles.py" in a text editor and modify the name of the postmileFile string to be the name of your file. 
    33  
    34 Run it:   python prep_postmiles.py 
     34{{{ 
     35python prep_postmiles.py 
     36}}} 
    3537 
    3638Observe output, correct any bad data in the file that causes the program to crash. 
    3739 
    38 When done, run it and redirect output to a new file:  python prep_postmiles.py > d12_postmile_prepped.csv 
     40When done, run it and redirect output to a new file:   
    3941 
    40 Run the csv to json converter: ./convertCSVtoJSON.bash d12_postmile_prepped.csv > d12_postmile.json 
     42{{{ 
     43python prep_postmiles.py > d12_postmile_prepped.csv 
     44}}} 
    4145 
    42 Edit the file to remove the comma after the last feature. 
     46Run the csv to json converter:  
     47{{{ 
     48./convertCSVtoJSON.bash d12_postmile_prepped.csv > highways.json 
     49}}} 
    4350 
    44 Copy the STMS html file, modify the input filename and the center location. 
     51Edit the json file to remove an extraneous comma after the last feature. The last three lines should appear as:  
    4552 
    46 Load the STMS html file into a browser, and observe the results. 
     53{{{ 
     54  } 
     55 ] 
     56} 
     57}}} 
    4758 
    48 Use unix "cut" to remove the last column and copy to tmc config folder. 
     59 
     60Make a copy the STMS html file, and open it in a text editor. Specify the correct center location for the target district. 
     61 
     62{{{ 
     63    var centerPoint = {lat: 33.687228, lng: -117.872148}; 
     64}}} 
     65 
     66Load the STMS html file into a browser and observe the results. 
     67 
     68Use unix "cut" to remove the last column of the csv file and copy it to TMC config folder. 
     69{{{ 
     70cut -f1-6 -d"," d12_postmile_prepped.csv > postmile_coords.txt 
     71}}}