-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathbbox_scale.Rd
40 lines (39 loc) · 1.16 KB
/
bbox_scale.Rd
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
38
39
40
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geo-functions.R
\name{bbox_scale}
\alias{bbox_scale}
\title{Scale a bounding box}
\usage{
bbox_scale(bb, scale_factor)
}
\arguments{
\item{bb}{Bounding box object}
\item{scale_factor}{Numeric vector determining how much the bounding box will grow or shrink.
Two numbers refer to extending the bounding box in x and y dimensions, respectively.
If the value is 1, the output size will be the same as the input.}
}
\description{
Takes a bounding box as an input and outputs a bounding box of a different size, centred at the same point.
}
\examples{
bb <- matrix(c(-1.55, 53.80, -1.50, 53.83), nrow = 2)
bb1 <- bbox_scale(bb, scale_factor = 1.05)
bb2 <- bbox_scale(bb, scale_factor = c(2, 1.05))
bb3 <- bbox_scale(bb, 0.1)
plot(x = bb2[1, ], y = bb2[2, ])
points(bb1[1, ], bb1[2, ])
points(bb3[1, ], bb3[2, ])
points(bb[1, ], bb[2, ], col = "red")
}
\seealso{
Other geo:
\code{\link{bind_sf}()},
\code{\link{geo_bb}()},
\code{\link{geo_bb_matrix}()},
\code{\link{geo_buffer}()},
\code{\link{geo_length}()},
\code{\link{geo_projected}()},
\code{\link{geo_select_aeq}()},
\code{\link{quadrant}()}
}
\concept{geo}