You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-5Lines changed: 57 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,9 @@ library("hwsdr")
25
25
26
26
###development release
27
27
28
+
>Breaking change: as of version 1.1 the order of the coordinates in the
29
+
location string has changed from (lat, lon, lat, lon) to (lon, lat, lon, lat)!
30
+
28
31
To install the development releases of the package run the following
29
32
commands:
30
33
@@ -45,35 +48,84 @@ library("hwsdr")
45
48
46
49
##Use
47
50
48
-
###Single pixel location download
51
+
###HWSD v1.2 (ORNL DAAC API)
52
+
53
+
####Single pixel location download
49
54
50
55
Get world soil values for a single site using the following format, specifying coordinates as a pair of latitude, longitude coordinates. Here all available soil layers are queried.
51
56
52
57
```r
53
-
all<- ws_subset(
58
+
all<- ws_subset(
54
59
site="HWSD",
55
60
location= c(34,-81),
56
61
param="ALL"
57
62
)
58
63
```
59
64
60
-
###Gridded data
65
+
####Gridded data
61
66
62
67
You can download gridded data by specifying a bounding box c(lat, lon, lat, lon) defined by a bottom left and top right coordinates. Here the call only extracts the top soil fraction of sand (% weight).
63
68
64
69
```r
65
-
t_sand<- ws_subset(
70
+
t_sand<- ws_subset(
66
71
site="HWSD",
67
72
location= c(32,-81,34,-80),
68
73
param="T_SAND",
69
74
path= tempdir(),
70
75
internal=TRUE
71
76
)
72
77
```
73
-
##Parameters
78
+
###Parameters
74
79
75
80
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.
76
81
82
+
###HWSD v2.0 (FAO)
83
+
84
+
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.
85
+
86
+
####Download the base map
87
+
88
+
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.
89
+
90
+
```{r eval = FALSE}
91
+
# set the ws_path variable using a FULL path name
92
+
path <- ws_download(
93
+
ws_path = "/your/full/path",
94
+
verbose = TRUE
95
+
)
96
+
```
97
+
98
+
###Single pixel location download
99
+
100
+
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.
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 (%).
116
+
117
+
```{r eval = FALSE}
118
+
sand <- ws_subset(
119
+
location = c(32, -81, 34, -80),
120
+
param = "SAND",
121
+
layer = "D1",
122
+
version = "2.0",
123
+
ws_path = Sys.getenv("WS_PATH"),
124
+
# ws_path = "/your/full/path",
125
+
internal = TRUE
126
+
)
127
+
```
128
+
77
129
##References
78
130
79
131
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>).
Copy file name to clipboardExpand all lines: vignettes/hwsdr-v2-vignette.Rmd
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Although the package provides support for the programmatic interface to the Harm
45
45
46
46
###Download the base map
47
47
48
-
The HWSD v2.0 data is distributed as a spatial map wherehomogenous 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.
48
+
The HWSD v2.0 data is distributed as a spatial map wherehomogeneous 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.
49
49
50
50
Ideally, to speed up processing between sessions you download the data to a fixed location (directory) on your computer. The function`ws_download()` will download the data there. If successful the function will return the path where the data is located.
51
51
@@ -79,13 +79,13 @@ Get world soil values for a single site using the following format, specifying c
79
79
80
80
```{r eval = FALSE}
81
81
values <- ws_subset(
82
-
site = "HWSD_V2",
83
-
location = c(-81, 34),
84
-
param = c("SAND","SILT"),
85
-
layer = "D1",
86
-
version = "2.0",
87
-
ws_path = "/your/full/path"
88
-
)
82
+
site = "HWSD_V2",
83
+
location = c(-81, 34),
84
+
param = c("SAND","SILT"),
85
+
layer = "D1",
86
+
version = "2.0",
87
+
ws_path = "/your/full/path"
88
+
)
89
89
```
90
90
91
91
At this location we have a top soil fraction of sand of 78% weight and a silt fraction of 12 % weight! Data are returned as tidy data frames including basic meta-data of the query for later subsetting.
@@ -99,8 +99,8 @@ print(values)
99
99
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 (%).