[postgis-users] operator && return errors where st_overlaps or st_intersects does not
Rémi Cura
remi.cura at gmail.com
Thu Nov 21 08:01:30 PST 2013
Hey,
It's difficult to help if you don't provide an example of
non-working-as-intended-query.
The 2 queries above can't run without 'soils.vw_zones' table, so I can't
reproduce your bug.
Can you try to update all your table with
UPDATE soils.vw_zones SET geometry = ST_SetSRID(geom, XXX);
Also it seems you have a column named "geometry", which is a very bad idea
as it is already a type name (should be reserved).
And I might as well say it, but maybe you should try on a recent version of
PostGIS?
Cheers,
Rémi-C
2013/11/21 Huub Fleuren <huub.fleuren at geodan.nl>
>
> Hello,
>
>
> I found that there is a difference in result between using A && Boperator or one of the geo functions like
> st_intersects(A,B) or st_overlaps(A,B)
>
> While the st_intersects or st_overlaps functions returns query results
> without errors the operator version SOMETIMES results in errors over the
> SRID:
>
> ERROR: Operation on two geometrys with different SRID's.
>
> ERROR: Operation on two geometrys with different SRIDs
> SQL state: XX000
>
> All of the 3552 records are OKE, having the correct SRID, all 2D, all vaid.
>
> select st_srid(geometry) ,count(*) from soils.vw_zones group by
> st_srid(geometry)
> SELECT ST_Dimension(geometry), count(*) from soils.vw_zones group by
> ST_Dimension(geometry)
> SELECT ST_isvalid(geometry), count(*) from soils.vw_zones group by
> ST_isvalid(geometry)
>
> Everything runs on ubuntu
> -The SQL query is generated by MAPSERV 5.6.1 WMS server
> -Postgres Version 9.0.5
> -Postgis version 1.5
>
>
> Sample query:
>
> Operator &&
>
> select
> encode(AsBinary(force_collection(force_2d("geometry")),'NDR'),'hex') as
> geom, "id"
> from (select * from soils.vw_zones) as vw
> where geometry && GeomFromText('POLYGON((75722.1945223652
> 437331.342330005,75722.1945223652 503295.946741193,169438.897876772
> 503295.946741193,169438.897876772 437331.342330005,75722.1945223652
> 437331.342330005))',find_srid('','soils.vw_zones','geometry'))
>
> ST_INTERSECTS
>
> select
> encode(AsBinary(force_collection(force_2d("geometry")),'NDR'),'hex') as
> geom, "id"
> from (select * from soils.vw_zones) as vw
> where st_intersects(geometry,GeomFromText('POLYGON((75722.1945223652
> 437331.342330005,75722.1945223652 503295.946741193,169438.897876772
> 503295.946741193,169438.897876772 437331.342330005,75722.1945223652
> 437331.342330005))',find_srid('','soils.vw_zones','geometry')))
>
>
>
> Regards, Huub
>
>
>
> --
>
> E huub.fleuren at geodan.nl
>
> <http://www.geodan.nl/disclaimer>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20131121/9beb0964/attachment.html>
More information about the postgis-users
mailing list