Use this:
1. create "joint", and "RowID" columns in both tables 2. update column joint with constant value for instance "1" in both tables 3. update column RowID with row number in both tables
Then use SQL:
Select Table1.RowID, Table2.RowID, Distance(CentroidX(Table1.obj), CentroidY(Table1.obj), CentroidX(Table2.obj), CentroidY(Table2.obj), "m")
Where Table1.joint = Table2.joint Group By Table1.RowID, Table2.RowID Order By Table1.RowID, Table2.RowID Into TableDistance
Hope this help you. Stefan
--
************************************************************************** TERRIS GIS Applications Development Grid Analyser - raster GIS for native MapInfo grid
Pod záhradkami 24 909 01 Skalica SLOVAKIA http://www.terris.sk **************************************************************************
On Fri, 19 Dec 2003 15:40:46 -0000, Nick Hall <[EMAIL PROTECTED]> wrote:
Does anyone know how to or have a handy MBX that lets users calculate straight line distances between two sets of points easily.
I know they could use Pythagoras etc and I know they could use the MapInfo
Distance function but neither of these methods are particularly user
friendly! Ideally I am interested in anything that produces a result of :
Table A Row 1 to Table B row 1 is 6 KM Table A Row 2 to Table B row 1 is 5 KM Table A Row 3 to Table B row 1 is 4 KM Table A Row 1 to Table B row 2 is 5 KM Table A Row 2 to Table B row 2 is 6 KM Table A Row 3 to Table B row 2 is 3 KM etc
Any help welcome :)
Regards,
Nick
Salford GIS Ltd
***** SPECIALISTS IN PUBLIC SECTOR GIS CONSULTANCY AND TRAINING *****
Technology House Lissadel Street Salford M6 6AP
Tel: 0161 278 2442 Fax: 0161 278 2441
Mobile: 07855 250360 email: [EMAIL PROTECTED] web: www.salford-gis.co.uk
If you are affected by the Ordnance Survey PAI Programme you may wish to look at our new website www.pain-relief.co.uk
__________ Informacia od NOD32 1.582 (20031218) __________
Tato sprava bola preverena antivirusovym systemom NOD32. http://www.eset.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: 9670
