geo_midpoint: Midpoint

View source: R/midpoint.R

geo_midpointR Documentation

Midpoint

Description

Takes two Point's and returns a point midway between them. The midpoint is calculated geodesically, meaning the curvature of the earth is taken into account.

Usage

geo_midpoint(from, to)

Arguments

from

Feature<Point> first point

to

Feature<Point> second point

Value

Feature<Point> a point midway between from and to

Examples

pt1 <- '{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [144.834823, -37.771257]
  }
}'
pt2 <- '{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [145.14244, -37.830937]
  }
}'

geo_midpoint(pt1, pt2)

ropenscilabs/geoops documentation built on Nov. 8, 2024, 4:01 a.m.