[postgis-users] Querying geometries with different srid
Farrukh Najmi
farrukh at wellfleetsoftware.com
Thu Jan 13 16:53:13 PST 2011
Any one able to shed some light on this?
Rephrasing my question, how can I write a query involving a geomtery
column where geometry values are of mixed srid if my spatial operation
is only on rows where the geometry matches sa specific srid (e.g. 4326).
Thanks for your help.
On 01/13/2011 09:42 AM, Farrukh Najmi wrote:
>
> In my schema I have a table GeometryValueType with a column geometry
> of type geometry. The values in this column may be of mixed srid.
>
> I write my query (see below) to only match rows where the geometry
> srid is 4326 and then compare it with a filter geometry with srid 4326.
> For some reason I am still getting the "Operation on mixed geometries".
>
> Can any one help me understand why I am getting this error if the
> first predicate in my query filter on srid = 4326?
>
> --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 )
>
> Thanks in advance.
>
--
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com
More information about the postgis-users
mailing list