Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/bin/sh
  2. # Usage: sh gml2shp.sh
  3. # If updating an existing project, use "sh gml2shp.sh update"
  4.  
  5. UPDATE="$1"
  6.  
  7. if [ $UPDATE == "update" ]; then
  8. echo "Updating..."
  9. COUNTER="1"
  10. else
  11. mkdir combined
  12. COUNTER="0"
  13. fi
  14.  
  15. for f in *.xml
  16. do
  17. ogr2ogr -f "ESRI Shapefile" "$f.shp" "$f"
  18. mv $f.shp $f.shape
  19.  
  20. cd $f.shape
  21.  
  22. for g in *.shp
  23. do
  24. if [ $COUNTER == 0 ]; then
  25. ogr2ogr "../combined/$g" "$g"
  26. else
  27. ogr2ogr -update -append "../combined/$g" "$g"
  28. fi
  29. done
  30. COUNTER="1"
  31. cd ..
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement