[postgis-users] Point on a surface doesn`t touch geometry?

Obe, Regina robe.dnd at cityofboston.gov
Tue Apr 28 07:59:38 PDT 2009


Kai,

I think you are running into floating point issues with intersects and
touches. That is why even intersects doesn't work. Because the
representation of a point on surface approximates a point on the surface
but is not always a point on surface if that makes any sense.

use ST_DWithin instead. Its like an st_intersects with tolerance.

SELECT ST_DWithin(the_geom,Geomfromtext('POINT(897169.996155569
6850066.73917209)',900913), 0.001) from ways where gid=14730;

But Nicholas is right -- overlaps wouldn't work anyway as I recall
thought I don't use that much.

Kevin has a nice diagram of what it means to touch.  Perhaps we need the
same for Overlaps.

http://postgis.refractions.net/documentation/manual-svn/ST_Touches.html

Hope that helps,
Regina


-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Nicolas Ribot
Sent: Tuesday, April 28, 2009 10:45 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Point on a surface doesn`t touch geometry?

> Dear users,
>
>
> with "SELECT astext(pointOnSurface(the_geom)) from ways where
gid=14730"
> I get the coordinates of a point that lies on the surface of a
MULTILINESTRING.
>
> I get: POINT(897169.996155569 6850066.73917209)
>
> Then I try
> SELECT overlaps (the_geom,Geomfromtext('POINT(897169.996155569
6850066.73917209)',900913)) from ways where gid=14730;
>
> ...and I get FALSE ???
>
> (I also tried with "touches" and "intersects" --> the
> result there also FALSE).
>
>
> Has anybody an idea how this can be?
>

Hi Kai,
Yes, this can be because of the OGC specifications, that define very
precisely these predicates, in terms of relationship between interior,
boundary and exterior of each object.
A point cannot overlap a polygon, for instance (as far as I remember)
Looking at the predicates definitions in the specifications may help
to understand what they mean, for each kind of objects (points, lines,
polygons):

http://www.opengeospatial.org/standards/sfs

(don't trust your 'human' understanding of what 'touches' or 'overlaps'
mean)

You may also look at the Jump documentation, as it contains nice
graphics showing some common misunderstandings with these predicates
(http://www.vividsolutions.com/JUMP/)

HTH
Nicolas
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.



More information about the postgis-users mailing list