Skip to content

loadkNNSpeciesLayers() warns about raster having no values #118

@achubaty

Description

@achubaty

See https://github.com/PredictiveEcology/LandR/blob/development/tests/testthat/test-loadkNNSpeciesLayers.R, which are only being run interactively. consider running these on GitHub Actions too.

  cPath <- withr::local_tempdir("cache")
  dPath <- withr::local_tempdir("inputs")

  withr::local_options(reproducible.cachePath = cPath)

  withr::local_seed(123)

  SA <- randomStudyArea(size = 10000000)
  RTM <- rast(SA, resolution = 250)
  sppEquiv <- sppEquivalencies_CA
  sppEquivCol <- "KNN"

  sppEquiv <- sppEquiv[KNN %in% c("Pinu_Spp", "Popu_Tre", "Pice_Mar")]

  ## get all available species for 2001
  httr::with_config(config = httr::config(ssl_verifypeer = .sslVerify), {
    speciesLayers <- loadkNNSpeciesLayers(
      dPath = dPath,
      rasterToMatch = RTM,
      studyArea = SA,
      year = 2001,
      url = paste0(
        "https://ftp.maps.canada.ca/pub/nrcan_rncan/Forests_Foret/",
        "canada-forests-attributes_attributs-forests-canada/",
        "2001-attributes_attributs-2001/"
      ),
      sppEquiv = sppEquiv,
      sppEquivCol = sppEquivCol,
      thresh = 0
    )
  })
  ## WARNING: [readValues] raster has no values

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