[postgis-users] Comparison of geometries

Darren Houston dhouston at beyondcompliance.ca
Mon Jan 30 23:57:14 PST 2006


Hello Horst,

Except works as expected for me. PostgreSQL will compare my lwgeom geometries 
and provide the correct returned results. You can try except all for 
duplicate rows, but if no results are being returned that probably won't help 
you. You could also cast your geometries to text (or another data type) and 
try comparing those values. Also, for a check, if you perform 
asewkt(difference()) on the geometries from one table to geometries in the 
other, do you receive an empty geometry collection (i.e. the geometries are 
equall)? Maybe your geometries are really equal.

Just some brain garbage from me that might give you some ideas,

Darren H.

On Tuesday 31 January 2006 00:34, Düster Horst wrote:
> I try to compare two geometry tables with the intension to detect the
> geometrical and attributive differences between these two tables. For
> example I attach two tables new and old. Now I want to detect all
> geometries of the table old which are not in table new. For this issue I
> use the following query
>
> select the_geom, art from "old"
> except
> select the_geom, art from "new"
>
> but the query doesn't supply the correct result. The correct result should
> contain two records but the query results 0 records. Now I'm doubt about
> whether  it's allowed to use geometries in an except clause like other
> datatypes?? Otherwise in other tables 100% of different geometries will be
> detected by the query above!
>
> My System:
> RedHat AS4
> PostgreSQL 8.1.1
> POSTGIS="1.0.6" GEOS="2.1.1" PROJ="Rel. 4.4.8, 3 May 2004" USE_STATS
> DBPROC="0.3.0" RELPROC="0.3.0"
>
> I'll appreciate every hint.
>
> Best regards
>  
> Dr. Horst Düster
> GIS-Koordinator, Stv. Amtsvorsteher
>
> Kanton Solothurn 
> Amt für Geoinformation
> Abteilung SO!GIS Koordination
> Rötistrasse 4
> CH-4501 Solothurn
>
> Tel.: ++41 (0)32 627 25 32
> Fax: ++41 (0)32 627 22 14
>
> horst.duester at bd.so.ch
> www.sogis.so.ch



More information about the postgis-users mailing list