Git Product home page Git Product logo

rhwsd's Introduction

R interface to the Harmonized World Soil Database

Archived

See either the ingestr R package https://stineb.github.io/ingestr/ Or the netcdf version of the database https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=1247

This package was created long ago, when the database was originally released in MS Access format that was then converted to the sqlite database found in inst/extdata


This is a wrapper package containing the HWSD and helper functions. This package is based on:

Code

Based on "Technical note: Processing the Harmonized World Soil Database (Version 1.2) in R" By D G Rossiter Dec 7, 2012 (available online, with copy in the rwhsd package man folder).

Data

2008-2009 COPYRIGHT FAO, IIASA, ISRIC, ISSCAS, JRC All rights reserved. No part of this Harmonized World Soil Database may be reproduced, stored in a retrieval system or transmitted by any means for resale or other commercial purposes without written permission of the copyright holders. Reproduction and dissemination of material in this information product for educational or other noncommercial purposes are authorized without any prior written permission from the copyright holders provided the source is fully acknowledged. Full acknowledgement and referencing of all sources must be included in any documentation using any of the material contained in the Harmonized World Soil Database, as follows:

Citation

FAO/IIASA/ISRIC/ISSCAS/JRC, 2009. Harmonized World Soil Database (version 1.1). FAO, Rome, Italy and IIASA, Laxenburg, Austria.

Installation

To install and load the rsofun package using the latest release run the following command in your R terminal:

if(!require(devtools)){install.packages(devtools)}
devtools::install_github("stineb/rhwsd")
library(rhwsd)

Dependencies

To install all required packages, do:

list.of.packages <- c("dplyr", "purrr", "tidyr", "raster", "sp", "DBI", "RSQLite")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)

Usage

  1. Download the HWSD data file HWSD_RASTER.zip and extract.
  2. Move the extracted files to a local directory (in this example: "~/data/hwsd/HWSD_RASTER/hwsd.bil").

Examples

Extract values for a rectangular box:

library(rhwsd)
con <- get_hwsd_con()
ans <- get_hwsd(x = c(-88.5, -88, 44, 44.5), con = con, hwsd.bil = "~/data/hwsd/HWSD_RASTER/hwsd.bil")

Extract values for one point:

con <- get_hwsd_con()
ans <- get_hwsd(x = data.frame(lon = -88, lat = 44), con = con, hwsd.bil = "~/data/hwsd/HWSD_RASTER/hwsd.bil")

Extract values for multiple points:

con <- get_hwsd_con()
ans <- get_hwsd_siteset(x = data.frame(idx = 1:2, lon = c(-88, -88.5), lat = c(44, 44.5)), con = con, hwsd.bil = "~/data/hwsd/HWSD_RASTER/hwsd.bil")

rhwsd's People

Contributors

dlebauer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.