Skip to content

Instantly share code, notes, and snippets.

@gorbypark
Created January 16, 2019 19:07
Show Gist options
  • Save gorbypark/121f14931ba0da0ce51338614287f4f5 to your computer and use it in GitHub Desktop.
Save gorbypark/121f14931ba0da0ce51338614287f4f5 to your computer and use it in GitHub Desktop.
#!/bin/bash
for FILE in *.geojson # cycles through all files in directory (case-sensitive!)
do
echo "converting file: $FILE..."
FILENEW=`echo $FILE | sed "s/.mif/_new.shp/"` # replaces old filename
ogr2ogr \
-f "ESRI Shapefile" \
"$FILENEW" "$FILE"
done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment