Repository navigation
prepInputs_SCANFI_LCC_FAO(): read forest-land land cover under the SCANFI remap - #277
Merged
Merged
Conversation
prepInputs_SCANFI_LCC_FAO() read only `year`'s own land cover inside .withSCANFIAccess(); the forest-land years went to Google Drive directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
prepInputs_SCANFI_LCC_FAO()now reads the land cover of the forest-land years under LandR's SCANFI remap, likeyear's own land cover.Defect. Since #274 the remap is applied per download, inside
.withSCANFIAccess()andprepInputs_SCANFI_structure(), instead of globally when LandR loads. InprepInputs_SCANFI_LCC_FAO()only the read ofyear's land cover (R/maps.R:488-495) is wrapped. The forest-land years are read afterwards, by thelccFor()closure passed to.forestLandFor()(R/maps.R:531-539, called fromR/forestLand.R:191-196whenforestLandFromis"both", the default, or"lccYears"). Those reads ask Google Drive for the restricted SCANFI files directly. Before #274 the global remap covered them. For a 2020yearthis means the land cover of 1985, 1995, 2005, 2015 and 2025:Biomass_borealDataPrepreaches this whenever it buildsrstLCCitself, i.e. whenrstLCCis not supplied, because it callsprepInputs_SCANFI_LCC_FAO()with the defaultforestLandFrom.Fix. The
lccFor()read goes through.withSCANFIAccess(), with the same remap and access-error handling asyear's land cover. V3, which does not use the remap, is unchanged (enabled = dataVersion != "V3").Test. In
test-scanfiMirror.R, a mockedprepInputs()records the URLs it receives while the remap is set. The test checks that each forest-land year's URL is among them and that the global option is stillNULLafterwards. It fails for all five years without the fix and passes with it.Checks:
devtools::test()on R 4.6.1 gives 225 tests, 0 failed, 12 skipped (slow, network or interactive). No version bump here, following the recent PRs.🤖 Generated with Claude Code