# Convert a csv with postmile and coordinates to a json file # Note it switches lat/long to long/lat # Sample invocation: awk -F',' -f awkpgm1 filename //{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 } # # When finished prepend: #{ # "type": "FeatureCollection", # "features": [ # # and Append: # ] }