Marc,

You're the greatest. It worked outstanding. Seems to me there are still wizards
on this earth.

Many thanks, Patrick

Marc Pelosse wrote:

> OK, I see.
>
> I don't think you have to do it in the Mapbasic window. It can be done
> trough
> SQL. If you need to calculate the distance between all pairs of points
> contained
> in a single table, here's what you could do:
>
> 1-Create a copy of your table: File-Save Table as...
>
> 2-Open it
>
> 3-Add an interger field (lets call it dummy) to each table and populate them
> with the value 1
>
> 4-Create SQL statment as follow:
>
> SELECT: MyTable.ID, MyTable_Copy.ID, Distance(CentroidX(MyTable.obj),
> CentroidY(MyTable.obj), CentroidX(MyTable_copy.obj),
> CentroidY(MyTable_copy.obj), "km"))
>
> FROM TABLE: MyTable, MyTable_copy
>
> WHERE: MyTable.dummy = MyTable_copy.dummy
>
> GROUP BY:
>
> INTO TABLE:  Distance_Table
>
> Hope this is what your lokking for,
>
> Marc
>
> > -----Message d'origine-----
> > De:   Patrick van der Deijl [SMTP:[EMAIL PROTECTED]]
> > Date: 8 d�cembre, 1999 09:05
> > �:    Thake, Peter; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Objet:        Re: Distance calculation
> >
> > Pete/Marc (and all other listers),
> >
> > Thanks for your reply. I was aware of the rulertool, but I like to have
> > the distance in a table or textfile.
> > I know there is a distance function in MapInfo but I don't know how to use
> > it.
> > The MapInfo help says:
> >
> >       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".
> >
> >
> > How can I put this in the mapBasic window? Or should I calculate it
> > otherwise?
> > As long as I can get the distances in writing
> >
> > Thanks, Patrick
> >
> > "Thake, Peter" wrote:
> >
> >       Patrick,
> >
> >       There is a ruler tool in Mapinfo that gives simple distance
> > measurements,
> >       otherwise I guess you will need some MapBasic code. The ruler tool
> > is on the
> >       Main toolbar.
> >
> >       regards,
> >
> >       Pete, Ordnance Survey, UK
> >
> >       -----Original Message-----
> >       From: Patrick van der Deijl [ <mailto:[EMAIL PROTECTED]>]
> >       Sent: 08 December 1999 11:52
> >       To: [EMAIL PROTECTED]
> >       Subject: MI: Distance calculation
> >
> >       Hi all.
> >
> >       Maybe a small, easy problem: How can I calculate, in MapInfo, the
> >       distance between two points? Do I have to do something special with
> >       the projection?
> >       I'm completely lost here.
> >
> >       Thank you very much in advance
> >
> >       Patrick van der Deijl
> >
> >       --
> >       Geodan IT bv
> >       Jan Luijkenstraat 10
> >       1071 CM  Amsterdam
> >       The Netherlands
> >       Tel. +31 (0)20-5707300
> >       Fax. +31 (0)20-5707333
> >
> >       Also visit our website: www.geodan.nl
> >
> > --
> > Geodan IT bv
> > Jan Luijkenstraat 10
> > 1071 CM  Amsterdam
> > The Netherlands
> > Tel. +31 (0)20-5707300
> > Fax. +31 (0)20-5707333
> >
> > Also visit our website: www.geodan.nl
> >  << Fichier: Card for Patrick van der Deijl>>

--
Geodan IT bv
Jan Luijkenstraat 10
1071 CM  Amsterdam
The Netherlands
Tel. +31 (0)20-5707300
Fax. +31 (0)20-5707333

Also visit our website: www.geodan.nl

begin:vcard 
n:Van der Deijl;Patrick
tel;fax:+31-(0)20-570 73 33
tel;work:+31-(0)20-570 73 29
x-mozilla-html:FALSE
org:Geodan IT b.v.
adr:;;Jan Luijkenstraat 10;Amsterdam;;1071 CM  ;The Netherlands
version:2.1
email;internet:[EMAIL PROTECTED]
title:drs.
x-mozilla-cpt:;19296
fn:Patrick Van der Deijl
end:vcard

Reply via email to