Skip to content

Commit

Permalink
Merge branch 'master' into esagg
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag authored Oct 28, 2023
2 parents ccc356a + 728019a commit f69cecb
Show file tree
Hide file tree
Showing 22 changed files with 2,137 additions and 1,680 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::remotes, local::.
extra-packages: any::rcmdcheck, any::remotes, terra=?ignore-before-r=4.1.0, local::.
# upgrade: 'TRUE' ## NB: required to force building of source packages
needs: check

Expand Down
17 changes: 14 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# soilDB 2.7.9.9000 (2023-09-18)
# soilDB 2.7.9.9000 (2023-10-04)
- `fetchSDA_spatial()` gains `geom.src="mlrapolygon"` 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.

- Web coverage services and related raster attribute tables provided by SoilWeb (`mukey.wcs()` etc.) are now using the SoilWeb load-balancer URL

- `get_SDA_coecoclass()` gains `method="all"` for aggregating information about ecological sites and related components. The method performs a condition-based aggregation for each ecological site condition in the map unit, producing a "wide" data.frame result with as many columns as needed to portray all site conditions.

# soilDB 2.7.9 (2023-09-01)

# soilDB 2.7.9 (2023-09-01)

- Added new `method` options for `fetchSDA_spatial()`. Aggregation grouping is controlled by the `by.col` argument. This works for mapunit and survey area polygon geometries, aggregating all polygons in the group for each `mukey`, `nationalmusym`, `lkey`, or `areasymbol` extent.
- `method="extent"` method calculates a bounding rectangle
- `method="convexhull"` calculates the convex hull
- `method="union"` returns a MULTIPOLYGON
- `method="collection"` returns a GEOMETRYCOLLECTION

## Bug Fixes

- Bug fix for `get_vegplot_transpoints_from_NASIS_db()`; using wrong record ID for transect points
Expand Down
6 changes: 3 additions & 3 deletions R/ISSR800.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ISSR800.wcs <- function(aoi, var, res = 800, quiet = FALSE) {
}

# base URL + parameters
base.url <- 'http://soilmap2-1.lawr.ucdavis.edu/cgi-bin/mapserv?'
base.url <- 'http://casoilresource.lawr.ucdavis.edu/cgi-bin/mapserv?'
service.url <- 'map=/soilmap2/website/wcs/issr800.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage'

