Skip to content

Instantly share code, notes, and snippets.

@palewire
Last active March 9, 2021 19:53
Show Gist options
  • Select an option

  • Save palewire/24c728bbdd2e3490c4456011adcc8d9f to your computer and use it in GitHub Desktop.

Select an option

Save palewire/24c728bbdd2e3490c4456011adcc8d9f to your computer and use it in GitHub Desktop.
Repair and overwrite all shapefiles in the current directory using mapshaper's -clean option
#!/bin/sh
for FILEPATH in ./*.shp; do
FILENAME="$(echo "$FILEPATH" | rev | cut -d "/" -f1 | rev)";
echo "Cleaning $FILENAME";
mapshaper $FILEPATH -clean -o force $FILEPATH;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment