Converting Shapefiles to GeoJSON
Page content
1.ogr2ogr can convert shapefiles to GeoJson format.
2. to install this on mac,
brew install gdal 3. unzip the shapefile.zip and run the below command
ogr2ogr -f GeoJSON -t_srs crs:84 shapefile.json shapefile.shp
this line converts the shapefile to geojson. -t_srs crs:84 ensures its encoded with the right projection when it hits github.
- use this script if you have to convert multiple shapefiles to geojson.
https://gist.github.com/benbalter/5858851