-
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
fetchSDA_spatial: add new T-SQL aggregate geometry methods #299
Conversation
…and "union" - using `geometry::EnvelopeAggregate()` and friends
The following map unit keys are associated with very complex polygons: Here are some stats / point-on-surface coordinates for some delineations tied to these map unit keys. Anything with a fractal dimension ("fd") > 1.3 is either very complex, or some kind of geometric error (e.g. sliver polygon).
|
- one liner is easy to incorporate into query but probably not the most efficient; consider refactor
Thanks for pointing out those mukeys, @dylanbeaudette! I think the fractal dimension was not the issue here (for the new aggregation queries) but rather the sheer number of polygons and the clumsy way I was aggregating multiple mukey/areasymbol per nationalmusym. This works now, and will generalize for full I've pushed a fix (368c727), and now I am able to do e.g. convex hull of your problem mukeys almost 100x faster than the full geometries. e.g. suppressPackageStartupMessages(library(soilDB))
x <- c('1598653', '1598670', '162786', '1413444', '403308', '2605765', '161428', '808535')
y <- fetchSDA_spatial(x, method = "convexhull")
#> Using 1 chunks...
#> Chunk #1 completed (n = 8; 4.1 secs)
#> Done in 4.1 secs; mean/chunk: 4.1 secs; mean/symbol: 0.51 secs.
plot(y$geom) z <- fetchSDA_spatial(x)
#> Using 1 chunks...
#> Chunk #1 completed (n = 8; 3 secs)
#> Done in 2.96 mins; mean/chunk: 177.9 secs; mean/symbol: 22.24 secs. |
Nice. having these generalization tools easily available is a great addition. |
…ry results - introduced in PR #299 when "extent", "convexhull", "union", and "collection" methods were added
Adds new options (
"extent"
,"convexhull"
,"union"
, and"collection"
) formethod
argument tofetchSDA_spatial()
. These options perform various aggregations on the mupolygon or sapolygon geometry on the server side, returning a simplified result.Using the T-SQL static aggregate geometry methods:
Demonstration: