Skip to content

leaflet no longer imports sp and is more strict about tiles #952

@olivroy

Description

@olivroy

In #942, we converted the internal datasets from sp to sf objects. In #944, we removed sp from imports, moving it to Suggests. In #943, we removed raster and terra from imports. Meaning that leaflet only imports a single spatial package: sf.

Send PRs to affected packages.

Larger revdepcheck result output

broken <- revdepcheck::cloud_broken()
broken_results <- revdepcheck::cloud_results() |> Filter(f = \(x) x$package %in% broken)
logs <-
    lapply(broken_results, \(info) info$cmp$output |> paste0(collapse = "\n")) |> 
    as.list() |> 
    setNames(vapply(broken_results, \(info) info$package[[1]], character(1)))

ignore <-
    Map(names(logs), logs, f = \(name, log) {
        cat(paste0("## ", name, "\n\n"))
        cat("```r\n")
        cat(log)
        cat("\n```\n\n")
    })

AtlasMaker

checking installed package size ... NOTE
  installed size is  6.7Mb
  sub-directories of 1Mb or more:
    data   6.5Mb
checking data for non-ASCII characters ... WARNING
  Error loading dataset 'amphibians':
   Error in .requirePackage(package) : unable to find required package 'sp'
  
  Error loading dataset 'birds':
   Error in .requirePackage(package) : unable to find required package 'sp'
  
  Error loading dataset 'flowering_plants':
   Error in .requirePackage(package) : unable to find required package 'sp'
  
  Error loading dataset 'reptiles':
   Error in .requirePackage(package) : unable to find required package 'sp'
  
  The dataset(s) may use package(s) not declared in Depends/Imports.
checking installed package size ... NOTE
  installed size is  6.7Mb
  sub-directories of 1Mb or more:
    data   6.5Mb

leafgl

checking tests ... ERROR
  Runningtestthat.RRunning the tests intests/testthat.Rfailed.
Complete output:
  > library(testthat)
  > library(leafgl)
  > 
  > test_check("leafgl")
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 370 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-leafgl-addGlPolygons.R:26:3'): addGlPolygons works ─────────────
  Error in `asMethod(object)`: package sp required, please install it first
  Backtrace:1. └─methods::as(single_poly, "Spatial") at test-leafgl-addGlPolygons.R:26:3
   2.   └─sf (local) asMethod(object)
  ── Error ('test-leafgl-popup.R:507:3'): popup-lines-spatial ────────────────────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'sp'
  Backtrace:1. ├─base::suppressWarnings(sf::as_Spatial(storms)) at test-leafgl-popup.R:507:3
   2. │ └─base::withCallingHandlers(...)
   3. ├─sf::as_Spatial(storms)
   4. └─base::loadNamespace(x)
   5.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   6.     └─base (local) withOneRestart(expr, restarts[[1L]])
   7.       └─base (local) doWithOneRestart(return(expr), restart)
  ── Error ('test-leafgl-popup.R:721:3'): popup-polygon-spatial ──────────────────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'sp'
  Backtrace:1. ├─base::suppressWarnings(sf::as_Spatial(gadm)) at test-leafgl-popup.R:721:3
   2. │ └─base::withCallingHandlers(...)
   3. ├─sf::as_Spatial(gadm)
   4. └─base::loadNamespace(x)
   5.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   6.     └─base (local) withOneRestart(expr, restarts[[1L]])
   7.       └─base (local) doWithOneRestart(return(expr), restart)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 370 ]
  Error: Test failures
  Execution halted

leaflet.extras2

checking tests ... ERROR
  Runningtestthat.RRunning the tests intests/testthat.Rfailed.
Complete output:
  > library(testthat)
  > library(htmltools)
  > library(leaflet)
  > library(leaflet.extras2)
  > 
  > test_check("leaflet.extras2")
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 440 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-playback.R:355:3'): playback ───────────────────────────────────
  Error: unable to find an inherited method for function 'coordinates' for signature 'obj = "sf"'
  Backtrace:1. └─sp::coordinates(leaflet::atlStorms2005[1, ]) at test-playback.R:355:3
   2.   └─methods (local) `<fn>`(`<list>`, `<S4: standardGeneric>`, `<env>`)
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 440 ]
  Error: Test failures
  Execution halted

lingtypology

checking installed package size ... NOTE
  installed size is  7.7Mb
  sub-directories of 1Mb or more:
    data   6.5Mb
