Description Usage Arguments Value See Also Examples
Takes a data-Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. Uses the Haversine formula to account for global curvature.
1 | lawn_destination(start, distance, bearing, units, lint = FALSE)
|
start |
Starting point, a data-Feature<data-Point> |
distance |
Distance from the starting point. |
bearing |
Ranging from -180 to 180. |
units |
Miles, kilometers, degrees, or radians. |
lint |
(logical) Lint or not. Uses geojsonhint. Takes up increasing
time as the object to get linted increases in size, so probably use by
default for small objects, but not for large if you know they are good
geojson objects. Default: |
the calculated destination, a data-Feature<data-Point>
Other measurements:
lawn_along()
,
lawn_area()
,
lawn_bbox_polygon()
,
lawn_bbox()
,
lawn_bearing()
,
lawn_center_of_mass()
,
lawn_center()
,
lawn_centroid()
,
lawn_distance()
,
lawn_envelope()
,
lawn_extent()
,
lawn_line_distance()
,
lawn_midpoint()
,
lawn_point_on_feature()
,
lawn_pt2line_distance()
,
lawn_square()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | pt <- '{
"type": "Feature",
"properties": {
"marker-color": "#0f0"
},
"geometry": {
"type": "Point",
"coordinates": [-75.343, 39.984]
}
}'
lawn_destination(pt, 50, 90, "miles")
lawn_destination(pt, 100, 90, "miles")
lawn_destination(pt, 2, 45, "kilometers")
lawn_destination(pt, 2, 30, "degrees")
## Not run:
pt %>% view
lawn_destination(pt, 200, 90, "miles") %>% view
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.