【发布时间】:2020-06-11 15:20:52
【问题描述】:
我有一个带有正方形坐标的 csv 数据框。我已将 csv 转换为 shapefile,但它绘制为四个单独的点,我希望该图显示一个正方形。
Shape long lat
1 1.1 43 10
2 1.1 43 13
3 1.1 40 13
4 1.1 40 10
我已经将它转换成一个shapefile,并给它一个坐标参考系统,如下所示:
test <- as.data.frame(read_csv("/Users/alan/Desktop/Test.csv"))
Coord_Ref <- st_crs(3035)
plot_locations_test <- st_as_sf(test, coords = c("long", "lat"), crs =Coord_Ref)
然后我可以使用 ggplot 绘制 shapefile
ggplot() +geom_sf(data = plot_locations_test)
我怎样才能使它成为一个填充的正方形而不是单独的点?
【问题讨论】: