I have two geometries - a polyline and a polygon - and I want to find the two points (one on polyline and one on the polygon) that are the nearest.

According to documentation IProximityOperator has some methods that do return distance between two geometries, but there is no way to get the actual point, unless I am missing something. The only way seems to be query both point collections against the other geometry and then pick the resulting pair with smallest distance using QueryNearestPoint method. Isn't there a better way of doing it?

Cheers

If I have understood you correctly you have a polyline and want to find a point along it's length that is the closest point to a polygon and get the corresponding location on the polygon?

The IProximityOperator Interface has a method called

ReturnNearestPointthat will return the actual point on the geometry from a point.The IPolyline has a useful method

QueryPointAndDistance, it may help?One problem I can think of when iterating through the point collection of a polyline is that the nearest location along the polyline to your polygon may not be a vertex but actually the edge of a segment within the polyline, totally depends on the shape of your polygon.

Duncan