Created
February 15, 2019 11:20
-
-
Save pakastin/9d824a6745e6df5d247612f54159658c to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
consolidated_file="./consolidated.json" | |
for i in $(find . -name '*.shp'); do | |
if [ ! -f "$consolidated_file" ]; then | |
# first file - create the consolidated output file | |
ogr2ogr -f GeoJSON $consolidated_file -t_srs EPSG:4326 $i | |
else | |
# update the output file with new file content | |
ogr2ogr -f GeoJSON -update -append $consolidated_file -t_srs EPSG:4326 $i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment