r-从naturalearth裁剪和绘制地图中的矩形不再有效



以下代码:

library(rnaturalearth,rnaturalearthdata)
library("sf")
#load world map and crop the rectangle I want
blank2 <- ne_countries(scale = "large",type = 'countries', returnclass = "sf")
blank1 <- st_crop(blank2 , xmin = -22, xmax = 44, ymin = 30, ymax = 66)
# plot map
plot(st_geometry(blank1),col="gray85",lty=0)

直到几周前还在绘制一张矩形地图。现在,它绘制了一种圆柱形地图:不再是矩形的欧洲地图

就好像默认投影在某个阶段发生了变化,但我不知道在哪里,原则上一切都是WGS84。

情节功能改变了什么,或者sf包,或者naturalearth包?

我在windows机器上使用R 4.0.4和更新的软件包。

谢谢你的帮助!

问题的出现是因为sf包更改了其默认几何体。添加命令:sf_use_s2(FALSE(可以返回到其原始行为。

最新更新