## FindNearestPointAndLoc

**Syntax**

bool FindNearestPointAndLoc(ref MapWinGIS.Point testPoint, ref MapWinGIS.Shape shape, ref MapWinGIS.Point resultPoint, ref int ptLocation, ref System.Double ptDistance)

**Summary**

Finds where the test point is closest to on a line or polygon
shape and

returns the corresonding point and location and distance.

**Parameters**

testPoint |
The point to be checked for. |

shape |
The shape to find the nearest point on. |

resultPoint |
The resulting point that lies on the shape. |

ptLocation |
The location of where the result point should be on the shape. |

ptDistance |
The distance from the test point to the closest point. |

**Returns**

False if an error was encountered, true otherwise.

Visual Basic Net 2005 Example
Implementation Code

Visual C# 2005 Example Implementation
Code

Back to
Utils