paleolimbot/ggspatial

"Scale on map varies by more than 10%, scale bar may be inaccurate" with rnaturalearth world map

S-AQ opened this issue · 3 comments

S-AQ commented

Hi Dewey,

When I tried to add a scalebar to a world map of data from rnaturalearth, I got the following warning:
Scale on map varies by more than 10%, scale bar may be inaccurate.

library(ggspatial)
library(rnaturalearthdata)
world_countries <- ne_countries(returnclass = 'sf')

ggplot()+
  layer_spatial(world_countries)+
  annotation_scale(location = "tl")

Somehow the annotation_scale is not aware of the specifics of the world_countries object.
A similar problem occurred here, but that was never solved by anyone.
How can I get the right scale bar with this data?

image

oh,I met the same question. Dear friend,Did you solve the problem?

It's telling you that the scale bar does not necessarily apply in the same way to all areas of the map, which is true! You should probably not be putting a scale bar on a map with a scale that large (or you can accept that it is not accurate to do so and ignore the error message).