hunter-stanke / rFIA

rFIA
https://rfia.netlify.com/
47 stars 23 forks source link

When using states = 'ENTIRE', inMemory = FALSE, estimates fail #16

Closed lwrogers-uw closed 3 years ago

lwrogers-uw commented 3 years ago

After acquiring data and loading it for the entire USA, estimates fail including volume, biomass, etc.:

Get the entire USA

usa <- getFIA(states = 'ENTIRE', dir=dataDir, load = FALSE)

Load previously downloaded FIA data

usa <- readFIA(dir=dataDir, inMemory = FALSE, states = 'ENTIRE')

Get the volume over time

volume(usa)

fails: Error in readFIA(dir = db$dir, common = db$common, tables = reqTables, : Data unavailable for: ENTIRE . States not found in specified directory.

hunter-stanke commented 3 years ago

Sorry for the late response here.

We worked this out previously, but for completeness, the issue arises from specifying inMemory = FALSE in the call to readFIA when attempting to read ENTIRE. Our larger-than-RAM methods are designed to work with combinations of state subsets, and as ENTIRE is simply a merged version of all state subsets (e.g., TREE table is merged into a single csv), we can't use inMemory=TRUE.

I've added a more informative warning to readFIA that will explain the above - great catch!