【发布时间】:2018-08-30 05:11:52
【问题描述】:
我试图用 mapview::mapview() 在 R 中可视化一个包含大约 1000 行的 linestrings 的大型 sf 数据框 。不幸的是,当我执行命令时出现警告:
mapview(data.frame)
Warning message:
In leaflet_sfc(sf::st_geometry(x), map = map, zcol = zcol, color = clrs, :
the supplied feature layer has more points/vertices than the set threshold.
using special rendering function, hence things may not behave as expected from a standard leaflet map,
e.g. you will likely need to zoom in to popup-query features
to see the number of points/vertices of the layer use 'npts(x)'
to see the threshold for the feature type use 'mapview:::getMaxFeatures(x)'
to adjust the threshold use argument 'maxpoints'
然后我尝试导出为 html 并得到:
R代码执行错误
保存的文件为 0 kb。如果软件包中的某些其他功能有修复或解决方法,我将不胜感激?
我也在 gis stack exchange 上发布了这个问题,但我认为在这里发布也可能会有所帮助。
【问题讨论】:
-
免责声明:此处为 mapview 开发人员。此行为(以及随附的警告)旨在变得更智能,并切换到通常更适合显示大型特征的模式,否则可能会导致地图的响应速度变慢。诚然,拥有一个适用于所有情况下所有几何类型的通用阈值(例如,一个具有许多顶点的大多边形与许多简单多边形)很难,而且可能并不总是有效。我们实施的阈值是根据经验选择的。当传单更新到 1.3.1 时,这种行为将在不久的将来发生变化。
-
关于将地图保存为 html 的问题,请尝试设置
selfcontained = FALSE,这通常适用于较大的几何图形。 -
你的回答总是很感激蒂姆。谢谢
-
我一直很感激关于如何改进形状/几何复杂度计算的建议here
标签: r gis android-mapview sf