diff options
Diffstat (limited to 'scripts/csv2geojson')
| -rwxr-xr-x | scripts/csv2geojson | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/csv2geojson b/scripts/csv2geojson new file mode 100755 index 0000000..ec1d35c --- /dev/null +++ b/scripts/csv2geojson | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | sed 's/[^,]*/"\0"/g' $1 |\ | ||
| 4 | sed 's/.*/[\0]/g' |\ | ||
| 5 | sed '1d' |\ | ||
| 6 | jq '. | {"type": "Feature", "properties": {}, "geometry":{ "type": "Point", "coordinates": [(.[-1] | tonumber), (.[-2] | tonumber)] } }'|\ | ||
| 7 | jq -s '{"type": "FeatureCollection", "features": .}' | ||