devtools::load_all() library(data.table) library(sp) xydt <- fread("~/Box Sync/Projects/2015_stem_hwf/code/quadtrees/erd_columns_for_stixelation.csv") xysub <- xydt[xydt$LATITUDE < 42.62 & xydt$LATITUDE > 42.28 & xydt$LONGITUDE < -76.26 & xydt$LONGITUDE > -76.69 & xydt$DAY < 30, ] # sinusoidal #buffer <- 1000000 #max_points_per_bin <- 10000 #max_bin_area <- 3999999 # latlng #buffer <- 0.01 #max_points_per_bin <- 1000 #max_bin_area <- 0.00000014 xysp <- SpatialPointsDataFrame(xysub[, c("LONGITUDE", "LATITUDE")], xysub, proj4string=CRS("+init=epsg:4326")) mollweide <- CRS("+proj=moll +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84") xyspprj <- spTransform(xysp, mollweide) #runif(n = 1, min = -180, max = 180) r <- -91 system.time(qt <- quadtree(xyspprj, buffer = 5000, max_points_per_bin = 2500, max_bin_area = 3999999 * 1000000, rotation = r)) qt <- quadtree(xyspprj, buffer = 5000, max_points_per_bin = 2500, max_bin_area = 3999999 * 1000000, rotation = r) xyspprj@data$qtid <- over(xyspprj, qt, fun = max)$ids qt@data$count <- count(xyspprj@data, vars = "qtid") sp::plot(qt, zcol="count", col=NA) # unparallel # 25.98 # parallel, 6 cores # 11.58 # parallel, 6 cores, smarter bin checking # 4.454
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.