[postgis-users] ERROR: Operation on two GEOMETRIES with differentSRIDs

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Fri Jul 14 02:57:50 PDT 2006


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of Johan V
> Sent: 14 July 2006 10:46
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] ERROR: Operation on two GEOMETRIES with
> differentSRIDs

(cut)

> Now am i trying to do the next sql statement on this table:
> 
> 
> 
> Than I get the response: ERROR:  Operation on two GEOMETRIES with
> different SRIDs.


Hi Johan,

The issue here is that it is the geometry you are creating on the fly is
constructed with a SRID of -1 because it has not yet been tied to a
coordinate system - your table definition and the constraints that go with
it are fine. The way to handle this is to use setSRID()/GeometryFromText()
to assign the same coordinate system to your polygon when you construct it,
e.g.

SELECT the_geom FROM reflijst WHERE ((the_geom && GeomFromText(
'POLYGON((33595.443392445566 15067.465440617714, 281187.7093687274
15067.465440617714, 281187.7093687274 254932.5345593823,33595.443392445566
254932.5345593823,33595.443392445566 15067.465440617714))', 103300)))


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk   
http://www.infomapper.com
http://www.swtc.co.uk  

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.





More information about the postgis-users mailing list