Opened 5 years ago

Closed 5 years ago

#4277 closed enhancement (fixed)

ST_GeomFromGeoJSON: default SRID to 4326

Reported by: komzpa Owned by: pramsey
Priority: medium Milestone: PostGIS 3.0.0
Component: postgis Version: 2.4.x
Keywords: Cc:

Description

We're only setting SRID on parse if it's specified in GeoJSON. It is implied to be what we call EPSG:4326 by RFC7946:

https://tools.ietf.org/html/rfc7946

`

The coordinate reference system for all GeoJSON coordinates is a

geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN urn:ogc:def:crs:OGC::CRS84.

`

Attachments (1)

4277.patch (862 bytes ) - added by pramsey 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by pramsey, 5 years ago

I think this has to go into trunk. I originally thought maybe we could back-patch, but envisioned a GeoJSON user who built a completely SRID-free database, and expected their GeoJSON to come in without SRID, and then started getting "mismatched SRID" errors everywhere. So, I'm pushing to trunk.

comment:2 by pramsey, 5 years ago

Milestone: PostGIS 2.5.2PostGIS 3.0.0
Type: defectenhancement

by pramsey, 5 years ago

Attachment: 4277.patch added

comment:3 by pramsey, 5 years ago

As expected it breaks regression. Not 100% sure I like it. Leaving a patch attached and going on my way for now.

comment:4 by komzpa, 5 years ago

Closed in r17678

comment:5 by komzpa, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.