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

Martin Davis mbdavis at VividSolutions.com
Mon Jul 18 10:26:45 PDT 2005


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

Highly unlikely - JTS/GEOS is very robust wrt predicates. 

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

No.  In the case of predicates, JTS uses exact methods to determine
values of geometric comparisons.  (which is much more complex than
simply comparing numeric values, by the way).

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Stephen Woodbridge
> Sent: July 18, 2005 9:04 AM
> To: Miguel de la Fuente; PostGIS Users Discussion
> Subject: Re: [postgis-users] two different geometries with 
> the same Astext
> 
> 
> 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(AsT
> ext(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.
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list