Get the aspect ratio of a shape object, a tmap
object, or a bounding box
Arguments
- x
A shape from class
sf
,stars
,sp
, orRaster
, a bounding box (that can be coerced bybb
), or atmap
object.- is.projected
Logical that determined wether the coordinates of
x
are projected (TRUE
) or longitude latitude coordinates (FALSE
). By deafult, it is determined by the coordinates ofx
.- width
See details; only applicable if
x
is atmap
object.- height
See details; only applicable if
x
is atmap
object.- res
See details; only applicable if
x
is atmap
object.
Details
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.