Skip to content

TADA Team Data Retrieval Updates #568

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

Closed
wants to merge 79 commits into from

Conversation

hillarymarler
Copy link
Collaborator

# Make a reference table for tribal area type + url matching
map_service_urls <- tibble::tribble(
~tribal_area, ~url,
"Alaska Native Allotments", "https://geopub.epa.gov/arcgis/rest/services/EMEF/Tribal/MapServer/0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this reference the internal shapefiles instead of relying on web services?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be more efficient since we already store them within the package

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something you want me to take a look at? Or plan to ask Ross lab about?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbrousil We store copies of the tribal .shp files here for use in the TADA_OverviewMap, and update them frequently as part of routine maintenance: https://github.com/USEPA/EPATADA/tree/develop/inst/extdata

Do you think we should use those directly in TADA_DataRetreival instead of querying the service?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristinamullin Yep, I think that makes more sense! I only used the web service because I wasn't aware that they were stored internally.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am aiming to merge this PR in by the end of the day tomorrow. I can create a separate issue for this update & we can address it later.

added shapefile query example
@cristinamullin
Copy link
Collaborator

I was curious how this would work for a sf lines object, and maybe I need to think through the logic more.

Continuing on with Hillary's code, once we run data retrieval to pull in all sites for the AU polygon with AU Name: REND, and we rerun TADA_GetATTAINS on this new dataframe. We find some sites get mapped to an AU line AU Name: Big Muddy River

If we were to try to now pull in all sites for AU line: Big Muddy River,

  1. Should Data Retrieval be returning sites for a sf line? It returns
image 2. Will TADA_DataRetrieval only pull in sites found on the AU line if we use aoi_sf as an ATTAINS line? 3. Does the aoi_sf need to be a polygon?

Rend_TADA_ATTAINS <- TADA_GetATTAINS(Rend_TADA) TADA_ViewATTAINS(Rend_TADA_ATTAINS) Rend_AUID_line <- Rend_TADA_ATTAINS$ATTAINS_lines Rend_TADA_line <- TADA_DataRetrieval(aoi_sf = Rend_AUID_line, ask = "no")

@mbrousil My understanding is that this is designed to work on polygons only, is that correct? In that case, we can add that detail to the documentation for users. Although in theory, we could expand in the future using a similar logic to TADA_GetATTAINS() for lines, where the polygon area used for the "line" query could actually be the area of the catchments intersecting the line. I am not sure if there are a lot of use cases for this. Any thoughts?

@mbrousil
Copy link
Contributor

I was curious how this would work for a sf lines object, and maybe I need to think through the logic more.
Continuing on with Hillary's code, once we run data retrieval to pull in all sites for the AU polygon with AU Name: REND, and we rerun TADA_GetATTAINS on this new dataframe. We find some sites get mapped to an AU line AU Name: Big Muddy River
If we were to try to now pull in all sites for AU line: Big Muddy River,

  1. Should Data Retrieval be returning sites for a sf line? It returns
image 2. Will TADA_DataRetrieval only pull in sites found on the AU line if we use aoi_sf as an ATTAINS line? 3. Does the aoi_sf need to be a polygon? `Rend_TADA_ATTAINS <- TADA_GetATTAINS(Rend_TADA)` `TADA_ViewATTAINS(Rend_TADA_ATTAINS)` `Rend_AUID_line <- Rend_TADA_ATTAINS$ATTAINS_lines` `Rend_TADA_line <- TADA_DataRetrieval(aoi_sf = Rend_AUID_line, ask = "no")`

@mbrousil My understanding is that this is designed to work on polygons only, is that correct? In that case, we can add that detail to the documentation for users. Although in theory, we could expand in the future using a similar logic to TADA_GetATTAINS() for lines, where the polygon area used for the "line" query could actually be the area of the catchments intersecting the line. I am not sure if there are a lot of use cases for this. Any thoughts?

@cristinamullin That is correct! I don't personally have any insight into potential use cases but I don't see drawbacks to that expansion.

@cristinamullin
Copy link
Collaborator

After the new USGS dataRetrieval related issues are resolved, these edits will be pushed through from this branch/PR: #575

@cristinamullin cristinamullin deleted the tada_dr_updates_tada_team branch March 11, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants