| Revision 516,
754 bytes
checked in by jdalbey, 6 years ago
(diff) |
|
Add new web app: Traffic Events Visualizer
|
| Line | |
|---|
| 1 | # Convert a csv with cctv location data to a geojson file |
|---|
| 2 | # This was used for a one-off task to convert the static csv file we manually produced into json |
|---|
| 3 | # Sample invocation: awk -F',' -f awkpgm1 filename |
|---|
| 4 | |
|---|
| 5 | # Manually remove the first line with column headers before running this. |
|---|
| 6 | |
|---|
| 7 | # Remove quotes around those streets names that have them |
|---|
| 8 | //{gsub("\"","",$5);printf " {\n \"type\": \"Feature\",\n \"id\": \"%s\",\n \"geometry\":\n {\n \"type\": \"Point\",\n \"coordinates\": [%s,%s]\n },\n \"properties\":\n {\n \"location\":\"%c %s %5.2f\",\n \"street\":\"%s\"\n }\n },\n", $1,$7,$8,$10,$12,$15, $5} |
|---|
| 9 | |
|---|
| 10 | # |
|---|
| 11 | # When finished prepend: |
|---|
| 12 | #{ |
|---|
| 13 | # "type": "FeatureCollection", |
|---|
| 14 | # "features": [ |
|---|
| 15 | # |
|---|
| 16 | # and Append: |
|---|
| 17 | # ] } |
|---|
| 18 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.