Skip to content

Instantly share code, notes, and snippets.

@tdaubs
Forked from benbalter/geojson-conversion.sh
Created August 30, 2014 07:19
Show Gist options
  • Save tdaubs/884ebcf1dc0433d2340d to your computer and use it in GitHub Desktop.
Save tdaubs/884ebcf1dc0433d2340d to your computer and use it in GitHub Desktop.
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
#unzip all files in a directory
for var in *.zip; do unzip "$var";done
#convert all shapefiles
for var in *.shp; do shp2geojson ${var%\.*}; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment