Christophe,
Only way I've ever done something like this is brute force ... for the
distance from a /point /to a pline. In that instance, I calculated the
distance from the point to each segment in the pline (shortest distance
to segment is either distance to one of the segment's two nodes or, if
one exists, length of a line segment perpendicular to the pline segment
and terminating on the point).
Naturally, this is cumbersome for plines with a lot of segments. I
think it'd be even more so for pline-to-pline, as brute force would
require doing this from each segment in one pline to every segment in
the other, and comparing 'em all.
I wonder if there might be some shortcuts that might trim off a bunch of
the iterations -- e.g. identifying which segment(s) of the plines can be
quickly excluded as not being the ones that will generate the shortest
distance between the two plines. Haven't thought more about that.
I was using the code I'd written to demonstrate the concept of
semiautomatically building region objects from "clean" pline tables
(tables in which polylines only intersect one another at endpoints).
User clicked a point on the mapper, and program built the smallest
region containing the point that used the closest pline to the point.
If it'd be of any use, I can send you the code.
Regards,
Eric Johnson
Christophe Brabant wrote:
Hi everyone
How could I compute, with Mapbasic language, the lowest distance
between two polylines ?
Thank you
Chris
------------------------------------------------------------------------
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l