On Sun, 08 Feb 2004 12:54:16 -0500, Joan Furman <[EMAIL PROTECTED]> wrote:

Hello Joan,

Thanks for the tip. I also am trying to measure distance between centroids.
I have tried several syntax commands, that are "correct, but don't produce
results.


Here is a summary of my efforts if someone can help.

Try following steps:


1. Create a point objects from centroids of "Home" and "Out" places --> table Home and Out
2. Add two columns into tables Home and Out --> ID and Joint integer
3. Fill column ID in Home and Out table with RowID (row order) and Join column with constant for instance 1
4. Run following SQL statement


Select Home.ID, Out.ID, Distance(CentroidX(Home.obj), CentroidY(Home.obj), CentroidX(Out.obj), CentroidY(Out.obj), "m") from Home, Out where Home.Join=Out.Join order by Home.ID, Out.ID into Selection


or download CalcDist PRO from www.terris.sk - it is a trial version limited with number of the objects (100 objects). This program calculates distance between objects automatially.


Hope this help.

Best regards
Stefan Majtan




Goal: I need to show the distance between each person's unique home address
and a specific unique addresses each person attends away from home (called
PL1)


Steps:
1) I geocoded and created centroids for two places 1) Home and Place1
respectively.
2) The geocoded and centroids for Home and Place1 were in separate tables,
so I queried them into one table (called Radom_hempstead_Home_PL1) by the
ID#s for each person from both tables.


3) I tried to run the following distance functions, but get no column with
the distance between the two places. I get a column of zeros. The centroids
between the HomeX, Home Y, Place1, Place1 are difference so the distance
should't be zero.


Here is the synax I used:
_______________________________________
select columns: *
From tables: Radom_hempstead_Home_PL1

Where condition is: distance ( XCoord_Home , YCoord_Home , XCoord_PL1, YCoord_PL1 , "ft")

into Table Named: selection
____________________________________________________________

I also tried "mi" which didn't work either.

Any suggestions






----- Original Message ----- From: "Woody Woodruff" <[EMAIL PROTECTED]> To: "Neil Evans" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 02, 2004 8:47 AM Subject: RE: MI-L FW: Measuring distance between two points.


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




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

__________ Informacia od NOD32 1.617 (20040206) __________

Tato sprava bola preverena antivirusovym systemom NOD32.
http://www.eset.sk





--


**************************************************************************
TERRIS
GIS Applications Development
Grid Analyser - raster GIS for native MapInfo grid

Pod záhradkami 24
909 01 Skalica
SLOVAKIA
http://www.terris.sk
**************************************************************************

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



Reply via email to