【发布时间】:2020-04-07 02:05:51
【问题描述】:
我使用的数据如下:
mapa
>Simple feature collection with 19 features and 11 fields
>geometry type: MULTIPOLYGON
>dimension: XY
>bbox: xmin: -1004502 ymin: 3132137 xmax: 1126932 ymax: 4859240
>epsg (SRID): 25830
>proj4string: +proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m
>+no_defs
>First 10 features:
> Codigo Texto Texto_Alt CCAA Muertes Ciudad
>1 01 Andalucía Andalucía Andalucía 491 Sevilla
>2 02 Aragón Aragón Aragón 284 Zaragoza
>3 03 Asturias Asturias Asturias 86 Oviedo
>...
> Autonomía Superficie Habitantes Latitud Longitud geometry
>1 Andalucía 14035.73 703206 37.38 -6.00 MULTIPOLYGON (((280486.8 39...
>2 Aragón 17274.89 674317 41.66 -0.88 MULTIPOLYGON (((683851.1 47...
>3 Asturias 10602.40 224005 43.36 -5.84 MULTIPOLYGON (((271018.9 48...
>...
我很难理解为什么geom_point 中的轴会缩小并且没有在地图上绘制点。
mapa %>% ggplot() +
geom_sf(aes(fill = Superficie)) +
geom_point(aes(x = Longitud, y = Latitud ,size = Muertes),
color= "red", alpha = 1/2)
这绘制了以下内容:
其实红点如下:
我是sf 的新手,但我知道这与数据代码中指定的bbox 项目有关。
我已经证明 coord_sf() 可以减少绘图窗口,但问题仍然存在。如果我将 Latitud 和 Longitud 乘以 100000,我可以让点更接近,但点会扩大。
如何解决?
提前致谢。
【问题讨论】:
-
您的地图和点不在同一个投影中。你可以阅读它here
-
@IanCampbell 它来自一长串连接,我可以在必要时指定它,但我认为它会搞砸帖子