googlePolylines
googlePolylines copied to clipboard
header-only
restructure everything
TODO
- [ ] use
sfheadersto go to & fromsfobjects. - [ ] wait until Rcpp 1.0.4.6 is on CRAN - https://github.com/r-lib/fs/issues/256
Progress
library(microbenchmark)
microbenchmark(
r = { googlePolylines:::geometryRow.sfencoded( e, "POLYGON", multi = T) },
rcpp = { googlePolylines:::rcpp_get_geometry_types( e$geometry, "MULTIPOLYGON") },
rcpp_mult = { googlePolylines:::rcpp_get_geometry_types_multi( e$geometry, "POLYGON", "MULTIPOLYGON") }
)
# Unit: microseconds
# expr min lq mean median uq max neval
# r 482.355 493.4985 603.21041 505.5890 555.5125 2831.437 100
# rcpp 44.740 46.9655 65.92212 49.3310 57.4835 487.616 100
# rcpp_mult 46.289 48.6280 59.73938 51.6655 57.9990 304.934 100
This branch is currently slower than the master implementation for MULTIPOLYGONs. Other geometries seem fine.