[postgis-users] two different geometries with the same Astext

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jul 18 09:03:37 PDT 2005


Miguel de la Fuente wrote:
> Hello, I'looking for help with something that already happens to me in
> the past, comparing two geometries with equals() return false but when
> I get the AsText() of both it was the same.
> Right now I'm having a similar problem with within(), when I ask if a
> geometry1 is within a geometry2 in another table, both
> multilinestrings,  the result is false.
> I ask the AsText of both and see that the geometry1 is one segment of
> geometry2, so it is within it.
> And, if I ask 
> wthin(GeometryFormText(AsText(geometry1)),GeometryFormText(AsText(geometry2)))
> return true
> 
> Then, why wthin(geometry1,geometry2) return false ?
> 
> Can anyone help me??

This sounds like floating point comparisons failing because of numerical 
rounding issues.

strk, Is there an epsilon value that is used to comparing floating point 
values? Is this accessible or settable at runtime?

-Steve W.



More information about the postgis-users mailing list