Description Usage Arguments Value Examples
View source: R/transform_translate.R
Moves any geojson Feature or Geometry of a specified distance along a Rhumb Line on the provided direction angle.
1 2 3 4 5 6 7 8 9 | lawn_transform_translate(
x,
distance,
direction,
units = "kilometers",
zTranslation = 0,
mutate = FALSE,
lint = FALSE
)
|
x |
a feature |
distance |
(integer/numeric) length of the motion; negative values determine motion in opposite direction |
direction |
(integer/numeric) of the motion; angle from North in decimal degrees, positive clockwise |
units |
(character) in which distance will be express; miles, kilometers, degrees, or radians (optional, default kilometers) |
zTranslation |
(integer/numeric) length of the vertical motion, same unit of distance (optional, default 0) |
mutate |
(logical) allows GeoJSON input to be mutated (significant
performance increase if true) (optional). Default: |
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: |
a changed data-Feature
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | x <- '{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[ 0, 29 ], [ 3.5, 29 ], [ 2.5, 32 ], [ 0, 29 ]
]
]
}
}'
lawn_transform_translate(x, distance = 100, direction = 35)
lawn_transform_translate(x, distance = 100, direction = 24)
lawn_transform_translate(x, distance = 100, direction = 24, mutate = TRUE)
## Not run:
view(lawn_featurecollection(x))
view(lawn_featurecollection(
lawn_transform_translate(x, distance = 130, direction = 35,
units = "kilometers")
))
view(lawn_featurecollection(
lawn_transform_translate(x, distance = 130, direction = -35,
units = "kilometers")
))
view(lawn_featurecollection(
lawn_transform_translate(x, distance = 130, direction = 35,
units = "kilometers", zTranslation = 10)
))
view(lawn_featurecollection(
lawn_transform_translate(x, distance = 130, direction = 35,
units = "kilometers", mutate = TRUE)
))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.