substack/shp2json — pull request #8 by amenadiel (2014-10-15 22:19:22+00:00)
Title: Avoids fatal errors on null SRS and invalid geometry

1. I've encountered a few shapefiles containing invalid or not Gdal parseable geometries. See example [us_airports.zip](https://dl.dropboxusercontent.com/u/3133731/us_airports.zip)
shp2json crashes on them, so I wrapped the getGeometry() call on a try / catch block. If the geometry is invalid, if just continues over to the next one.

2. Most shapefiles from [geocommons](http://www.geocommons.org) do not have a ```.prj``` file, or the srs property for the layers if null. See example [world_boundaries_with_fips.zip](https://dl.dropboxusercontent.com/u/3133731/world_boundaries_with_fips.zip)
Again, this causes the conversion to crash so I set an srs variable with can be either the layer srs property or a new instance of ```gdal.SpatialReference.fromEPSG(4326)```

Thanks for this amazing module. I hope this small modification helps someone someday;