ST_Equals(different srids) should return an error. Its not that its unknown its that we are too lazy to calculate it. Its quite known if we had the energy.
No - that is not true. You cannot calculate it in some cases.
We should go with binary equal rather than geometric equality. I think that would satisfy Charlie too. I guess I have my parents to blame too :)
I just want to be able to write this code: IF (GEOM1 = GEOM2) THEN And not have it blow up... And related doing a UNION like described in an earlier email.Last - I'm fine with what Paul proposes. That is that the = operator does not blow up, while ST_EQUALS does blow up. Having 2 versions of a function, one that raises an exception and one that does not, is not that uncommon...Alternatively, ST_EQUALS could take a 2nd parameter that specifies whether to blow up or not, with a default value of blow up....
Charlie
Thanks, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brent Wood Sent: Sunday, September 28, 2008 6:40 PM To: PostGIS Users Discussion Subject: RE: [postgis-users] Re: Comparing Geometries with Different SRIDs After a belated case of RTFM... It seems UNION does an implict distinct on all rows, unless UNION ALL is applied (How many Regina's do you want :-) I guess it makes sense to drop duplicates unless otherwise specified. stations=# select 1 union select 1; ?column? ---------- 1 (1 row) stations=# select 1 union all select 1; ?column? ---------- 1 1 (2 rows) stations=# select 'Regina' union select 'REGINA'; ?column? ---------- Regina REGINA (2 rows) stations=# select 'Regina' union select 'REGINA' union all select 'Regina'; ?column? ---------- Regina REGINA Regina (3 rows) Cheers Brent Wood --- On Mon, 9/29/08, Paragon Corporation <[EMAIL PROTECTED]> wrote:From: Paragon Corporation <[EMAIL PROTECTED]>Subject: RE: [postgis-users] Re: Comparing Geometries with Different SRIDs To: "'PostGIS Users Discussion'" <[email protected]> Date: Monday, September 29, 2008, 11:13 AM Brent, Ah never mind. For some reason I was under the false assumption that in SQL Server with dictionary sort order that even thoughREGINA = ReginaThat I would get 2 Reginas when I union them. That is not the case. I just get one.I'm not sure why I thought that or maybe it was like that a long time ago.Anyrate - so I guess I am back to square one. By the way - I think we should be talking about ST_OrderingEquals not ST_Equals.I'm not sure which if any of those PostGIS is using to do the check, but it should be ST_OrderingEquals since using ST_Equals introduces a whole lot more philosophical can of worms. Is space empty or is Empty space.Thanks, Regina-----Original Message----- From: Brent Wood [mailto:[EMAIL PROTECTED] Sent: Sunday, September 28, 2008 3:19 PM To: [EMAIL PROTECTED]Subject: RE: [postgis-users] Re: Comparing Geometries with Different SRIDsHi Regina,I think that is more an encoding/language issue than case in such an analogy.To wax metaphysical, does a muslim worship a different god because they spell it allah? (Similarly Jews with Jehovah & French with dieu...)So is st_equals() a cross-language thesaurus, or is it restricted to the specified SRID? :-)Spotcha, Brent Wood --- On Mon, 9/29/08, Paragon Corporation <[EMAIL PROTECTED]> wrote:From: Paragon Corporation <[EMAIL PROTECTED]> Subject: RE: [postgis-users] Re: Comparing Geometrieswith DifferentSRIDsTo: "'PostGIS Users Discussion'" <[email protected]>Date: Monday, September 29, 2008, 8:04 AM Charlie, On second thought not sure how DB II deals withrelational Union ofgeometries. Does anybody have that by chance to test? I suppose we could say this is the same deal asdifference in casing.SELECT 'Regina' UNION SELECT 'REGINA' UNION SELECT 'Regina' Even if both geometries are the same which SRID wouldyou choose? Sowe should not be doing a geometry compare, but abinary compare.SELECT ST_AsEWKB('SRID=4269;POINT(1 3)') = ST_AsEWKB('SRID=4326;POINT(1 3)') Thanks, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf OfParagon Corporation Sent: Sunday, September 28, 2008 2:48 PM To: 'PostGIS Users Discussion' Subject: RE: [postgis-users] Re: Comparing Geometrieswith Differentside.SRIDs I feel your pain Charlie, but I'm on Reid'sGiven that some spatial databases do support cross compare between geometriesof differentSRID (e.g. DB II), not sure about Oracle or SQL Server2008, I wouldprefer an answer that is in compliance or throws anexception when itcan't be sure. Its annoying from a debugging perspective to dealwith things thatfail silently. Returning false is a fail silently inmy book.If we deal with this as a special case - whywouldn't we deal withcompare we do?everything else the same with every other relationalIts just wrong, but granted doing the wrong thingwould beconveniently useful in many cases. Thanks, Regina-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf OfCharlie Savage Sent: Sunday, September 28, 2008 2:10 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Re: Comparing Geometrieswith DifferentSRIDs Reid Priedhorsky wrote:Charlie Savage wrote:The 2 point could be spatially equalgivendifferent SRIDS andcoordinates if they were projected to acommonSRID. So shouldgeometry operators silently Callst_transformto make the righthandmatch the lefthand before comparing? Thiswould be quite theexpensive operation.No. You can't automatically transformbetweendifferent SRID valuesThink of the case of one geometry with anSRIDvalue of 4326 and onewith an SRID value of -1 (no coordinatesystem).Exactly.So different SRID values, then the geometriesarenot equal.No -- as Stanley said, the geometries could be infactequal, butexpressed in different SRS. So if ST_Equals()returnedFalse, it wouldbe wrong.Maybe. But returning "Operation permitted"is even worse because itmeans you can't do natural things like this(without extra annoyingSRID checking code) in plpgsql: IF (geom1 == geom2) ... END IF; Or the example with the union earlier postedIt is up to the user to transform geometriestothe same SRID beforecalling ST_EQUALS.Exactly. ;)So, I still vote that st_equals will not blow up whencomparing twogeometries with different SRID values, it just willreturn false.Charlie _______________________________________________ postgis-users mailing list [email protected]http://postgis.refractions.net/mailman/listinfo/postgis-users_______________________________________________ postgis-users mailing list [email protected]http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
-- Charlie Savage http://cfis.savagexi.com
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
