Created
May 31, 2018 00:45
-
-
Save whyvez/db7556e3826b62cefa3484f7dac97ec3 to your computer and use it in GitHub Desktop.
maps each layer in input file into separate GeoJSON file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# desc: maps each layer in input file into separate GeoJSON file | |
# usage: ./split human_footprint.gdb | |
# dep: gdal, awk, parallel | |
input="$1" | |
ogrinfo "$input" \ | |
| awk '{if (NR > 2) print $2}' \ | |
| parallel "ogr2ogr -f 'GeoJSON' -t_srs EPSG:4326 -sql 'select VALUE from {}' {}.geojson $input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment