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

Add get_SDA_cosurfmorph() #245

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Add get_SDA_cosurfmorph() #245

merged 5 commits into from
Apr 28, 2022

Conversation

brownag
Copy link
Member

@brownag brownag commented Apr 28, 2022

This ports over and generalizes the concepts from (deprecated) sharpshootR queries.

  • hillslopeProbability(), geomPosHillProbability(), geomPosMountainProbability() and surfaceShapeProbability()
  • These queries were deprecated in sharpshootR when cached versions of these tables started being provided by SoilWeb and series-level summaries were added to fetchOSD() extended data.

There was a general need to expose how these queries work and extend them for other geomorphic data elements (terraces and flats). A single base query is used for all of the source cosurfmorph* tables

This PR adds a single function get_SDA_cosurfmorph() in the "SSURGO On Demand" style. Users can customize the WHERE clause, target tables (cosurfmorphgc, cosurfmorphhpp or cosurfmorphss) and the grouping variable used to calculate proportions (default by="compname")

  • "cosurfmorphgc" summarizes "geomposmntn", "geomposhill", "geomposflats", "geompostrce"
  • "cosurfmorphhpp" summarizes "hillslopeprof"
  • "cosurfmorphss" summarizes "shapeacross", "shapedown", and concatenated "surfaceshape"

Remaining TODOs:

  • Add areasymbols and mukeys arguments for parity with other SSURGO on Demand queries
  • (not in this PR) Add custom WHERE clause to other SSURGO on Demand queries (to beused when areasymbols/mukeys not specified)
  • toggle STATSGO
  • local dsn for e.g. SQLite SSURGO instances

brownag added 3 commits April 28, 2022 13:10
 - TODOs:
   - support for concatenated surface shape
   - toggle STATSGO
   - local `dsn`
@brownag brownag merged commit c5ad4ce into master Apr 28, 2022
@brownag brownag deleted the SDA_cosurfmorph branch April 28, 2022 21:58
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.

2 participants