Change handling of EPSG/SRID to match standard #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PostGIS'
ST_AsGeoJSON()
function (http://www.postgis.net/docs/ST_AsGeoJSON.html) produces a CRS field with a colon betweenEPSG
and the SRID integer, egEPSG:4326
. Googling around, this appears to be the standard way of doing things. The existing code expects no colon (EPSG4326
). I've changed it to match what seems to be the standard.The catch with this change is that anyone who's encoded a geom with the old code will not be able to decode with the new version. If you think that's likely to be an issue, it could be resolved by adding back in the old clause for
get_srid/1
between the new version and the version that takesnil
. I didn't do that in order to keep the code simple, but I have no problem with doing so.