
Last chance! 50% off unlimited learning
Sale ends in
Get the aspect ratio of a shape object, a tmap
object, or a bounding box
get_asp_ratio(x, is.projected = NA, width = 700, height = 700,
res = 100)
Logical that determined wether the coordinates of x
are projected (TRUE
) or longitude latitude coordinates (FALSE
). By deafult, it is determined by the coordinates of x
.
See details; only applicable if x
is a tmap
object.
See details; only applicable if x
is a tmap
object.
See details; only applicable if x
is a tmap
object.
aspect ratio
The arguments width
, height
, and res
are passed on to png
. If x
is a tmap object, a temporarily png image is created to calculate the aspect ratio of a tmap object. The default size of this image is 700 by 700 pixels at 100 dpi.
# NOT RUN {
if (require(tmap) && packageVersion("tmap") >= "2.0") {
data(World)
get_asp_ratio(World)
get_asp_ratio(bb(World))
tm <- qtm(World)
get_asp_ratio(tm)
get_asp_ratio("Germany") #note: bb("Germany") uses geocode_OSM("Germany")
}
# }
Run the code above in your browser using DataLab