Top  Previous  Next

This method finds the N nearest elements in LL2 for every element in LL1.


Typically LL1 has many elements, such as single addresses.

LL2 has much less elements, typically some centers (schools etc).


Routes are calculated from center to address for optimized speed of calculations. If you want the other direction, call SwapOneWay before and after calling the function.


If maxcost is set, it is used as cutoff and less than N elements may be found.


if N=0, then all elements are returned.


SL1 and SL2 can be nil or contain text identifiers for the output.


Dist, time and cost can be set to false/true to determine which fields should be included in the output.

Set routeobject = true, if you want the route to be part of the output (slows down calculations).


Output is a GIS file with one or more of these fields:



Syntax: NearestNDyn(filename: string; GF: TGISformat; LL1, LL2: TLocationList; N: integer; SL1, SL2: TStringList; dist, time, cost, directdist, routeobject: boolean)