*** SPAM [5.2] *** [postgis-users] Operation on mixed SRID geometries

Gregory Williamson Gregory.Williamson at digitalglobe.com
Mon Oct 1 02:00:19 PDT 2007


Temiz --

You wrote:

> hello
> 
> when I enter this command:
> 
> select count(*) from shey6 as a,sel10p4 as b where 
> contains(a.wkb_geometry,b.wkb_geometry) ='t';
> ERROR:  Operation on mixed SRID geometries
> 
> shey6 polygon
> sel10p4 point
> 
> 
> how can I solve the problem ?
> 

The data you posted is not really sufficient; the complaint is about the SRID (Spatial Reference IDs) being different, not the type of geometries.

You need to cast at least some of the geometries so that they are all the same -- you can't mix SRIDs -1 and 4326, for instance; one or the other has to be cast. You can do this on the fly within a query but it is likely to be slow. It might be worth your while to consider casting them before hand, or if needed store the cast geometries and a primary key in another table.

If have an index on a geometry column with mixed SRIDS -- don't! It won't work right. You could perhaps functional indexes on the geometries based on SRID but you really can't compare things that are not in the same SRID. Apples and oranges kind of thing.

If you post more details on the SRIDs involved people might be able to give you some better advice.

See the ST_SRID function and perhaps group by the resulting SRIDS to get some counts for how many geometries are involved.

HTH,

Greg Williamson
Senior DBA
GlobeXplorer LLC, a DigitalGlobe company

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071001/2e076be5/attachment.html>


More information about the postgis-users mailing list