added utility to find nearest point on polyline for a set of points