Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve computation speed view mode (many dots) #956

Open
mtennekes opened this issue Nov 6, 2024 · 0 comments
Open

improve computation speed view mode (many dots) #956

mtennekes opened this issue Nov 6, 2024 · 0 comments

Comments

@mtennekes
Copy link
Member

mtennekes commented Nov 6, 2024

library(leaflet)
library(leafgl)
library(sf)

n = 1e6

df1 = data.frame(id = 1:n,
				 x = rnorm(n, 10, 3),
				 y = rnorm(n, 49, 1.8))

pts = st_as_sf(df1, coords = c("x", "y"), crs = 4326)

options(viewer = NULL) # view in browser

leaflet() %>%
	addProviderTiles(provider = providers$CartoDB.DarkMatter) %>%
	addGlPoints(data = pts, group = "pts") %>%
	setView(lng = 10.5, lat = 49.5, zoom = 6)

About 7 seconds before browser window is opened.

tmap_devel_mode()
tm_shape(pts) +
	tm_dots()

About 30 seconds....

mtennekes added a commit that referenced this issue Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants