r - 使用 geojson 文件干扰 R 地图
问题描述
我从这个链接下载了 GeoJSON 文件:https ://public.opendatasoft.com/explore/dataset/contours-iris/export/
我绘制它,但我有一个干涉多边形 interference_polygon_picture
但是在网站上,它显示了多边形并且没有这个多边形: https ://public.opendatasoft.com/explore/dataset/contours-iris/map/?q=gers&location=13,43.65999,0.5815&basemap=jawg .streets
我曾经尝试使用另一个网站的 shx 中的另一个文件进行映射,但我在同一个城镇附近遇到了同样的问题(Auch)
我怎样才能删除它?我的 R 代码有问题吗?
谢谢您的帮助
iris.poly2 <- readOGR(dsn="contours-iris.geojson", "OGRGeoJSON")
ggplot() +
geom_polygon(data=iris.poly2, aes(x=long, y=lat, group=id), color="grey", size=0.1) +
coord_map(xlim=c(0.4627843, 0.6773605),
ylim=c(43.58996 , 43.72575) )
解决方案
group=id
通过替换解决group=group
ggplot() +
geom_polygon(data=iris.poly2, aes(x=long, y=lat, group=group), color="grey", size=0.1) +
coord_map(xlim=c(0.4627843, 0.6773605),
ylim=c(43.58996 , 43.72575) )
group=id
在 3 个多边形之间创建了一个链接 => 干涉多边形
推荐阅读
- angular - mattlewis92/angular-calendar 的 Angular 日历不会在加载时启动我的数据
- ruby - Ruby 模板缩进问题 - puppet
- swiftui - 每次更改 @State 时防止重排/重绘
- typo3 - 如何防止 tx_news 插件为任意新闻记录呈现单一视图?
- java - 如何从 JPA 中的日期列表中查询?
- android - Android - 我们可以防止通过 ADB Shell 启动活动吗?
- c# - 打开多个 MS Project 文件时如何修复 RPC_E_CALL_REJECTED 错误?
- ios - 升级到 WKWebView Ionic 3 后 iOS 应用程序启动后出现白屏
- python-3.x - 为什么内置函数 id(constant) 在 Python 中获取值?
- regex - 如何使用 awk 找到一个模式,然后向下移动一定数量的行,然后打印?