aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/csv2geojson
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/csv2geojson')
-rwxr-xr-xscripts/csv2geojson7
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
3sed 's/[^,]*/"\0"/g' $1 |\
4sed 's/.*/[\0]/g' |\
5sed '1d' |\
6jq '. | {"type": "Feature", "properties": {}, "geometry":{ "type": "Point", "coordinates": [(.[-1] | tonumber), (.[-2] | tonumber)] } }'|\
7jq -s '{"type": "FeatureCollection", "features": .}'