Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Usage: sh gml2shp.sh
- # If updating an existing project, use "sh gml2shp.sh update"
- UPDATE="$1"
- if [ $UPDATE == "update" ]; then
- echo "Updating..."
- COUNTER="1"
- else
- mkdir combined
- COUNTER="0"
- fi
- for f in *.xml
- do
- ogr2ogr -f "ESRI Shapefile" "$f.shp" "$f"
- mv $f.shp $f.shape
- cd $f.shape
- for g in *.shp
- do
- if [ $COUNTER == 0 ]; then
- ogr2ogr "../combined/$g" "$g"
- else
- ogr2ogr -update -append "../combined/$g" "$g"
- fi
- done
- COUNTER="1"
- cd ..
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement