Title: RE: [MI-L] Nearest

Allan,

MapInfo/MapBasic 8.0 have a new feature that can do this calcualtion.

Nearest statement
Find the object in a table that is closest to a particular object. The result is a 2 point Polyline object representing the closest distance.

Syntax
Nearest [N | ALL] >From { Table fromtable | Variable fromvar }
        To totable Into intotable
        [Type { Spherical | Cartesian }]
        [Ignore [Contains] [Min min_value] [Max max_value] Units unitname]
        [Data clause]

This is the statement behind the improved DistanceCalculator in v8.0

HTH,
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Krisciunas, Allan

Sent: Wednesday, February 22, 2006 10:44 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Nearest

How does MapInfo determine nearest map features? I have 2 road network layers, almost identical but offset slightly. I'm trying to write a query to fill a column in road layer A with the distance to the nearest equivalent arc in layer B. How?

Or an even simpler question: how can I find the distance between nearest points in the same layer?

I've looked at the SQL query function : SphericalDistance( num_x , num_y , num_x2 , num_y2 , str ) -- I assume that could be the lat/long of the nearest point to the one whose column I am trying to insert the distance value. But other than physically double-clicking the nearest neighbour, and hand-copying its lat/long values into a 2nd column, I can't determine how to get MapInfo to automatically generate these values.

I realise that this is a type of network analysis; so does that mean that I have to $$buy$$ another MapInfo product so I can do this work??

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l
  • [MI-L] Nearest Krisciunas, Allan
    • RE: [MI-L] Nearest Peter Horsbøll Møller

Reply via email to