This function automatically "chunks" the input vector (using makeChunks()
) of map unit identifiers to minimize the likelihood of exceeding the SDA data request size. The number of chunks varies with the chunk.size
setting and the length of your input vector. If you are working with many map units and/or large extents, you may need to decrease this number in order to have more chunks.
Querying regions with complex mapping may require smaller chunk.size
. Numerically adjacent IDs in the input vector may share common qualities (say, all from same soil survey area or region) which could cause specific chunks to perform "poorly" (slow or error) no matter what the chunk size is. Shuffling the order of the inputs using sample()
may help to eliminate problems related to this, depending on how you obtained your set of MUKEY/nationalmusym to query. One could feasibly use muacres
as a heuristic to adjust for total acreage within chunks.
Note that STATSGO data are fetched where CLIPAREASYMBOL = 'US'
to avoid duplicating state and national subsets of the geometry.
A prototype interface, geom.src="mlrapolygon"
, is provided for obtaining Major Land Resource Area (MLRA) polygon
boundaries. When using this geometry source x
is a vector of MLRARSYM
(MLRA Symbols). The geometry source is
the MLRA Geographic Database v5.2 (2022) which is not (yet) part of Soil Data Access. Instead of SDA, GDAL utilities
are used to read a zipped ESRI Shapefile from a remote URL: https://www.nrcs.usda.gov/sites/default/files/2022-10/MLRA_52_2022.zip.
Therefore, most additional fetchSDA_spatial()
arguments are not currently supported for the MLRA geometry source.
In the future a mlrapolygon
table may be added to SDA (analogous to mupolygon
and sapolygon
),
and the function will be updated accordingly at that time.