Opened 4 years ago

Closed 4 years ago

#4669 closed defect (invalid)

ST_GeomFromGeoJSON can't create 4d geomtries

Reported by: fredj Owned by: pramsey
Priority: medium Milestone:
Component: postgis Version: 2.5.x -- EOL
Keywords: Cc:

Description

ST_GeomFromGeoJSON can create 2 and 3d geometries but not 4d:

SELECT ST_AsText(ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[100, 200, 3, 4], [500, 600, 7, 8]]}'));
             st_astext              
------------------------------------
 LINESTRING Z (100 200 3,500 600 7)
(1 row)

In this case, I'm expecting to have

                st_astext                
-----------------------------------------
 LINESTRING ZM (100 200 3 4,500 600 7 8)
(1 row)

Change History (2)

comment:1 by Algunenano, 4 years ago

The GeoJSON RFC (https://tools.ietf.org/html/rfc7946) doesn't support 4d:

4.  Coordinate Reference System

   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.  An OPTIONAL third-position element SHALL
   be the height in meters above or below the WGS 84 reference
   ellipsoid.  In the absence of elevation values, applications
   sensitive to height or depth SHOULD interpret positions as being at
   local ground or sea level.

   Note: the use of alternative coordinate reference systems was
   specified in [GJ2008], but it has been removed from this version of
   the specification because the use of different coordinate reference
   systems -- especially in the manner specified in [GJ2008] -- has
   proven to have interoperability issues.  In general, GeoJSON
   processing software is not expected to have access to coordinate
   reference system databases or to have network access to coordinate
   reference system transformation parameters.  However, where all
   involved parties have a prior arrangement, alternative coordinate
   reference systems can be used without risk of data being
   misinterpreted.

comment:2 by Algunenano, 4 years ago

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