[postgis-tickets] [PostGIS] #3690: ST_AsGeoJSON can produce invalid geometry collections

PostGIS trac at osgeo.org
Sat Jan 21 19:32:23 PST 2017


#3690: ST_AsGeoJSON can produce invalid geometry collections
-----------------------+---------------------------
  Reporter:  jyutzler  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 2.3.2
 Component:  postgis   |    Version:  2.3.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by robe):

 well our processing of empty geometry collections seems okay:


 {{{
 SELECT ST_AsGeoJSON('GEOMETRYCOLLECTION EMPTY'::geometry);

 -- yields--
 {"type":"GeometryCollection","geometries":[]}

 }}}

 And ingesting the above with null is invalid:


 {{{
 SELECT ST_GeomFromGeoJSON('{"type":"GeometryCollection",
 "geometries":null}');

 -- yields

 ERROR:  Unable to find 'geometries' in GeoJSON string

 }}}


 Is the "geometry: part something you are getting back?  If getting back
 I'm assuming that is being tacked on by some post processor you have going
 and not part of what PostGIS is doing.  If so your post processor might
 also be converting [] to nulls.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3690#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list