Skip to content

Instantly share code, notes, and snippets.

@millzpaugh
Created March 31, 2021 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save millzpaugh/4c1b68be3d2a3132abc3842cb3399303 to your computer and use it in GitHub Desktop.
Save millzpaugh/4c1b68be3d2a3132abc3842cb3399303 to your computer and use it in GitHub Desktop.
#!/bin/bash
file="./final/merge.shp"
for i in $(ls *.shp)
do
if [ -f "$file" ]
then
echo "creating final/merge.shp"
ogr2ogr -f 'bathymetry shapefile' -update -append $file $i -nln merge
else
echo "merging……"
ogr2ogr -f "bathymetry shapefile" $file $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment