Changes between Version 2 and Version 3 of CPTMS
- Timestamp:
- 02/22/2019 06:04:10 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CPTMS
v2 v3 6 6 STMS is our substitute for the ATMS. 7 7 8 (List components of STMS here) 8 The 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. 9 9 10 10 The 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. 11 11 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. == 13 Browse to [http://pems.dot.ca.gov pems.dot.ca.gov]. In the left margin under "Tools" select "Data Clearinghouse". 15 14 16 15 In the selection boxes at the top specify "Type: Station Metadata" and desired district number, then click Submit. 17 16 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".17 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 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). 19 18 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.19 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 row containing column headers. Also remove quotation marks. 21 20 22 Some postmiles files have duplicate entries, same postmile but slightly different street names. It is desirable to remove duplicate entries.21 Some 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. 23 22 24 Run the python script that lets you manually select which one to keep. 23 {{{ 24 python showDupPostmiles.py `d05_pm_vds_all.csv` 25 }}} 26 The results are saved in "`uniqFile`" which you should rename, to something like: `d05_postmile_uniq.csv` 25 27 26 python showDupPostmiles.py filename 28 The next step is to preprocess the csv file which creates perpendicular unit vectors for each postmile: 27 29 28 The results are saved in "uniqFile" which you should rename, to something like: d12_postmile_uniq.csv 30 Open "`prep_postmiles.py`" in a text editor and modify the name of the postmileFile string to be the name of your file. 29 31 30 Then preprocess the csv file: 32 Run it: 31 33 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 {{{ 35 python prep_postmiles.py 36 }}} 35 37 36 38 Observe output, correct any bad data in the file that causes the program to crash. 37 39 38 When done, run it and redirect output to a new file: python prep_postmiles.py > d12_postmile_prepped.csv40 When done, run it and redirect output to a new file: 39 41 40 Run the csv to json converter: ./convertCSVtoJSON.bash d12_postmile_prepped.csv > d12_postmile.json 42 {{{ 43 python prep_postmiles.py > d12_postmile_prepped.csv 44 }}} 41 45 42 Edit the file to remove the comma after the last feature. 46 Run the csv to json converter: 47 {{{ 48 ./convertCSVtoJSON.bash d12_postmile_prepped.csv > highways.json 49 }}} 43 50 44 Copy the STMS html file, modify the input filename and the center location. 51 Edit the json file to remove an extraneous comma after the last feature. The last three lines should appear as: 45 52 46 Load the STMS html file into a browser, and observe the results. 53 {{{ 54 } 55 ] 56 } 57 }}} 47 58 48 Use unix "cut" to remove the last column and copy to tmc config folder. 59 60 Make 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 66 Load the STMS html file into a browser and observe the results. 67 68 Use unix "cut" to remove the last column of the csv file and copy it to TMC config folder. 69 {{{ 70 cut -f1-6 -d"," d12_postmile_prepped.csv > postmile_coords.txt 71 }}}
