William "Woody" Woodruff
Zoning Administrator
Charter Township of Union, Isabella County, Michigan
2010 S Lincoln Rd, Mt. Pleasant, MI  48858
(989) 772 4600 EXT 41
Visit our web site at http://www.geocities.com/ctuzoning/index.htm


-----Original Message-----
From: Woody Woodruff [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 02:06
To: Leighton Tong
Subject: RE: MI-L Automatic Distance Calculation between a group of
selected points in MI


Provided you don't need an array of all possible combinations, it can be
done several ways.  Try using a query with the Functions Distance() and
CentroidX,Y into a derived column. See on line help under SQL Select/
Derived Col, and Functions/Geographic operators- Distance and CentroidX. SQL
between the ******** maybe modified and placed in the MapBasic Window.  For
this example, MyTable only contains an ID field which correlates to site
number.

Derived Col syntax is an expression, followed by an alias (if desired) in
dbl quotes. Multiple cols maybe used separated by Commas, these go in the
>From Columns Sections of the SQL builder,  Such as

Distance( num_x , num_y , num_x2 , num_y2 , str ) "Distance_from_Site_ 1",
COl1, COL2.


Distance Syntax
Distance( num_x , num_y , num_x2 , num_y2 , str )
Returns the distance between two locations. The first two parameters specify
the x and y value of the start location; the next two parameters specify the
x and y value of the end location; the str parameter is a distance unit
name, such as "mi" or "km".

Replace num_x and y with Long and Lat of Site1, use functions Centroidx and
Centroidy for the num_x2 and y2

*************************
Select ID, Distance(-0.68937,0.337331,CentroidX(obj),CentroidY(obj),"km")
"Distance from Site 1" from MyTable into Distances_to_Site1
*************************
Where the first 2 figures are the known Long (X) and Lat (Y) of site 1,
available through using the cursor location in status bar, or (better) using
an update query to derive the Long and Lat of Site 1, such as

*************************
Select CentroidX(obj),CentroidY(obj) from MyTable where ID="1" into
Selection
Browse * From Selection
*************************

Other solutions could involve adding Lat and Log columns to your site table
and use the col names instead of the Centroid Function for numx2 and numy2.

William "Woody" Woodruff
Zoning Administrator
Charter Township of Union, Isabella County, Michigan
2010 S Lincoln Rd, Mt. Pleasant, MI  48858
(989) 772 4600 EXT 41
Visit our web site at http://www.geocities.com/ctuzoning/index.htm


-----Original Message-----
From: Leighton Tong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 20:19
To: [EMAIL PROTECTED]
Subject: MI-L Automatic Distance Calculation between a group of selected
points in MI


I am looking for either direction, help or MBX application that will
automatically provide me with a distance calculation between selected
points.

I am using MapInfo Pro 6.0 and would like to be able to select a group of
points that are geocoded and have MI look up the longitude/latitude of each
point, and calculate the distance between all of the selected points.

I.e. Site 1 to Site 2 is x miles
      Site 1 to Site 3 is y miles
      Site 1 to Site 20 is z miles
      So on and so forth...

Is there an application, plug-in or query that will allow me to do this?  If
this is possible, I would then be able to use the output in another
(unrelated to MI) application and save a lot of manual work.  After all,
isn't that the reason why we use these tools? :0)

Thanks!

Leighton Tong
RF Engineer
UbiquiTel PCS - Central Valley
A Sprint PCS Network Partner
559-307-1310


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8080




---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8099

Reply via email to