[postgis-tickets] [PostGIS] #2320: Operator && does not detect mixed SRIDs

PostGIS trac at osgeo.org
Fri May 10 17:13:16 PDT 2013


#2320: Operator && does not detect mixed SRIDs
-----------------------+----------------------------------------------------
 Reporter:  darkblueb  |       Owner:  pramsey      
     Type:  defect     |      Status:  new          
 Priority:  medium     |   Milestone:  PostGIS 2.1.0
Component:  postgis    |     Version:  2.0.x        
 Keywords:             |  
-----------------------+----------------------------------------------------
 given:
 * function ST_GeomFromEWKT() creates binary geometry with the SRID "baked-
 in"
 * ST_Intersects() detects, warns and fails on params with mixed SRIDs

 {{{
 select st_intersects( st_geomfromEWKT('SRID=4326;POINT(1 2)'),
 st_geomfromEWKT('SRID=3310;MULTIPOLYGON(
 ((0 0, 10 0, 10 10, 0 10, 0 0)) )' ));

 ERROR:  Operation on mixed SRID geometries
 CONTEXT:  SQL function "st_intersects" statement 1
 }}}

 but, the && operator does not warn, and incorrectly succeeds, on mixed
 SRID geometry

 {{{
 select st_geomfromEWKT('SRID=4326;POINT(1 2)')   &&
 st_geomfromEWKT('SRID=3310;MULTIPOLYGON( ((0 0, 10 0
 , 10 10, 0 10, 0 0)) )' );

  ?column?
 ----------
  t
 (1 row)
 }}}

 tested on versions 2.0 and 2.1 trunk

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