Description
Returns the point geometry that represents the closest point of the destination geometry to the input geometry.
Syntax
MI_ClosestPoint (geometry1, geometry2)
Arguments
geometry1 is the given input geometry
geometry2 is the destination geometry that the closest point will be calculated from
Example
Returns the closest point on the box to the given point
MI_ClosestPoint(MI_POINT(-86.0, 32.0,'epsg:4326'), MI_BOX(-79.376,43.648,-79.383,43.663,'epsg:4326'))
returns a point geometry MI_POINT(-79.383,43.64800000000001,'epsg:4326')Remarks
If the closest point geometry cannot be calculated, NULL is returned.
Note: When the geometry1 is within the geometry2, the first point (vertices) of the geometry1 is returned.