googlePolylines icon indicating copy to clipboard operation
googlePolylines copied to clipboard

header-only

Open SymbolixAU opened this issue 7 years ago • 2 comments

restructure everything

TODO

  • [ ] use sfheaders to go to & from sf objects.
  • [ ] wait until Rcpp 1.0.4.6 is on CRAN - https://github.com/r-lib/fs/issues/256

SymbolixAU avatar Sep 28 '18 03:09 SymbolixAU

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

SymbolixAU avatar Sep 29 '18 11:09 SymbolixAU

This branch is currently slower than the master implementation for MULTIPOLYGONs. Other geometries seem fine.

dcooley avatar Feb 09 '20 20:02 dcooley