Guess map scale based on the extent and the output window

guess_scale(extent, available_scales, factor = 1, outsize = NULL)

Arguments

extent

A dataframe containing xmin, xmax, ymin and ymax values

factor

Usually, the scale is overestimated and smaller scales are desired. This factor enables correction by dividing the calculated scale by the factor. (e.g. a factor = 2 returns a 1:25'000 scale when 1:50'000 has been calculated)

outsize

An integer vector of the dimensions of the output window size in cm. If left at NULL (default), the output window size is determined by dev.size("cm")

available_cales

An integer vector containing the available scales in the format x in 1:1'000x (e.g. 25 in 1:25'000).

Details

This function takes an extent object (with xmin, xmax, ymin and ymax values) as well as a set of available scales to determin the best suited scale. The extent object (xmin, xmax, ymin and ymax values) are expected in Meters while the available scales are expected to be the the x in 1:1'000x (e.g. 25 in 1:25'000).