.NET

## .NET

Member
Posts: 5
Registered: ‎11-24-2013
Message 1 of 3 (213 Views)

# Reinventing the wheel, or how to found the closest vertex of polyline?

213 Views, 2 Replies
12-04-2013 08:59 PM
I have a point on polyline (not vertex!) as Point3D, and I need to find closest vertex of polyline.

In other words, I put a points on the polyline, and they should not be located closer than 50 meter vertices of the polyline. For this I need to find closest vertex to point.

Previously sorry for my wrong English )

Hi,

If the input point is on the polyline, you can get its parameter (double).

Parameters of polylines are integer on vertices, so it's easy to get the closest vertex.

```Point3d closestVertex =
pline.GetPointAtParam(Math.Round(pline.GetParamAtPoint(inputPoint)));```

*Expert Elite*
Posts: 2,115
Registered: ‎04-29-2006
Message 2 of 3 (203 Views)

# Re : Reinventing the wheel, or how to found the closest vertex of polyline?

12-04-2013 10:06 PM in reply to: DeZert

Hi,

If the input point is on the polyline, you can get its parameter (double).

Parameters of polylines are integer on vertices, so it's easy to get the closest vertex.

```Point3d closestVertex =
pline.GetPointAtParam(Math.Round(pline.GetParamAtPoint(inputPoint)));```

Gilles Chanteau
Member
Posts: 5
Registered: ‎11-24-2013
Message 3 of 3 (181 Views)

# Re : Reinventing the wheel, or how to found the closest vertex of polyline?

12-05-2013 02:25 AM in reply to: _gile
Very thanks!
Post to the Community