RE: MI Looking for Nearest Object Distance Functions

2000-01-02 Thread Jacques Paris

In the mbx SLOPESTI (slope estimator), I try to find out the value and the
direction of the slope at any specified point of a contour map. I use a "32
spoke wheel" that allows me to find out the nearest intersections with the
contour lines. Then I look for the shortest distance along the 16 directions
between intersection points.

There are several possible situations : a - both points are on successive
contour line (that is good, and computations can be carried out), b - they
are on the same contour line (something like in a trough, no answer; one
could imagine seeing if there is another pair on intersection points and
what would be its condition, I did not go that far.), c - there is only one
intersection point, the "wheel" not intersecting any other contour (due to
the the length of the spokes, and that could be changed, or the proximity to
the edge of the map; the single point can then be used as an approximation
in the computations).

Slopesti is available on our site.

Jacques Paris

e-mail  alternate
 [EMAIL PROTECTED]   [EMAIL PROTECTED]

paris PC Consult (mainly MapInfo app.)
 www.total.net/~rparis/gisproducts.htm

- Original Message -
From: Stephen R. Riese [EMAIL PROTECTED]
To: MapInfo [EMAIL PROTECTED]
Sent: Friday, December 31, 1999 9:01 PM
Subject: MI Looking for Nearest Object Distance Functions

 Greetings,

 I'm new to MapInfo/MapBasic and this list server.  I'm looking for a
 function that will return the distance from a given point to the nearest
 object of a certain type.  For example, from point (x, y) to the nearest
 house (point object), road or river (linear object) or nearest forrest
 (area object).  All of the functions I've come across give the distance
 between two known points.  I need to find the closest object  first (e.g.,
 which house or river is closest -- hard to do) and then determine the
 distance (easy to do).

 Is there some way to avoid an exhaustive search?  I need to make tens of
 thousands of these calculations, each one selecting the nearest of up to
 hundreds of similar objects.  In addition, each linear and area object are
 defined by two or more points.  I assume I'll need to determine which
point
 within each of these objects is closest to the known (x, y) point.

 Thanks for any help you can provide and Happy New Year!

 [EMAIL PROTECTED]
 --
 To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
 "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



Re: MI Looking for Nearest Object Distance Functions

2000-01-01 Thread Graham O'Brien

Stephen:
I had a similar problem - I needed to find the distance from a number of
given points to their nearest contour line of a given height. This was
before I found this list, so I solved it in a typical O'Brien brute-force
manner, using a kind of binary chop algorithm:

For each point I created a buffer (with 32 sides as a compromise between
size and circularity) and checked for intersection with the line. If no
intersection, I doubled the buffer radius and tried again.

Once intersection had been achieved I used the usual binary chop method to
successively change the radius by halving increments (adding if no
intersection, subtracting if intersection) until the increment size was
within the tolerable error (I used 0.1 metre).

It worked, but is NOT elegant, and I'll send a .mb file should you so wish.
But I DO hope that someone has a better answer - when applied to a grid of
2,000,000 points it took several weeks of overnight runs (on a P166) to
complete!

Would I do it that way again? No, I'd post on this list and hope!

- Original Message -
From: Stephen R. Riese [EMAIL PROTECTED]
To: MapInfo [EMAIL PROTECTED]
Sent: Friday, December 31, 1999 9:01 PM
Subject: MI Looking for Nearest Object Distance Functions



 Greetings,

 I'm new to MapInfo/MapBasic and this list server.  I'm looking for a
 function that will return the distance from a given point to the nearest
 object of a certain type.  For example, from point (x, y) to the nearest
 house (point object), road or river (linear object) or nearest forrest
 (area object).  All of the functions I've come across give the distance
 between two known points.  I need to find the closest object  first (e.g.,
 which house or river is closest -- hard to do) and then determine the
 distance (easy to do).

 Is there some way to avoid an exhaustive search?  I need to make tens of
 thousands of these calculations, each one selecting the nearest of up to
 hundreds of similar objects.  In addition, each linear and area object are
 defined by two or more points.  I assume I'll need to determine which
point
 within each of these objects is closest to the known (x, y) point.

 Thanks for any help you can provide and Happy New Year!

 [EMAIL PROTECTED]
 --
 To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
 "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]