ropensci / geojsonio

Convert many data formats to & from GeoJSON & TopoJSON
https://docs.ropensci.org/geojsonio
Other
150 stars 59 forks source link

Fix `geojson_read` for reading GeoJSON #136

Closed sckott closed 5 years ago

sckott commented 6 years ago

related to #130

sckott commented 5 years ago

update like geojson_sp did to use sf instead of rgdal

sckott commented 5 years ago

switching to sf from rgdal:

file <- system.file("examples", "california.geojson", package = "geojsonio")
microbenchmark::microbenchmark(
    rgdal = geojson_read_old(file, what = "sp"),
    sf = geojson_read(file, what = "sp"),
    times = 10
)
Unit: milliseconds
  expr       min         lq       mean     median         uq        max neval
 rgdal 255.76413 260.923712 276.812834 283.633072 284.710731 295.775478    10
    sf   5.56713   5.740746   6.458596   6.108526   6.492157   9.328748    10

microbenchmark::microbenchmark(
    rgdal = geojson_read_old(file, what = "list"),
    sf = geojson_read(file, what = "list"),
    times = 10
)
Unit: milliseconds
  expr       min        lq      mean    median        uq       max neval
 rgdal 158.28394 201.29649 456.66645 271.69931 817.77753 904.46834    10
    sf  21.62445  22.07043  25.21725  25.59184  26.97784  29.95318    10
github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.