Skip to content

Instantly share code, notes, and snippets.

Avatar

Blaine Booher booherbg

View GitHub Profile
@benbalter
benbalter / geojson-conversion.sh
Last active Dec 5, 2020
Bulk convert shapefiles to geojson using ogr2ogr
View geojson-conversion.sh
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}