nearest_point

Returns a geometry representing the nearest point(s) on a provided geometry from an originating point geometry.

Parameter 1 - an originating point.

Parameter 2 - a destination geometry (to search), either point, line, area, or complex whose nearest point(s) to parameter 1 are returned.

Parameter 3 (Optional) - a Boolean value, true to return an arbitrary single nearest point or false to return all nearest points as a complex geometry. The default value is false.

Returns: a geometry representing the closest point(s). (This will be complex if multiple points are equally close to the originating point).

If neither parameter is a geometry, an exception is thrown.