checking data for non-ASCII characters ... NOTE
  Note: found 60812 marked UTF-8 strings
checking tests ... ERROR
  Runningtestthat.RRunning the tests intests/testthat.Rfailed.
Complete output:
  > library(testthat)
  > library(lingtypology)
  Based on the Glottolog v. 5.2
  > 
  > test_check("lingtypology")
  [ FAIL 1 | WARN 0 | SKIP 34 | PASS 0 ]
  
  ══ Skipped tests (34) ══════════════════════════════════════════════════════════
  • On CRAN (34): 'test-abvd-feature.R:4:3', 'test-afbo-feature.R:5:3',
    'test-aff-lang.R:4:3', 'test-area-lang.R:7:3', 'test-bantu-feature.R:5:3',
    'test-country-lang.R:4:3', 'test-eurasianphonology-feature.R:5:3',
    'test-glottolog-database.R:5:3', 'test-glottolog-database.R:10:3',
    'test-gltc-iso.R:7:3', 'test-gltc-lang.R:7:3', 'test-grambank-feature.R:5:3',
    'test-iso-gltc.R:7:3', 'test-iso-lang.R:7:3', 'test-lang-aff.R:6:3',
    'test-lang-gltc.R:7:3', 'test-lang-iso.R:7:3', 'test-lat-lang.R:7:3',
    'test-level.lang.R:7:3', 'test-long-lang.R:7:3', 'test-mapfeature.R:8:3',
    'test-mapfeature.R:15:3', 'test-mapfeature.R:21:3', 'test-mapfeature.R:35:3',
    'test-mapfeature.R:83:3', 'test-mapfeature.R:93:3',
    'test-mapfeature.R:120:3', 'test-mapfeature.R:146:3',
    'test-sails-feature.R:5:3', 'test-soundcomparisons-feature.R:5:3',
    'test-subc-lang.R:4:3', 'test-url-lang.R:7:3', 'test-vanuatu-feature.R:5:3',
    'test-wals-feature.R:5:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-mapfeature.R:161:1'): (code run outside of `test_that()`) ──────
  Error in `leaflet::addProviderTiles(leaflet::addTiles(m, tile[1]), tile[1], 
      group = tile.name[1], options = leaflet::providerTileOptions(opacity = tile.opacity))`: Unknown tile provider 'OpenStreetMap.BlackAndWhite'; either use a known provider or pass `check = FALSE` to `addProviderTiles()`
  Backtrace:1. └─lingtypology::map.feature(...) at test-mapfeature.R:161:1
   2.   └─leaflet::addProviderTiles(...)
  
  [ FAIL 1 | WARN 0 | SKIP 34 | PASS 0 ]
  Error: Test failures
  Execution halted
checking installed package size ... NOTE
  installed size is  7.7Mb
  sub-directories of 1Mb or more:
    data   6.5Mb
checking data for non-ASCII characters ... NOTE
  Note: found 60812 marked UTF-8 strings

mapview

checking data for non-ASCII characters ... NOTE
  Note: found 1 marked UTF-8 string
checking tests ... ERROR
  Runningtinytest.RRunning the tests intests/tinytest.Rfailed.