# unpack BBOX for WCS 2.0
Expand Down Expand Up @@ -161,10 +161,10 @@ ISSR800.wcs <- function(aoi, var, res = 800, quiet = FALSE) {
if (!is.null(var.spec$rat)) {

# get rat
rat <- try(read.csv(var.spec$rat, stringsAsFactors = FALSE), silent = quiet)
rat <- try(suppressWarnings(read.csv(var.spec$rat, stringsAsFactors = FALSE)), silent = TRUE)

if (inherits(rat, 'try-error')) {
message("Failed to download RAT from ", var.spec$rat, "; returning non-categorical grid")
message("\nFailed to download RAT from ", var.spec$rat, "; returning integer grid")
return(r)
}

Expand Down
58 changes: 29 additions & 29 deletions R/WCS-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,63 +174,63 @@ WCS_details <- function(wcs = c('mukey', 'ISSR800', 'soilColor')) {
type = 'GEOTIFF_16',
desc = 'Moist soil color, 5cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc010cm' = list(
dsn = 'sc010cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 10cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc015cm' = list(
dsn = 'sc015cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 15cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc025cm' = list(
dsn = 'sc025cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 25cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc050cm' = list(
dsn = 'sc050cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 50cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc075cm' = list(
dsn = 'sc075cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 75cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc100cm' = list(
dsn = 'sc100cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 100cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc125cm' = list(
dsn = 'sc125cm',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 125cm (270m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),


Expand All @@ -239,63 +239,63 @@ WCS_details <- function(wcs = c('mukey', 'ISSR800', 'soilColor')) {
type = 'GEOTIFF_16',
desc = 'Moist soil color, 5cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc010cm_hr' = list(
dsn = 'sc010cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 10cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc015cm_hr' = list(
dsn = 'sc015cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 15cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc025cm_hr' = list(
dsn = 'sc025cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 25cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc050cm_hr' = list(
dsn = 'sc050cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 50cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc075cm_hr' = list(
dsn = 'sc075cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 75cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc100cm_hr' = list(
dsn = 'sc100cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 100cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
),

'sc125cm_hr' = list(
dsn = 'sc125cm_hr',
type = 'GEOTIFF_16',
desc = 'Moist soil color, 125cm (30m)',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/wcs/soilcolor/unique-moist-color-LUT.csv'
)
)

Expand Down Expand Up @@ -542,15 +542,15 @@ WCS_details <- function(wcs = c('mukey', 'ISSR800', 'soilColor')) {
type = 'GEOTIFF_16',
desc = 'Soil Series Name',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/series_name.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/series_name.csv'
),

'hydgrp' = list(
dsn = 'hydgrp',
type = 'GEOTIFF_BYTE',
desc = 'Hydrologic Soil Group',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/hydgrp.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/hydgrp.csv'
),


Expand All @@ -559,15 +559,15 @@ WCS_details <- function(wcs = c('mukey', 'ISSR800', 'soilColor')) {
type = 'GEOTIFF_BYTE',
desc = 'Soil Drainage Class',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/drainage_class.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/drainage_class.csv'
),

'weg' = list(
dsn = 'weg',
type = 'GEOTIFF_BYTE',
desc = 'Wind Erodibility Group',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/weg.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/weg.csv'
),

'wei' = list(
Expand All @@ -583,71 +583,71 @@ WCS_details <- function(wcs = c('mukey', 'ISSR800', 'soilColor')) {
type = 'GEOTIFF_BYTE',
desc = 'Soil Temperature Regime',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/str.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/str.csv'
),

'soilorder' = list(
dsn = 'soilorder',
type = 'GEOTIFF_BYTE',
desc = 'Soil Taxonomy: Soil Order',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/soilorder.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/soilorder.csv'
),

'suborder' = list(
dsn = 'suborder',
type = 'GEOTIFF_BYTE',
desc = 'Soil Taxonomy: Suborder',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/suborder.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/suborder.csv'
),

'greatgroup' = list(
dsn = 'greatgroup',
type = 'GEOTIFF_BYTE',
desc = 'Soil Taxonomy: Greatgroup',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/greatgroup.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/greatgroup.csv'
),

'texture_05cm' = list(
dsn = 'texture_05cm',
type = 'GEOTIFF_BYTE',
desc = 'Soil Texture Class, 0-5cm',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/texture_05.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/texture_05.csv'
),

'texture_025cm' = list(
dsn = 'texture_025cm',
type = 'GEOTIFF_BYTE',
desc = 'Soil Texture Class, 0-25cm',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/texture_025.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/texture_025.csv'
),

'texture_2550cm' = list(
dsn = 'texture_2550cm',
type = 'GEOTIFF_BYTE',
desc = 'Soil Texture Class, 25-50cm',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/texture_2550.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/texture_2550.csv'
),

'lcc_irrigated' = list(
dsn = 'lcc_irrigated',
type = 'GEOTIFF_BYTE',
desc = 'Land Capability Class, irrigated',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/lcc.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/lcc.csv'
),

'lcc_nonirrigated' = list(
dsn = 'lcc_nonirrigated',
type = 'GEOTIFF_BYTE',
desc = 'Land Capability Class, non-irrigated',
na = 0,
rat = 'http://soilmap2-1.lawr.ucdavis.edu/800m_grids/RAT/lcc.csv'
rat = 'http://casoilresource.lawr.ucdavis.edu/800m_grids/RAT/lcc.csv'
)


Expand Down
Loading

0 comments on commit f69cecb

Please sign in to comment.