-
Notifications
You must be signed in to change notification settings - Fork 19
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
Enhance SDA_spatialQuery(what="geom")
to query from either SSURGO or (new) STATSGO?
#141
Comments
Excellent idea! I would be happy to review a PR and merge ASAP. Dylan |
Wonderful, thanks! Working on it. Do you have a preference for how to name the new argument? Not sure whether there is a standard short terminology for "Soil Geographic Databases". I used |
Thanks for the input, suggestions, and PR! I've made some updates since the PR in the documentation and "SDA spatial" code (167200a). I'm checking on the efficiency question related to Also, I've added a new section to the examples demonstrating how to get both SSURGO / STATSGO geometry. I've also deprecated some older interfaces to SDA, so it is probably time to re-visit the related tutorials. Honestly, all of the tutorials should be properly organized via |
The function
SDA_spatialQuery
(soilDB v2.5.7) currently returns geometries andmukey
values fromSSURGO
and not fromSTATSGO
. As long asSSURGO
remains incomplete andSDA
doesn't connect to merged version such asgNATSGO
, it would be great to have the functionality to query from either database for a complete workflow coverage.A call with the argument
what = "mukey"
queries the tabular tablemapunit
and relies on a SQL statement based onSDA_Get_Mukey_from_intersection_with_WktWgs84()
to handle the spatial conversion; this, however, restricts the output toSSURGO
. Until there is a comparable function forSTATSGO
not much can be done for this case apparently.However, a call with the argument
what = "geom"
relies on T-SQL intrinsic spatial functionSTIntersects
that queries the spatial tablemupolygon
ofSSURGO
. According to a comment from Dec 2017 made in response to an earlier, different issue, a corresponding table exists forSTATSGO
#36 (comment), i.e.,gsmmupolygon
.I created a local copy of
SDA_spatialQuery
for my own use with a new argumentdb = c("SSURGO", "STATSGO")
and few minor code changes, which appear to work well (see below).As a simple user, I don't know whether querying
gsmmupolygon
is a supported activity. If it is, however, then it would be great if you would consider whether the suggested enhancement could be a good fit forsoilDB
! Let me know if you would like me to create a pull-request with the suggestion incorporated.Thanks!
The text was updated successfully, but these errors were encountered: