Top  Previous  Next

This locates the nearest location from P.


It returns this information:


Side of the link (-1: Left or +1: Right)


Coordinates of location on link


A typical use is converting large amounts of GPS coordinates into network locations. An example of performance is:

A street network with 200,000 links, latitude/longitude coordinates: 2000 calcs per sec (using an AMD A6-5400K)


Larger street networks makes it slightly slower, while using projected coordinates makes it faster.

Setting MaxVerticesPerCell at a lower value than default can also make it slightly faster.


Syntax: NearestLocation(P: TFloatPoint; var Loc: TLocation; var side: integer; var distance: double; var Pnew: TFloatPoint)


See also DistanceToLink, NearestLocationSimple and SkipLinks.