[postgis-tickets] [PostGIS] #3098: ST_GeomFromText() cannot read MultiPoint containing empty Points with Z or M coordinates

PostGIS trac at osgeo.org
Wed Apr 15 09:34:14 PDT 2015


#3098: ST_GeomFromText() cannot read MultiPoint containing empty Points with Z or
M coordinates
-----------------------------------------------------------------------------------------+
 Reporter:  benmorel                                                                     |       Owner:  pramsey      
     Type:  defect                                                                       |      Status:  new          
 Priority:  critical                                                                     |   Milestone:  PostGIS 2.1.7
Component:  postgis                                                                      |     Version:  2.1.x        
 Keywords:  ST_GeomFromText, MultiPoint, MultiLineString, MultiPolygon, Empty, Z, M, ZM  |  
-----------------------------------------------------------------------------------------+
 Take the following MultiPoint ZM, made of an empty and a non-empty Point:

 {{{
 SELECT ST_AsText(ST_Collect(
   ST_GeomFromText('POINT ZM EMPTY'),
   ST_GeomFromText('POINT ZM (1 2 3 4)')
 ));
 }}}

   MULTIPOINT ZM (EMPTY,1 2 3 4)

 Now if I try to read this geometry back, I get an error:

 {{{
 SELECT ST_AsText(ST_GeomFromText('MULTIPOINT ZM (EMPTY,1 2 3 4)'));
 }}}

   ERROR:  can not mix dimensionality in a geometry
   HINT:  "MULTIPOINT ZM (EMPTY,1 2 3 4)" <-- parse error at position 29
 within geometry

 As far as I understand it, PostGIS reads "EMPTY" as "EMPTY 2D geometry",
 whereas it's actually dependent on the dimensionality of the parent
 geometry.

 This bug occurs with Z, M, and ZM geometries.
 The same bug occurs with MultiLineString and MultiPolygon.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3098>
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