From 4293d05f61212386a9a0af1bc04299ac2651e378 Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 24 Oct 2019 17:42:07 +0800 Subject: update --- scripts/csv2geojson | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/csv2geojson (limited to 'scripts/csv2geojson') diff --git a/scripts/csv2geojson b/scripts/csv2geojson new file mode 100755 index 0000000..ec1d35c --- /dev/null +++ b/scripts/csv2geojson @@ -0,0 +1,7 @@ +#! /bin/bash + +sed 's/[^,]*/"\0"/g' $1 |\ +sed 's/.*/[\0]/g' |\ +sed '1d' |\ +jq '. | {"type": "Feature", "properties": {}, "geometry":{ "type": "Point", "coordinates": [(.[-1] | tonumber), (.[-2] | tonumber)] } }'|\ +jq -s '{"type": "FeatureCollection", "features": .}' -- cgit v1.2.3-70-g09d2