1
1
<!-- badges: start -->
2
+
2
3
[ ![ Lifecycle:
3
4
experimental] ( https://img.shields.io/badge/lifecycle-experimental-orange.svg )] ( https://www.tidyverse.org/lifecycle/#experimental )
4
5
<!-- badges: end -->
@@ -13,9 +14,6 @@ spatio-temporal extent to your local machine. This package is at an
13
14
experimental state and currently only supports the download of raster
14
15
files.
15
16
16
- ** Disclaimer**
17
- This package is in no way associated with the WaPOR portal or the FAO.
18
-
19
17
To install the package run:
20
18
21
19
``` r
@@ -29,79 +27,75 @@ available collections.
29
27
library(wapoR )
30
28
collections = wapor_collections()
31
29
collections
32
- ```
33
30
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
+ ```
72
70
73
71
In its current state, the package mainly supports products from the
74
72
WAPOR collections. For some other collection it is also possible to
75
73
query and download raster datasets. However, for some of the collections
76
74
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
83
76
84
77
To query the available products within the collections we can run
85
- \` wapor\_ products(“<collection_name>”)\` .
78
+ \` wapor\_ products(“<collection_name>”).
86
79
87
80
``` r
88
81
products = wapor_products(" WAPOR_2" )
89
82
length(products )
83
+
84
+ # # [1] 196
85
+
90
86
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:
104
87
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
+ ```
105
99
106
100
In the WAPOR\_ 2 collection we have a total number of 196. As you can see
107
101
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
110
104
object you will get some general information about the specific product.
111
105
112
106
``` r
113
- products [[1 ]]$ product
107
+ kable( products [[1 ]]$ product )
114
108
```
115
109
116
110
<table >
@@ -160,22 +154,21 @@ methodology and data types.
160
154
161
155
``` r
162
156
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__
178
157
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
+ ```
179
172
180
173
With these information combined, we can start downloading some data.
181
174
Let’s say we are interested in the Gross Biomass Water Productivity
@@ -192,21 +185,21 @@ collection = "WAPOR_2"
192
185
product = " L2_GBWP_S" # product code
193
186
begin = as.Date(" 2015-01-01" ) # begin date is inclusive
194
187
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
196
189
key = " <your_personal_API_Key" # can be obtained in the profile section of the WAPOR website
197
190
# at https://wapor.apps.fao.org
198
191
199
192
# run the query command - see ?wapor_queryRaster() for more information
200
193
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 )
212
205
```
0 commit comments