Skip to content

Commit a6edc0e

Browse files
author
marus200
committed
update readme
1 parent 6c725e8 commit a6edc0e

File tree

2 files changed

+84
-91
lines changed

2 files changed

+84
-91
lines changed

README.md

+83-90
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- badges: start -->
2+
23
[![Lifecycle:
34
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
45
<!-- badges: end -->
@@ -13,9 +14,6 @@ spatio-temporal extent to your local machine. This package is at an
1314
experimental state and currently only supports the download of raster
1415
files.
1516

16-
**Disclaimer**
17-
This package is in no way associated with the WaPOR portal or the FAO.
18-
1917
To install the package run:
2018

2119
```r
@@ -29,79 +27,75 @@ available collections.
2927
library(wapoR)
3028
collections = wapor_collections()
3129
collections
32-
```
3330

34-
## code
35-
## 1 AQUAMAPS
36-
## 2 ASIS
37-
## 3 C2ATLAS
38-
## 4 CHIRPS
39-
## 5 DLMF
40-
## 6 FAOSTAT
41-
## 7 GAEZ_2015
42-
## 8 GLW
43-
## 9 NASA
44-
## 10 NATURAL_EARTH
45-
## 11 NMME
46-
## 12 RDMS
47-
## 13 RICCAR
48-
## 14 RICCAR_2
49-
## 15 RVF
50-
## 16 WAPOR
51-
## 17 WAPOR_2
52-
## 18 WPOP
53-
## caption
54-
## 1 Global spatial database on water and agriculture
55-
## 2 Agriculture Stress Index System
56-
## 3 Climate Change ATLAS
57-
## 4 Climate Hazard group InfraRed Precipitation with Stations (CHIRPS)
58-
## 5 Desert Locust Monitoring and Forecasting
59-
## 6 FAO Corporate Statistical Database
60-
## 7 Global Agro-Ecological Zones (2015)
61-
## 8 Gridded Livestock of the World
62-
## 9 National Aeronautics and Space Administration (NASA)
63-
## 10 Natural Earth
64-
## 11 North American Multi-Model Ensemble (NMME)
65-
## 12 Regional Drought Monitoring System
66-
## 13 Regional Arab Climate Change Assessment Report
67-
## 14 Regional Arab Climate Change Assessment Report
68-
## 15 Rift Valley Fever
69-
## 16 FAO Water Productivity Open-access portal (WaPOR)
70-
## 17 FAO Water Productivity Open-access portal (WaPOR)
71-
## 18 WorldPop project
31+
## code
32+
## 1 AQUAMAPS
33+
## 2 ASIS
34+
## 3 C2ATLAS
35+
## 4 CHIRPS
36+
## 5 DLMF
37+
## 6 FAOSTAT
38+
## 7 GAEZ_2015
39+
## 8 GLW
40+
## 9 NASA
41+
## 10 NATURAL_EARTH
42+
## 11 NMME
43+
## 12 RDMS
44+
## 13 RICCAR
45+
## 14 RICCAR_2
46+
## 15 RVF
47+
## 16 WAPOR
48+
## 17 WAPOR_2
49+
## 18 WPOP
50+
## caption
51+
## 1 Global spatial database on water and agriculture
52+
## 2 Agriculture Stress Index System
53+
## 3 Climate Change ATLAS
54+
## 4 Climate Hazard group InfraRed Precipitation with Stations (CHIRPS)
55+
## 5 Desert Locust Monitoring and Forecasting
56+
## 6 FAO Corporate Statistical Database
57+
## 7 Global Agro-Ecological Zones (2015)
58+
## 8 Gridded Livestock of the World
59+
## 9 National Aeronautics and Space Administration (NASA)
60+
## 10 Natural Earth
61+
## 11 North American Multi-Model Ensemble (NMME)
62+
## 12 Regional Drought Monitoring System
63+
## 13 Regional Arab Climate Change Assessment Report
64+
## 14 Regional Arab Climate Change Assessment Report
65+
## 15 Rift Valley Fever
66+
## 16 FAO Water Productivity Open-access portal (WaPOR)
67+
## 17 FAO Water Productivity Open-access portal (WaPOR)
68+
## 18 WorldPop project
69+
```
7270

7371
In its current state, the package mainly supports products from the
7472
WAPOR collections. For some other collection it is also possible to
7573
query and download raster datasets. However, for some of the collections
7674
errors will be returned if queried. Currently, you might run into errors
77-
for these collections:
78-
79-
- C2ATLAS
80-
- DLMF
81-
- NASA
82-
- NATURAL\_EARTH
75+
for these collections: - C2ATLAS - DLMF - NASA - NATURAL\_EARTH
8376

8477
To query the available products within the collections we can run
85-
\`wapor\_products(“<collection_name>”)\`.
78+
\`wapor\_products(“<collection_name>”).
8679

8780
```r
8881
products = wapor_products("WAPOR_2")
8982
length(products)
83+
84+
## [1] 196
85+
9086
str(products[1:3], max.level = 2)
91-
```
92-
## [1] 196
93-
94-
## List of 3
95-
## $ L1_GBWP_A:List of 2
96-
## ..$ product:'data.frame': 1 obs. of 3 variables:
97-
## ..$ meta :'data.frame': 1 obs. of 12 variables:
98-
## $ L1_NBWP_A:List of 2
99-
## ..$ product:'data.frame': 1 obs. of 3 variables:
100-
## ..$ meta :'data.frame': 1 obs. of 12 variables:
101-
## $ L1_AETI_A:List of 2
102-
## ..$ product:'data.frame': 1 obs. of 3 variables:
103-
## ..$ meta :'data.frame': 1 obs. of 12 variables:
10487

88+
## List of 3
89+
## $ L1_GBWP_A:List of 2
90+
## ..$ product:'data.frame': 1 obs. of 3 variables:
91+
## ..$ meta :'data.frame': 1 obs. of 12 variables:
92+
## $ L1_NBWP_A:List of 2
93+
## ..$ product:'data.frame': 1 obs. of 3 variables:
94+
## ..$ meta :'data.frame': 1 obs. of 12 variables:
95+
## $ L1_AETI_A:List of 2
96+
## ..$ product:'data.frame': 1 obs. of 3 variables:
97+
## ..$ meta :'data.frame': 1 obs. of 12 variables:
98+
```
10599

106100
In the WAPOR\_2 collection we have a total number of 196. As you can see
107101
from the structured output, each element in the list object represents
@@ -110,7 +104,7 @@ objects, one called product the other one called meta. In the product
110104
object you will get some general information about the specific product.
111105

112106
```r
113-
products[[1]]$product
107+
kable(products[[1]]$product)
114108
```
115109

116110
<table>
@@ -160,22 +154,21 @@ methodology and data types.
160154

161155
```r
162156
str(products[[1]]$meta)
163-
```
164-
165-
## 'data.frame': 1 obs. of 12 variables:
166-
## $ format : chr "Raster Dataset"
167-
## $ unit : chr "kg/m³ is the ratio of kg of dry matter per cubic meter of water transpired by vegetation in one hectare"
168-
## $ dataType : chr "Int32 (32bit Integer)"
169-
## $ conversionFactor : chr "the pixel value in the downloaded data must be multiplied by 0.001"
170-
## $ noDataValue : int -9999
171-
## $ spatialResolution : chr "250m (0.00223 degree)"
172-
## $ spatialExtent : chr "Africa and Near East"
173-
## $ spatialReferenceSystem: chr "EPSG:4326 - WGS84 - Geographic Coordinate System (lat/long)"
174-
## $ temporalResolution : chr "from January 2009 to present"
175-
## $ temporalExtent : chr "Annual"
176-
## $ nearRealTime : chr "New dekadal data layers are released approximately 5 days after the end of a dekad."| __truncated__
177-
## $ methodology : chr "The calculation of gross biomass water productivity (GBWP) is as follows: GBWP ="| __truncated__
178157

158+
## 'data.frame': 1 obs. of 12 variables:
159+
## $ format : Factor w/ 1 level "Raster Dataset": 1
160+
## $ unit : Factor w/ 1 level "kg/m³ is the ratio of kg of dry matter per cubic meter of water transpired by vegetation in one hectare": 1
161+
## $ dataType : Factor w/ 1 level "Int32 (32bit Integer)": 1
162+
## $ conversionFactor : Factor w/ 1 level "the pixel value in the downloaded data must be multiplied by 0.001": 1
163+
## $ noDataValue : int -9999
164+
## $ spatialResolution : Factor w/ 1 level "250m (0.00223 degree)": 1
165+
## $ spatialExtent : Factor w/ 1 level "Africa and Near East": 1
166+
## $ spatialReferenceSystem: Factor w/ 1 level "EPSG:4326 - WGS84 - Geographic Coordinate System (lat/long)": 1
167+
## $ temporalResolution : Factor w/ 1 level "from January 2009 to present": 1
168+
## $ temporalExtent : Factor w/ 1 level "Annual": 1
169+
## $ nearRealTime : Factor w/ 1 level "New dekadal data layers are released approximately 5 days after the end of a dekad. A higher quality version of"| __truncated__: 1
170+
## $ methodology : Factor w/ 1 level "The calculation of gross biomass water productivity (GBWP) is as follows: GBWP = TBP/ETIa Where TBP is annual T"| __truncated__: 1
171+
```
179172

180173
With these information combined, we can start downloading some data.
181174
Let’s say we are interested in the Gross Biomass Water Productivity
@@ -192,21 +185,21 @@ collection = "WAPOR_2"
192185
product = "L2_GBWP_S" # product code
193186
begin = as.Date("2015-01-01") # begin date is inclusive
194187
end = as.Date("2016-01-01") # end date is exclusive
195-
dimensions = list(SEASON = "S1") # GBWP only has dimension SEASON - S1 and S2
188+
dimensions = list(SEASON = c("S1", "S2")) # GBWP only has dimension SEASON - S1 and S2
196189
key = "<your_personal_API_Key" # can be obtained in the profile section of the WAPOR website
197190
# at https://wapor.apps.fao.org
198191

199192
# run the query command - see ?wapor_queryRaster() for more information
200193
wapor_queryRaster(collection = collection,
201-
product = product,
202-
dimensions = dimensions,
203-
aoi = ugn,
204-
begin = begin,
205-
end = end,
206-
APIkey = APIkey,
207-
outdir = ".",
208-
cutline = FALSE,
209-
tiled = TRUE,
210-
compressed = TRUE,
211-
overviews = TRUE)
194+
product = product,
195+
dimensions = dimensions,
196+
aoi = ugn,
197+
begin = begin,
198+
end = end,
199+
APIkey = APIkey,
200+
outdir = ".",
201+
cutline = FALSE,
202+
tiled = TRUE,
203+
compressed = TRUE,
204+
overviews = TRUE)
212205
```

README.rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ collection = "WAPOR_2"
8888
product = "L2_GBWP_S" # product code
8989
begin = as.Date("2015-01-01") # begin date is inclusive
9090
end = as.Date("2016-01-01") # end date is exclusive
91-
dimensions = list(SEASON = "S1") # GBWP only has dimension SEASON - S1 and S2
91+
dimensions = list(SEASON = c("S1", "S2")) # GBWP only has dimension SEASON - S1 and S2
9292
key = "<your_personal_API_Key" # can be obtained in the profile section of the WAPOR website
9393
# at https://wapor.apps.fao.org
9494

0 commit comments

Comments
 (0)