Distance()function help: 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".
I use teh mnomoc Latty Fatty Y to rember which is which Without writing an mbx, you will need lat and long (y and x) columns for the objects, use update with centroid(x) and agian for centroid(y). Depending on what 2 items you want to generte diatnces for, there are different stratigies. If its distance to a set of objects from one object (One store to many customers) use the actuall lat and long in the first part of the distance function and the fields Lattitude and Longitude for set of points in a calculated query. I used teh Customer ID and the fields LAT and LONG for each customer location, and the known position of the store (-84.82, 45.59) See below. the "Distance_To_Store" part is an alias to label the column with, other wise the formula will be the Column heading. some mapbasic text to show the steps Alter Table "My_table" ( add Latitude Decimal(13,8) ) Alter Table "My_table" ( add Longitude Decimal(13,8) ) Update My_table Set Latitude = Centroid(y) Update My_table Set Longitude = Centroid(x) Select ID, Distance(-84.82, 43.59,LONG,LAT,"mi") "Distance _To_Store" from My_table into Selection This generates a list of Customer IDs and the distance to the store from each customer Lat and Long. William "Woody" Woodruff Zoning Administrator Charter Township of Union, Isabella County, Michigan -84.80947000 43.61095100 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: Neil Evans [mailto:[EMAIL PROTECTED] Sent: February 03, 2004 07:15 To: [EMAIL PROTECTED] Subject: MI-L FW: Measuring distance between two points. Simple peace, how do you measure distance between two points. Someone remind me what to do again. Thanks for very much for your help Neil --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 10228