[postgis-users] Comparing Geometries with Different SRIDs

Paragon Corporation lr at pcorp.us
Sat Sep 27 14:06:28 PDT 2008


Charlie,

That is kind of weird.  Although 

select 'srid=4326;point(3 3)'::geometry
union all
select 'srid=4325;point(3 3)'::geometry

Works as you would expect since it never has to do any compare between
geometries.

I guess its because at some point to determine uniqueness UNION has to call
something like ST_Equals and since all the PostGIS relation functions are
only supported for geometries with the same SRID it would fail.

So I would say this is a limitation of design rather than a bug.

Thanks,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Charlie
Savage
Sent: Saturday, September 27, 2008 4:34 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Comparing Geometries with Different SRIDs

This looks like a related issue:

select 'srid=4326;point(3 3)'::geometry
union
select 'srid=4325;point(3 3)'::geometry

ERROR:  Operation on two GEOMETRIES with different SRIDs

I find that surprising, I would expect to get a result table with two rows.

Charlie

Charlie Savage wrote:
> Here is another SRID issue that seems strange:
> 
> select 'srid=4326;polygon((0 0, 0 5, 5 5, 5 0, 0 0))'::geometry =
> 'point(2 2)'::geometry
> 
> 
> ERROR:  Operation on two GEOMETRIES with different SRIDs
> 
> 
> Why not just return FALSE?  I can see forcing the same SRID when 
> performing operations such as unions, but if the geometries have 
> different SRID's then it seems reasonable to assume they are not 
> equivalent.
> 
> 
> Charlie
> 
> 
> ----------------------------------------------------------------------
> --
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

--
Charlie Savage
http://cfis.savagexi.com





More information about the postgis-users mailing list