source: tmcsimulator/trunk/webapps/visualizer/data_layers/csvToJson.awk @ 516

Revision 516, 546 bytes checked in by jdalbey, 6 years ago (diff)

Add new web app: Traffic Events Visualizer

Line 
1# Convert a csv with postmile and coordinates to a json file
2# Note it switches lat/long to long/lat
3# Sample invocation:  awk -F',' -f awkpgm1 filename
4//{printf "  {\n  \"type\": \"Feature\",\n  \"id\": \"%s\",\n    \"geometry\":\n      {\n      \"type\": \"Point\",\n      \"coordinates\": [%s,%s]\n      },\n      \"properties\": {\"street\":\"%s\", \"color\":\"%s\", \"perpx\":\"%s\", \"perpy\":\"%s\"}\n  },\n", $1, $3,$2,$4,$7,$5,$6 }
5#
6# When finished prepend:
7#{
8#  "type": "FeatureCollection",
9#  "features": [
10#
11# and Append:
12#  ] }
13
Note: See TracBrowser for help on using the repository browser.