Nearest Object

24 views
Skip to first unread message

Mr Mann

unread,
May 12, 2022, 1:47:10 PMMay 12
to MapInfo-L
Hi,
What i'm trying to achieve in MIPro via Mapbasic is to find the Nearest object of Table A to an object in table b, and pull out a column from each table into a new table, with the corresponding nearest record.

So my source tables are:
Table1 (Points)
PointName

Table 2 (Polygons)
PolygonName


I'd like to have
Results Table
PointName 1 | PolygonName 5
PointName 2 | PolygonName 1
etc
etc

Essentially, find the closes polygon for each point (they dont intersect or contain).

Using the Nearest function seems to not return columns of mismatching ID's from two datasets, unless I'm missing something? I'm trying to do this programmatically but cant figure out how to pull the two together. 

Any help appreciated.
Reply all
Reply to author
Forward
0 new messages