Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a35ac7

Browse files
committed
update documentation
1 parent01ef0fb commit8a35ac7

File tree

2 files changed

+67
-15
lines changed

2 files changed

+67
-15
lines changed

‎README.md‎

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ library("hwsdr")
2525

2626
###development release
2727

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+
2831
To install the development releases of the package run the following
2932
commands:
3033

@@ -45,35 +48,84 @@ library("hwsdr")
4548

4649
##Use
4750

48-
###Single pixel location download
51+
###HWSD v1.2 (ORNL DAAC API)
52+
53+
####Single pixel location download
4954

5055
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.
5156

5257
```r
53-
all<- ws_subset(
58+
all<- ws_subset(
5459
site="HWSD",
5560
location= c(34,-81),
5661
param="ALL"
5762
)
5863
```
5964

60-
###Gridded data
65+
####Gridded data
6166

6267
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).
6368

6469
```r
65-
t_sand<- ws_subset(
70+
t_sand<- ws_subset(
6671
site="HWSD",
6772
location= c(32,-81,34,-80),
6873
param="T_SAND",
6974
path= tempdir(),
7075
internal=TRUE
7176
)
7277
```
73-
##Parameters
78+
###Parameters
7479

7580
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.
7681

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.
101+
102+
```{r eval = FALSE}
103+
values <- ws_subset(
104+
site = "HWSD_V2",
105+
location = c(-81, 34),
106+
param = c("SAND","SILT"),
107+
layer = "D1",
108+
version = "2.0", # set correct HWSD version
109+
ws_path = "/your/full/path" # specify grid map directory
110+
)
111+
```
112+
113+
###Gridded data
114+
115+
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+
77129
##References
78130

79131
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>).

‎vignettes/hwsdr-v2-vignette.Rmd‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Although the package provides support for the programmatic interface to the Harm
4545

4646
###Download the base map
4747

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.
4949

5050
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.
5151

@@ -79,13 +79,13 @@ Get world soil values for a single site using the following format, specifying c
7979

8080
```{r eval = FALSE}
8181
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+
)
8989
```
9090

9191
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)
9999
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 (%).
100100

101101
```{r eval = FALSE}
102-
sand <- ws_subset(
103-
ws_subset(
102+
sand <- ws_subset(
103+
location = c(-81, 32, -80, 34),
104104
param = "SAND",
105105
layer = "D1",
106106
version = "2.0",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp