Closed brownag closed 1 year ago
The following map unit keys are associated with very complex polygons: ('1598653', '1598670', '162786', '1413444', '403308', '2605765', '161428', '808535')
.
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).
areasymbol | mukey | ogc_fid | fd | st_x | st_y
------------+---------+----------+-------------------+-------------------+------------------
in069 | 161428 | 9937163 | 1.48328711710149 | -85.416953776054 | 40.7499389755057
in069 | 161428 | 9948437 | 1.46487512704564 | -85.482530692046 | 40.7068578216985
la075 | 1598653 | 12399549 | 1.46163071003991 | -89.9114833563087 | 29.4975338125364
la075 | 1598653 | 12390850 | 1.45988530180611 | -89.4456791098703 | 29.1909038539091
in069 | 161428 | 9947035 | 1.45958506507375 | -85.4776080088492 | 40.9512008459263
la057 | 808535 | 12358142 | 1.44351990633671 | -90.9052395795618 | 29.7535805073645
la075 | 1598653 | 12399094 | 1.4377956041352 | -89.4571619816923 | 29.1988396856297
ia021 | 403308 | 4957979 | 1.43676407697544 | -95.0402802568294 | 42.7394000845724
la057 | 808535 | 12357522 | 1.43548782699027 | -90.5702108833809 | 29.7445771122274
in069 | 161428 | 9937364 | 1.42887746607053 | -85.600613115432 | 40.9457825632656
in069 | 161428 | 9936537 | 1.42302224162814 | -85.640465571175 | 40.9778259842066
la057 | 808535 | 12358490 | 1.42189171043039 | -90.5196409691703 | 29.6089347799457
la057 | 808535 | 12358986 | 1.41932662856896 | -90.2435096155968 | 29.4243124877804
la057 | 808535 | 12356857 | 1.40927152230042 | -90.5504866246769 | 29.7146190633603
la075 | 1598653 | 12403712 | 1.40641834934647 | -89.617586937944 | 29.3005355683554
la057 | 808535 | 12357703 | 1.40373102348149 | -90.1078195510741 | 29.4591174179254
la057 | 808535 | 12357687 | 1.40208424133049 | -90.5174479199878 | 29.7147878087805
in069 | 161428 | 9938261 | 1.40206214445821 | -85.4262303400103 | 40.86742435906
la057 | 808535 | 12355116 | 1.40001693367425 | -90.596932159237 | 29.6824435958016
la057 | 808535 | 12355102 | 1.39822321741683 | -90.6061649657523 | 29.6832350107081
in069 | 161428 | 9943436 | 1.38400867153309 | -85.5537482314007 | 40.9908107561344
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 add.fields
support, but I may opt to do this aggregation in a more efficient way.
I've pushed a fix (https://github.com/ncss-tech/soilDB/pull/299/commits/368c72722add749b5776bf4b772c24cef0f27efd), 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.
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: