Coordinate2Node

Top  Previous  Next

Function Coordinate2Node(const XLongV,YLatV: double; var node: integer; var dist: double): integer;

 

Finds the nearest node based on a set of coordinates. Returns node number and air distance in node and dist. This function replaces FindNode and FindNodeFast.

 

You will get error -30 if you supply a set of lat/long values not within valid range, i.e. -180..180 and -90..90.

 

There is quite some calculation work involved in this function, so you should consider to cache the results (store the node numbers in an array/database), if the same coordinates are otherwise supplied over and over. This can have a significant impact on total calculation time.

 

Typical errors when using this function is using (0,0) as input or swapping coordinates. Both will slow down the calculations and return wrong results.

 

Possible error codes: -10 -30 -40 -44 -62

ActiveX / VCL / CLX component: RWnetBase