summaryrefslogtreecommitdiffhomepage
path: root/scripts/csv2geojson
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-10-24 17:42:07 +0800
committertypebrook <typebrook@gmail.com>2019-10-24 17:42:07 +0800
commit4293d05f61212386a9a0af1bc04299ac2651e378 (patch)
tree535e82f24eb70d45d3b1981c9b20eb2ec4d9be80 /scripts/csv2geojson
parent005c6ed6344aaf19d4223989e909073b9af40c4a (diff)
update
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": .}'