Complete output:
  > if (requireNamespace("tinytest", quietly=TRUE)) {
  +   tinytest::test_package("mapview")
  + }
  
  test-color.R..................    0 tests    
  test-color.R..................    1 tests OK 
  test-color.R..................    2 tests OK 
  test-color.R..................    3 tests OK 
  test-color.R..................    4 tests OK 
  test-color.R..................    5 tests OK 
  test-color.R..................    6 tests OK 53ms
  Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
  
  test-mapview.R................    0 tests    
  test-mapview.R................    0 tests    
  test-mapview.R................    0 tests    
  test-mapview.R................    1 tests OK 
  test-mapview.R................    2 tests OK 
  test-mapview.R................    3 tests OK 
  test-mapview.R................    4 tests OK 
  test-mapview.R................    4 tests OK 
  test-mapview.R................    5 tests OK 
  test-mapview.R................    6 tests OK 
  test-mapview.R................    7 tests OK 
  test-mapview.R................    8 tests OK 
  test-mapview.R................    8 tests OK 
  test-mapview.R................    8 tests OK 
  test-mapview.R................    9 tests OK 
  test-mapview.R................   10 tests OK 
  test-mapview.R................   11 tests OK 
  test-mapview.R................   12 tests OK 
  test-mapview.R................   12 tests OK 
  test-mapview.R................   13 tests OK 
  test-mapview.R................   14 tests OK 
  test-mapview.R................   15 tests OK 
  test-mapview.R................   16 tests OK 
  test-mapview.R................   16 tests OK 
  test-mapview.R................   16 tests OK 
  test-mapview.R................   17 tests OK 
  test-mapview.R................   18 tests OK 
  test-mapview.R................   19 tests OK 
  test-mapview.R................   20 tests OK 
  test-mapview.R................   20 tests OK 
  test-mapview.R................   21 tests OK 
  test-mapview.R................   22 tests OK 
  test-mapview.R................   23 tests OK 
  test-mapview.R................   24 tests OK 
  test-mapview.R................   24 tests OK 
  test-mapview.R................   24 tests OK 
  test-mapview.R................   25 tests OK 
  test-mapview.R................   26 tests OK 
  test-mapview.R................   27 tests OK 
  test-mapview.R................   28 tests OK 
  test-mapview.R................   28 tests OK 
  test-mapview.R................   29 tests OK 
  test-mapview.R................   30 tests OK 
  test-mapview.R................   31 tests OK 
  test-mapview.R................   32 tests OK 
  test-mapview.R................   32 tests OK 
  test-mapview.R................   32 tests OK 
  test-mapview.R................   33 tests OK 
  test-mapview.R................   33 tests OK 
  test-mapview.R................   34 tests OK 
  test-mapview.R................   34 tests OK 
  test-mapview.R................   34 tests OK 
  test-mapview.R................   35 tests OK 
  test-mapview.R................   36 tests OK 
  test-mapview.R................   37 tests OK 
  test-mapview.R................   38 tests OK 
  test-mapview.R................   38 tests OK 
  test-mapview.R................   39 tests OK 
  test-mapview.R................   40 tests OK 
  test-mapview.R................   41 tests OK 
  test-mapview.R................   42 tests OK Loading required package: sp
  
  test-mapview.R................   42 tests OK 
  test-mapview.R................   42 tests OK 
  test-mapview.R................   43 tests OK 
  test-mapview.R................   44 tests OK 
  test-mapview.R................   45 tests OK 
  test-mapview.R................   46 tests OK 
  test-mapview.R................   46 tests OK 
  test-mapview.R................   47 tests OK 
  test-mapview.R................   48 tests OK 
  test-mapview.R................   49 tests OK 
  test-mapview.R................   50 tests OK 
  test-mapview.R................   50 tests OK 
  test-mapview.R................   50 tests OK 
  test-mapview.R................   51 tests OK 
  test-mapview.R................   52 tests OK 
  test-mapview.R................   53 tests OK 
  test-mapview.R................   54 tests OK 
  test-mapview.R................   54 tests OK 
  test-mapview.R................   55 tests OK 
  test-mapview.R................   56 tests OK 
  test-mapview.R................   57 tests OK 
  test-mapview.R................   58 tests OK 
  test-mapview.R................   58 tests OK 
  test-mapview.R................   59 tests OK 
  test-mapview.R................   60 tests OK 
  test-mapview.R................   61 tests OK 
  test-mapview.R................   62 tests OK 
  test-mapview.R................   62 tests OK 
  test-mapview.R................   63 tests OK 
  test-mapview.R................   64 tests OK 
  test-mapview.R................   65 tests OK 
  test-mapview.R................   66 tests OK 
  test-mapview.R................   66 tests OK 
  test-mapview.R................   67 tests OK 
  test-mapview.R................   68 tests OK 
  test-mapview.R................   69 tests OK 
  test-mapview.R................   70 tests OK 
  test-mapview.R................   70 tests OK 
  test-mapview.R................   71 tests OK 
  test-mapview.R................   72 tests OK 
  test-mapview.R................   73 tests OK 
  test-mapview.R................   74 tests OK 
  test-mapview.R................   74 tests OK 
  test-mapview.R................   75 tests OK 
  test-mapview.R................   76 tests OK 
  test-mapview.R................   77 tests OK 
  test-mapview.R................   78 tests OK 
  test-mapview.R................   78 tests OK 
  test-mapview.R................   79 tests OK 
  test-mapview.R................   80 tests OK 
  test-mapview.R................   81 tests OK 
  test-mapview.R................   82 tests OK 
  test-mapview.R................   82 tests OK 
  test-mapview.R................   82 tests OK 
  test-mapview.R................   83 tests OK 
  test-mapview.R................   84 tests OK 
  test-mapview.R................   85 tests OK 
  test-mapview.R................   86 tests OK 
  test-mapview.R................   86 tests OK 
  test-mapview.R................   87 tests OK 
  test-mapview.R................   88 tests OK 
  test-mapview.R................   89 tests OK 
  test-mapview.R................   90 tests OK 
  test-mapview.R................   90 tests OK 
  test-mapview.R................   91 tests OK 
  test-mapview.R................   92 tests OK 
  test-mapview.R................   93 tests OK 
  test-mapview.R................   94 tests OK 
  test-mapview.R................   94 tests OK 
  test-mapview.R................   95 tests OK 
  test-mapview.R................   96 tests OK 
  test-mapview.R................   97 tests OK 
  test-mapview.R................   98 tests OK 
  test-mapview.R................   98 tests OK 
  test-mapview.R................   99 tests OK 
  test-mapview.R................  100 tests OK 
  test-mapview.R................  101 tests OK 
  test-mapview.R................  102 tests OK 
  test-mapview.R................  102 tests OK 
  test-mapview.R................  103 tests OK 
  test-mapview.R................  104 tests OK 
  test-mapview.R................  105 tests OK 
  test-mapview.R................  106 tests OK 
  test-mapview.R................  106 tests OK 
  test-mapview.R................  106 tests OK 
  test-mapview.R................  107 tests OK 
  test-mapview.R................  108 tests OK 
  test-mapview.R................  109 tests OK 
  test-mapview.R................  110 tests OK 
  test-mapview.R................  110 tests OK 
  test-mapview.R................  111 tests OK 
  test-mapview.R................  112 tests OK 
  test-mapview.R................  113 tests OK 
  test-mapview.R................  114 tests OK 
  test-mapview.R................  114 tests OK 
  test-mapview.R................  114 tests OK 
  test-mapview.R................  115 tests OK 
  test-mapview.R................  116 tests OK 
  test-mapview.R................  117 tests OK 
  test-mapview.R................  118 tests OK 
  test-mapview.R................  118 tests OK 
  test-mapview.R................  119 tests OK 
  test-mapview.R................  120 tests OK 
  test-mapview.R................  121 tests OK 
  test-mapview.R................  122 tests OK 
  test-mapview.R................  122 tests OK 
  test-mapview.R................  122 tests OK Error in as(atlStorms2005, "SpatialLines") : 
    no method or default for coercing "sf" to "SpatialLines"
  Calls: <Anonymous> ... eval -> mapview -> standardGeneric -> eval -> eval -> as
  Execution halted
