<div dir="ltr">Hi,<br><br>I nearly fell off my chair yesterday when i saw that distance(), computed on a self-join, gave a different result for id 1 vs id 2, than for id 2 vs 1.<br>The geometries are polygons, stored as multipolygons<br>
this is the sql:<br> select a.gid as aid, b.gid as bid, distance(a.the_geom, b.the_geom)<br> from table1 a, table1 b<br> where a.gid != b.gid;<br><br>This is the result on "POSTGIS="1.0.6" GEOS="2.2.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS DBPROC="0.3.0" RELPROC="0.3.0""<br>
aid | bid | distance
<br>-----+-----+------------------<br> 1 | 2 | 7805.02139594382
<br> 2 | 1 | 9642.16555369735
<br><br>But i couldn't reproduce it on my 'POSTGIS="1.1.6" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.6.0, 21 Dec 2007" USE_STATS'<br>There, the result is:<br> aid | bid | distance <br>
-----+-----+------------------<br> 1 | 2 | 7805.02139594382<br> 2 | 1 | 7805.02139594382<br><br>Is this a known bug of that version?<br><br><br><br><br clear="all"><br>-- <br>"Patriotism is the conviction that your country is superior to all others because you were born in it." - George Bernard Shaw<br>
</div>