[postgis-users] Wrong result in spatial analysis methodslikeintersects due to limited coordinate precision
Markus Schaber
schabi at logix-tt.com
Wed May 24 06:11:15 PDT 2006
Hi, Gerard,
Sommer Gerhard wrote:
> Point A and point B (of polygon I) were snapped to the line segment
> connecting point 1 and point 2 (of polygon O) and polygon I was then
> stored in the database. Both points A and B are not exactly on the
> line connecting 1 and 2, as I we can not store exact coordinates in
> any database. But they are as near as possible to the line and for
> practical purposes the line A-B touches the line 1-2 and polygon I is
> within polygon O.
Hmm, as a hackish workaround, you can try the following:
contains(buffer(O,tolerance),I) AND intersects(buffer(O,-tolerance),I)
I guess that tolerance should be something like sqrt(2)*0.00000001 in
your case.
Btw, you can expect the code above to be pretty slow.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
More information about the postgis-users
mailing list