AW: [postgis-users] Comparison of geometries

Düster Horst Horst.Duester at bd.so.ch
Tue Jan 31 05:32:29 PST 2006


Hallo Darren

Thank you for your response. 
Of course you cannot see any difference due to I sent the wrong layer to the
list. Now I attach the two correct shapes with the differences which do not
work. Please excuse the confusion. 

Import the attached shapes new_layer.shp and old_layer.shp to your PostGIS
DB. When you query with

 select the_geom, art from old_layer
 except
 select the_geom, art from new_layer

the query supplies 1 Record and that's wrong!

with 

 select the_geom::text, art from old_layer
 except
 select the_geom::text, art from new_layer

the query supplies 2 Records and that's correct!

I can't see any reason for this difference.

With 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



> -----Ursprüngliche Nachricht-----
> Von: Darren Houston [mailto:dhouston at beyondcompliance.ca]
> Gesendet am: Dienstag, 31. Januar 2006 08:57
> An: PostGIS Users Discussion
> Betreff: Re: [postgis-users] Comparison of geometries
> 
> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: old_layer.zip
Type: application/octet-stream
Size: 5127 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060131/7a268d48/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_layer.zip
Type: application/octet-stream
Size: 6823 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060131/7a268d48/attachment-0001.obj>


More information about the postgis-users mailing list