[postgis-devel] [PostGIS] #1041: ST_Collect is screwy with M dimension

PostGIS trac at osgeo.org
Mon Jun 20 02:26:20 PDT 2011


#1041: ST_Collect is screwy with M dimension
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  1.5.X        
 Keywords:           |  
---------------------+------------------------------------------------------
 {{{
 SELECT ST_AsEWKT(ST_Collect(ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1261
 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261
 42.2702 1,-71.1261 42.2703 1))'),

         ST_GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((-71.0821 42.3036
 2,-71.0822 42.3036 3,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036
 2)))') ));
 }}}

 Yields:

 {{{
 SRID=4326;GEOMETRYCOLLECTIONM(POLYGON((-71.1261 42.2703 1,-71.1257 42.2703
 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261 42.2702 1,-71.1261 42.2703
 1)),MULTIPOLYGON(((-71.0821 42.3036 2,-71.0822 42.3036 3,-71.082 42.3038
 2,-71.0819 42.3037 2,-71.0821 42.3036 2))))
 }}}

 Which causes this

 {{{
 SELECT
 ST_GeogFromText(ST_AsEWKT(ST_Collect(ST_GeomFromEWKT('SRID=4326;POLYGONM((-71.1261
 42.2703 1,-71.1257 42.2703 1,-71.1257 42.2701 2,-71.126 42.2701 1,-71.1261
 42.2702 1,-71.1261 42.2703 1))'),

         ST_GeomFromEWKT('SRID=4326;MULTIPOLYGONM(((-71.0821 42.3036
 2,-71.0822 42.3036 3,-71.082 42.3038 2,-71.0819 42.3037 2,-71.0821 42.3036
 2)))') )));
 }}}

 To fail with error:


 {{{
 ERROR:  can not mix dimensionality in a geometry
 HINT:  "...0819 42.3037 2,-71.0821 42.3036 2))))" <-- parse error at
 position 266 within geometry
 }}}


 It's the same issue in 1.5, but 1.5 doesn't error out with ST_Geog because
 evidentally 1.5 c\geog check doesn't care as much about dimensionality as
 2.0 does.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1041>
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-devel mailing list