-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoJSON default SRID not set #129
Comments
I solved this by setting the Map.put(Geo.JSON.decode!(item, :srid, 4326)
|
s3cur3
added a commit
that referenced
this issue
Aug 31, 2024
The GeoJSON spec [indicates](https://tools.ietf.org/html/rfc7946#section-4) that all GeoJSON should be assumed to use the WGS 84 datum by default. We should be permissive and allow overriding that datum (as we did previously), but I think the correct behavior here is to make the datum explicit in our decoded `Geo.Geometry.t()` values. This is a breaking change, but one which I expect to have quite little impact on users. (See the CHANGELOG.md for more.) Resolves #129
s3cur3
added a commit
that referenced
this issue
Sep 17, 2024
The GeoJSON spec [indicates](https://tools.ietf.org/html/rfc7946#section-4) that all GeoJSON should be assumed to use the WGS 84 datum by default. We should be permissive and allow overriding that datum (as we did previously), but I think the correct behavior here is to make the datum explicit in our decoded `Geo.Geometry.t()` values. This is a breaking change, but one which I expect to have quite little impact on users. (See the CHANGELOG.md for more.) Resolves #129
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that the SRID of a geometry parsed from geojson is not set to the default of 4326, as defined by the spec. I've run into this issue because I am parsing a geojson object and performing a query with it using the great geo_postgis lib. However, when the database's column SRID is 4326, I get an error that it cannot compare the two geometries because the SRIDs are different (the parsed geojson geometry has an SRID of 0).
As a temporary solution, I changed the SRID of the column to 0 in the database, which is clearly not ideal.
I'm more than happy to write up a merge request for this issue, if this should be the desired behavior. Just point me in the right direction!
EDIT: add versions
The text was updated successfully, but these errors were encountered: