[postgis-devel] [PostGIS] #771: Unable to query if geometry column has mixed srid

PostGIS trac at osgeo.org
Fri Jan 14 07:06:35 PST 2011


#771: Unable to query if geometry column has mixed srid
--------------------------+-------------------------------------------------
 Reporter:  farrukhnajmi  |       Owner:  pramsey      
     Type:  defect        |      Status:  new          
 Priority:  medium        |   Milestone:  PostGIS 1.4.3
Component:  postgis       |     Version:  1.3.X        
 Keywords:                |  
--------------------------+-------------------------------------------------
 Details are described in this thread:

 http://postgis.refractions.net/pipermail/postgis-
 users/2011-January/028613.html

 If a table has a geometry column and rows where teh geometry column value
 has different srid then there does not seem to be any way to do spatial
 filters in a query on the table for rows where the geometry value has a
 specified srid. The following queries all give the error "Operation on
 mixed SRID geometries".

 --Gives Error: Operation on mixed geometries
 SELECT * FROM GeometryValueType gvt WHERE ( ST_SRID(gvt.geometry) = 4326
 AND
   within(gvt.geometry, ST_GeomFromText('POLYGON((-100 0, 0 0, 0 100, -100
 100, -100 0))', 4326)) = true )

 --Gives Error: Operation on mixed geometries
 SELECT * FROM GeometryValueType gvt WHERE
     ST_SRID(gvt.geometry) = 4326 AND gvt.id IN (
       SELECT gvt1.id FROM GeometryValueType gvt1 WHERE
         within(gvt1.geometry, ST_GeomFromText('POLYGON((-100 0, 0 0, 0
 100, -100 100, -100 0))', 4326)) = true
     )

 My POSTGIS version is:

 "POSTGIS="1.3.3" GEOS="3.1.0-CAPI-1.5.0" PROJ="Rel. 4.7.1, 23 September
 2009" USE_STATS"

 My PG version is 8.3

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