Machine-Learning based High-Resolution Soil Moisture mapping and spatial analysis tool - Version 1.0
Machine-Learning based High-Resolution Soil Moisture mapping and spatial analysis tool - Version 1.0
Authors: Yuliang Peng (peng68@wisc.edu), Jingyi Huang (jhuang426@wisc.edu)
This new R package, mlhrsm, allows the user to generate machine learning-based high-resolution (30 to 500 m) soil moisture (volumetric water content—VWC) maps and uncertainty estimates across the contiguous United States.The package has been published online: https://doi.org/10.3390/agronomy14030421 All the R code and datasets can be found here: https://github.com/soilsensingmonitoring/mlhrsm_1.0/tree/main/ReproductionMaterials
For package support or future collaboration, please contact Dr. Jingyi Huang by email or join our Google Group (mlhrsm@googlegroups.com).
Package installation instructions
- Install the latest version RTools (RTools 4.2 or the version that is compatible with the user’s R console, https://cran.r-project.org/bin/windows/Rtools/).
- Install the following dependency R packages.
install.packages(c('raster', 'rgee', 'sf', 'tidyverse', 'viridis', 'FedData', 'RColorBrewer', 'caret', 'chillR', 'leaflet', 'hydroGOF', 'quantregForest', 'randomForest', 'reshape2', 'sp', 'lubridate', 'geojsonio', 'stars', 'Rcpp', 'fastmap', 'digest', 'fs', 'stringi', 'cachem', 'htmltools', 'curl', 'ps', 'processx'))
Since rgdal
is no longer available on CRAN, we need to install it through devtools
.
install.packages("devtools")
library(devtools)
install_version("rgdal", version = "1.6-7", repos = "http://cran.us.r-project.org")
Remember to run the following line before using rgdal
package to avoid confusion with sf
and terra
packages.
options("rgdal_show_exportToProj4_warnings"="none")
- Install R package mlhrsm. The users can install it from GitHub.
install.packages("R.rsp")
devtools::install_github("soilsensingmonitoring/mlhrsm_1.0", build_vignettes=T)
- Set up Google Earth Engine account, project, and API. First, all users need to create a free Google Earth Engine account (https://earthengine.google.com/signup/). Second, install gcloud CLI before downloading maps from Google Earth Engine (https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe). Third, create a project on the Google Earth Account for future use. After installing the gcloud CLI, if a CMD window pops out (when the user enables configuration of gcloud) to ask the user to connect gcloud CLI, select “Y” to log in. Then a web page will appear with a message saying “Google Cloud SDK wants to access your Google Account”; select Allow and go back to the CMD where the system asks the user to “Pick cloud project to use.” Select the project the user wants to use, and close CMD. Lastly, relaunch R software and install Google Earth Engine API in the R environment. In the future, if the user wants to reset the gcloud, please follow this page for detailed instructions. https://cloud.google.com/sdk/docs/configurations
library(mlhrsm)
ee_Initialize("Your email address", drive=T) # insert your email address
If it’s the first time the user uses ee_Initialize() on the computer, R will print downloading and installation messages when preparing for the initialization. Select “Y” when R asks to install Miniconda. If the computer does not have the Python package "earthengine-api" installed, an error message will appear and the user should run the following command line to install it.
.rs.restartR() ## If this does not work, please restart the R session manually
ee_install()
Then R will ask the user to store environment variables EARTHENGINE_PYTHON and EARTHENGINE_ENV in the .Renviron file to use Python path in future sessions. Type “Y” to continue, and restart R session when prompted to do so after installation is completed. Run ee_Initialize("Your email address", drive=T) again. A new window will pop up in the browser saying “Google Earth Engine Authenticator wants to access your Google Account”, then select Allow to allow the local R environment to connect to the user’s Google Earth Engine. If successful, the user will see the following messages in the R console. The user can now access the maps in Earth Engine from the local R environment and download them to the user’s Google Drive.
Fetching credentials using gcloud
Successfully saved authorization token
###################### Demo #################### To see some examples, please download the files in the "Demo" folder and run "Demo.R" file.
Funding
DSFAS PARTNERSHIP: ML-HRSM: Machine Learning High-Resolution Soil Moisture Product Development in Support of USDA NASS Crop Monitoring
National Institute of Food and Agriculture
Find out more...DSFAS-AI: Developing an Integrated Deep Learning Model Framework for County-Level Crop Yield Prediction in support of USDA NASS Operation
National Institute of Food and Agriculture
Find out more...USDA-NIFA: 7002632
University of Wisconsin-Madison
Wisconsin Alumni Research Foundation
History
Data contact name
Huang, JingyiData contact email
jhuang426@wisc.eduPublisher
Ag Data CommonsIntended use
Research and Education. The new R package, mlhrsm, allows the user to generate machine learning-based high-resolution (30 to 500 m) soil moisture (volumetric water content—VWC) maps and uncertainty estimates across the contiguous United States.Use limitations
Research and education, non-commercial applications.Temporal Extent Start Date
2016-01-01Temporal Extent End Date
2024-12-31Frequency
- daily
Theme
- Geospatial
Geographic Coverage
{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-125.0, 49.4], [-125.0, 24.5], [-66.8, 24.5], [-66.8, 49.4], [-125.0, 49.4]]]}, "properties": {}}]}Geographic location - description
Contiguous United StatesISO Topic Category
- environment
- geoscientificInformation
National Agricultural Library Thesaurus terms
soil water; computer software; uncertainty; United States; models; algorithms; vegetation; landscapes; satellites; rhizosphere; case studies; crops; remote sensing; water management; geospatial data processing; statistical analysis; soil map; artificial intelligencePrimary article PubAg Handle
Pending citation
- No
Public Access Level
- Public