Issue
Im trying to visualize a large sf dataframe with around 1000 rows containing linestrings with mapview::mapview() in R. Unfortunately a warning comes up when I perform the command:
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'
And then I try to export as html and I get:
R code execution error
And the saved file is 0 kb. I would be grateful if there is a fix or a workaround with some other function from the package maybe ?
I posted this question on the gis stack exchange as well but I think it might be of help to post here as well.
Solution
Things that helped fix the error:
adding maxpoints argument:
mapview::mapview(data.frame, maxpoints = 1000000)
Seems this increased the previously set threshold for plotting maximum number of features.
- setting
selfcontained = FALSE
for exporting as.html
as proposed by TimSalabim
Answered By - adl
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.