checking data for non-ASCII characters ... NOTE
  Note: found 1 marked UTF-8 string

rapr

checking tests ... ERROR
  Runningtinytest.RRunning the tests intests/tinytest.Rfailed.
Complete output:
  > 
  > if ( requireNamespace("tinytest", quietly=TRUE) ){
  +   tinytest::test_package("rapr")
  + }
  
  test_rapr.R...................    0 tests    
  test_rapr.R...................    0 tests    
  test_rapr.R...................    0 tests    
  test_rapr.R...................    0 tests    
  test_rapr.R...................    1 tests OK 
  test_rapr.R...................    2 tests OK 
  test_rapr.R...................    3 tests OK 
  test_rapr.R...................    3 tests OK 
  test_rapr.R...................    3 tests OK 
  test_rapr.R...................    4 tests OK 
  test_rapr.R...................    5 tests OK 
  test_rapr.R...................    6 tests OK 
  test_rapr.R...................    7 tests OK 
  test_rapr.R...................    7 tests OK Loading required namespace: sf
  
  test_rapr.R...................    7 tests OK 
  test_rapr.R...................    8 tests OK 
  test_rapr.R...................    9 tests OK 
  test_rapr.R...................   10 tests OK 
  test_rapr.R...................   10 tests OK 
  test_rapr.R...................   10 tests OK 
  test_rapr.R...................   11 tests OK 
  test_rapr.R...................   12 tests OK 
  test_rapr.R...................   13 tests OK 
  test_rapr.R...................   14 tests OK 
  test_rapr.R...................   14 tests OK Error in sfc2SpatialPolygons(from, IDs) : 
    package sp required, please install it first
  Calls: <Anonymous> ... <Anonymous> -> as_Spatial -> .as_Spatial -> sfc2SpatialPolygons
  Execution halted

Originally posted by @schloerke in #943 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions