[geos-devel] SnapPointToLine : GEOS : where is the code for st_intersects between line and point?

Paul Ramsey pramsey at cleverelephant.ca
Thu Nov 7 14:25:14 PST 2013


I can certainly see the practical utility of a global tolerance value,
since it would allow some more symmetric results, like

PtC = LineA.Intersection(LineB)
LineA.Intersects(PtC) == true
LineB.Intersects(PtC) == true

An expected euclidian result that occurs in almost no cases in our code.

Of course a tolerance introduces different inconsistencies. Within a
tolerance it's possible for

LineA.Intersects(PtC) == true
LineB.Intersects(PtC) == true
Even when A is parallel to B and A != B.

Not something which can happen in a true euclidian space, but
something that can happen in our tolerance space.

However, it's a concept that needs to reside at the very bottom of a
geometry library, I don't see how we introduce it without irreparably
shaking everything we've already built above.

P.


On Thu, Nov 7, 2013 at 8:44 AM, Sandro Santilli <strk at keybit.net> wrote:
> On Thu, Nov 07, 2013 at 02:36:26PM +0100, Rémi Cura wrote:
>> Hey,
>> after some testing it appears that simply evaluating the = with precision
>> in mind won't suffice.
>>
>> The core of the problem is that the determinant algorithm geos uses seems
>> to be designed to robustly say left or right of a line, but not robustly on
>> the line.
>>
>> So an idea may be to offset the line to the left and the right with the
>> precision limit distance, and use the robust determinant to test if the
>> point is right of the left and left of the right (between).
>>
>> Can I have some answers on this please? Is it doable, ?
>
> Sorry Remi, I think everything is possible, but it needs careful
> thinking about consequence of changes. If the design it to be robust,
> ading a toleranc would defeat the design, which isn't a sane thing
> to do. Rather you might want another class to do things the way
> you want them to be done.
>
> It's still not clear to me what the goal is, nor if the provision
> of "Fixed Precision Model" helps already at reaching that goal.
>
> Are you trying to find a point that's guaranteed to be found on a
> line by robust intersection finder ? My take is that it is
> impossible unless the point you pick is a pre-existing vertex of
> that line, and so the only way to do it is by also modifying the
> line you want to snap to (ie: snap line to closest-point-on-line).
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel


More information about the geos-devel mailing list