Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading by states includes plots outside the state #13

Open
nerutenbeck opened this issue May 21, 2021 · 0 comments
Open

Downloading by states includes plots outside the state #13

nerutenbeck opened this issue May 21, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nerutenbeck
Copy link
Contributor

nerutenbeck commented May 21, 2021

I'm getting some surprising results querying the FIA DB. I want to pull in all the FIA data for the SRS states, so am passing a string of state ABBs to tidyFIA, but it is returning data to me from neighboring states that I have not specified.

library(tidyFIA)
library(tidyverse)
library(sf)

srs_states <- c(
  "AL", "AR", "FL", "GA", "KY", "LA", "MS", "NC", "OK",
  "SC", "TN", "TX", "VA"
)

fia_data <- tidy_fia(states = srs_states)

count(sf::st_drop_geometry(fia_data[["plot"]]), statecd)

Result:

   statecd     n
1        1 38082
2        5 38583
3       12 58891
4       13 64212
5       17    28
6       18   123
7       20    52
8       21 19251
9       22 22719
10      24    16
11      28 27709
12      29    47
13      37 47950
14      39    20
15      40 14705
16      45 40816
17      47 27278
18      48 55721
19      51 40220
20      54    87

where the states with few plots are neighboring states to the ones passed as args. I think we must be either:

  1. Getting plots that have been fuzzed / swapped into neighboring states
  2. Pulling in plots on the edge of state lines due to spatial imprecision in the query
@nerutenbeck nerutenbeck added the bug Something isn't working label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants