Closed SymbolixAU closed 5 years ago
if geometry.geometry.coordinates === undefined
, returning [null, null]
actually renders a point at [0, 0]
. I don't like this.
benchmarking defaults
library(sf)
library(geojsonsf)
sf <- geojson_sf("https://symbolixau.github.io/data/geojson/SA2_2016_VIC.json")
sf <- rbind(sf, sf, sf, sf, sf, sf)
sf <- rbind(sf, sf, sf, sf, sf, sf)
nrow( sf )
library(microbenchmark)
microbenchmark(
defaults = {
m <- mapdeck() %>%
add_polygon(
data = sf
, fill_colour = "SA2_NAME16"
, stroke_colour = "SA2_NAME16"
, elevation = "AREASQKM16"
, with_defaults = TRUE
)
},
no_defaults = {
m <- mapdeck() %>%
add_polygon(
data = sf
, fill_colour = "SA2_NAME16"
, stroke_colour = "SA2_NAME16"
, elevation = "AREASQKM16"
, with_defaults = FALSE
)
},
times = 5
)
# Unit: seconds
# expr min lq mean median uq max neval
# defaults 13.12390 13.68061 13.66652 13.68431 13.71192 14.13188 5
# no_defaults 13.15613 13.65578 13.64815 13.68355 13.83006 13.91527 5
no real benefit...
If you want rando comments, I notice is the update_view
focus only works if the sf is in longlat/4326, so there's an assumption about the bounding box - being used directly I supposed, so it always exceeds the world. for a projection (It's not a trivial thing to determine, in general - though small extents will generally be straightforward)
yeah I probably need to make it explicitly clear in the docs all coords need to be in 4326
Ah yes,I slowly realized what was actually wrong at a deeper level 😀
Various updates I've noted while implementing
spatialwidget
TODO
origin = c("origin_geometry")
- when in c++ it's recognised asNot compatible with STRSXP: [type=language].
elevation
argument on thesf
object, OR use theZ
attributelng
/lat
don't plot anything.add_grid()
- maybe it is due to my Mac not being able to show WebGL...?add_screengrid()
require the weights column? - it's optional, so i've added a default.updateTooltip
is showing an error in js console and tooltip no longer works (on some layers - polygon works)NOTES to document
sfencoded
not supported, nor are data.frames with two polyline columns.