diff options
author | typebrook <typebrook@gmail.com> | 2019-10-24 17:42:07 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2019-10-24 17:42:07 +0800 |
commit | 4293d05f61212386a9a0af1bc04299ac2651e378 (patch) | |
tree | 535e82f24eb70d45d3b1981c9b20eb2ec4d9be80 /scripts/csv2geojson | |
parent | 005c6ed6344aaf19d4223989e909073b9af40c4a (diff) |
update
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": .}' | ||