Functions / Geometry Measurement Functions |

Returns the distance between two geometries using the computation type and distance units. Specifically, the distance between two closest points of the two geometries is determined. When a geometry is inside another geometry, the shortest distance between the two geometries is returned with a positive distance value.

MI_DistanceToEdge ( geom1, geom2, unit, calculationType )

`geom1` is an expression which returns a geometry, or a geometry construct

`geom2` is an expression which returns a geometry, or a geometry construct

`unit` is a linear unit specification, and

`calculationType` is a string that indicates whether to perform a Spherical or Cartesian calculation. The default is calculated based on the coordinate system of the first geometry.

Returns the distance to edge from the specified geometry to each country.

select MI_DistanceToEdge(MI_Box(-20,-20,20,20,'epsg:4326'),Obj,'mi','Spherical') as distanceToEdge from "/Samples/NamedTables/WorldTable" where country in ('Canada','Vietnam','Brazil','China','Japan')

Calculates the distance between two geometries. The value returned is a double and represents a value in the units specified by the `units` argument.

Valid values for `unit` are the following distance units:

Value | Description |
---|---|

mi | miles |

km | kilometers |

in | inches |

ft | feet |

yd | yards |

mm | millimeters |

cm | centimeters |

m | meters |

survey ft | US Survey feet |

nmi | nautical miles |

twip | twips |

pt | points |

pica | picas |

degree | degrees |

li | links |

ch | chains |

rd | rods |