g_distance | R Documentation |
g_distance()
returns the distance between two geometries or -1
if an
error occurs. Returns the shortest distance between the two geometries.
The distance is expressed into the same unit as the coordinates of the
geometries.
g_distance(this_geom, other_geom)
this_geom |
Character. OGC WKT string for a simple feature geometry. |
other_geom |
Character. OGC WKT string for a simple feature geometry. |
Numeric. Distance or '-1' if an error occurs.
Geometry validity is not checked. In case you are unsure of the validity
of the input geometries, call g_is_valid()
before, otherwise the result
might be wrong.
g_distance("POINT (0 0)", "POINT (5 12)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.