hwsdr

R API interface to the ORNL DAAC Harmonized World Soil Database

https://github.com/bluegreen-labs/hwsdr

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary

Keywords

api-client modelling r-package rstats soil spatial-analyses spatial-data
Last synced: 6 months ago · JSON representation

Repository

R API interface to the ORNL DAAC Harmonized World Soil Database

Basic Info
Statistics
  • Stars: 16
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 1
Topics
api-client modelling r-package rstats soil spatial-analyses spatial-data
Created over 4 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License

README.md

hwsdr

R-CMD-check codecov CRAN\_Status\_Badge downloads DOI

Programmatic interface to the Harmonized World Soil Database 'HWSD' web services (https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=1247). Allows for easy downloads of 'HWSD' soil data directly to your R workspace or your computer. Routines for both single pixel data downloads and gridded data are provided.

How to cite this package in your article

Koen Hufkens. (2022). bluegreen-labs/hwsdr: CRAN release (v1.0). Zenodo. https://doi.org/10.5281/zenodo.6527648

Installation

stable release

To install the current stable release use a CRAN repository:

r install.packages("hwsdr") library("hwsdr")

development release

Breaking change: as of version 1.1 the order of the coordinates in the location string has changed from (lat, lon, lat, lon) to (lon, lat, lon, lat)!

To install the development releases of the package run the following commands:

r if(!require(remotes)){install.packages("remotes")} remotes::install_github("bluegreen-labs/hwsdr") library("hwsdr")

Vignettes are not rendered by default, if you want to include additional documentation please use:

r if(!require(remotes)){install.packages("remotes")} remotes::install_github("bluegreen-labs/hwsdr", build_vignettes = TRUE) library("hwsdr")

Use

HWSD v1.2 (ORNL DAAC API)

Single pixel location download

Get world soil values for a single site using the following format, specifying coordinates as a pair of longitude and latitude coordinates. Here all available soil layers are queried.

r all <- ws_subset( site = "HWSD", location = c(-81, 34), param = "ALL" )

Gridded data

You can download gridded data by specifying a bounding box c(lon, lat, lon, lat) defined by a bottom left and top right coordinates. Here the call only extracts the top soil fraction of sand (% weight).

r t_sand <- ws_subset( site = "HWSD", location = c(-81, 32, -80, 34), param = "T_SAND", path = tempdir(), internal = TRUE )

Parameters

By default all parameters are downloaded, a complete list of the individual parameters is provided on the ORNL webpage (https://daac.ornl.gov/SOILS/guides/HWSD.html). Alternatively you may find a similar list of data in the hwsd_meta_data dataset as provided by the package.

HWSD v2.0 (FAO)

This is an experimental feature, awaiting an update of the ORNL DAAC API to version 2.0 of the HWSD database. Although functionally complete the procedure is more complex as it includes a bulk download of a base map.

Download the base map

The HWSD v2.0 data is distributed as a gridded spatial map where homogeneous regions are indicated with indices (integers). Although the underlying database is included in the package and can be accessed using hwsdr::hwsd2, the spatial data accompanying the database is too large for inclusion in the package. This spatial data needs to be downloaded explicitly to a desired path before any other functions will work.

``` r

set the ws_path variable using a FULL path name

path <- wsdownload( wspath = "/your/full/path", verbose = TRUE ) ```

Single pixel location download

Get world soil values for a single site using the following format, specifying coordinates as a pair of longitude, latitude coordinates (longitude, latitude). Here the call only extracts the top soil (layer = "D1") fraction of sand and silt (% weight) for one specific location. Note that you will need to specify the correct version to be used in processing.

r values <- ws_subset( site = "HWSD_V2", location = c(-81, 34), param = c("SAND","SILT"), layer = "D1", version = "2.0", # set correct HWSD version ws_path = "/your/full/path" # specify grid map directory )

Gridded data

You can grab gridded data by specifying a bounding box c(lon, lat, lon, lat) defined by a bottom left and top right coordinates. Here the call only extracts the top soil (D1 layer) fraction of sand (%).

r sand <- ws_subset( location = c(-81, 32, -80, 34), param = "SAND", layer = "D1", version = "2.0", ws_path = Sys.getenv("WS_PATH"), # ws_path = "/your/full/path", internal = TRUE )

References

Wieder, W.R., J. Boehnert, G.B. Bonan, and M. Langseth. 2014. Regridded Harmonized World Soil Database v1.2. Data set. Available on-line from Oak Ridge National Laboratory Distributed Active Archive Center, Oak Ridge, Tennessee, USA. (https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=1247).

Acknowledgements

The hwsdr package is a product of BlueGreen Labs, and has been in part supported by the LEMONTREE project funded through the Schmidt Futures fund, under the umbrella of the Virtual Earth System Research Institute (VESRI).

Owner

  • Name: BlueGreen Labs
  • Login: bluegreen-labs
  • Kind: organization
  • Email: info@bluegreenlabs.org
  • Location: Melsele, Belgium

BlueGreen open science labs & consulting, providing environmental research infrastructure and editorial solutions.

GitHub Events

Total
  • Push event: 4
Last Year
  • Push event: 4

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 89
  • Total Committers: 1
  • Avg Commits per committer: 89.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 56
  • Committers: 1
  • Avg Commits per committer: 56.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Koen Hufkens k****s@g****m 89

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 5
  • Average time to close issues: 4 months
  • Average time to close pull requests: 19 minutes
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 0.88
  • Average comments per pull request: 0.8
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • khufkens (6)
  • rsbivand (1)
  • eapower (1)
Pull Request Authors
  • khufkens (4)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 566 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: hwsdr

Interface to the 'HWSD' Web Services

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 566 Last month
Rankings
Stargazers count: 15.1%
Forks count: 17.0%
Dependent repos count: 23.8%
Dependent packages count: 28.7%
Average: 30.7%
Downloads: 68.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.6 depends
  • httr * imports
  • raster * imports
  • sf * imports
  • covr * suggests
  • knitr * suggests
  • magrittr * suggests
  • markdown * suggests
  • ncdf4 * suggests
  • rgdal * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/deploy_docs.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite