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.Rmd
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,16 @@ if (!require("remotes")) install.packages("remotes")
45
45
remotes::install_github("brownag/rgeedim")
46
46
```
47
47
48
+
## How {rgeedim} Works
49
+
50
+
{rgeedim} uses on the `geedim` and `earthengine-api` Python modules via {reticulate}. If you do not have Python installed on your computer you can use `reticulate::install_python()` to download and set up a Python binary and virtual environment.
51
+
52
+
If you are running {rgeedim} interactively for the first time you may be prompted to create a default Python environment called `"r-reticulate"` for {reticulate} to use. Select 'Yes' at the prompt. If you select 'No' you will need to manually configure a Python environment. {rgeedim} provides a helper function, `gd_install()`, to facilitate installing the required Python dependencies.
53
+
54
+
```{r example}
55
+
library(rgeedim)
56
+
```
57
+
48
58
## Dependencies
49
59
50
60
You will need Python 3 with the `geedim` module installed to use {rgeedim}.
@@ -81,13 +91,7 @@ This shell command assumes you have a Python 3 executable named (or aliased) as
81
91
82
92
If using Python within RStudio, you may need to set your default interpreter in _Tools_ >> _Global Options..._ >> _Python_.
83
93
84
-
## How {rgeedim} Works
85
-
86
-
This example shows how to extract a Google Earth Engine asset by name for an arbitrary extent. The coordinates of the bounding box are expressed in WGS84 decimal degrees (`"OGC:CRS84"`).
87
-
88
-
```{r example}
89
-
library(rgeedim)
90
-
```
94
+
## Authentication & Initialization
91
95
92
96
If this is your first time using any Google Earth Engine tools, authenticate with `gd_authenticate()`. You can pass arguments to use several different authorization methods.
In each R session you will need to initialize the Earth Engine library.
107
111
108
112
```{r}
109
-
gd_initialize()
113
+
gd_initialize(project = "rgeedim-demo")
110
114
```
111
115
112
116
Note that with `auth_mode="gcloud"` you need to specify the project via `project=` argument, in your default configuration file or via system environment variable `GOOGLE_CLOUD_QUOTA_PROJECT`. The authorization tokens generated for `auth_mode="notebook"` are always associated with a specific project.
@@ -156,7 +160,7 @@ This example demonstrates the download of a section of the USGS NED seamless 10m
156
160
library(rgeedim)
157
161
library(terra)
158
162
159
-
gd_initialize()
163
+
gd_initialize(project = "rgeedim-demo")
160
164
161
165
b <- gd_bbox(
162
166
xmin = -120.296,
@@ -205,7 +209,7 @@ library(rgeedim)
205
209
library(terra)
206
210
207
211
# search and download from USGS 1m lidar data collection
208
-
gd_initialize()
212
+
gd_initialize(project = "rgeedim-demo")
209
213
210
214
# wkt->SpatVector->GeoJSON
211
215
b <- 'POLYGON((-121.355 37.56,-121.355 37.555,
@@ -252,7 +256,7 @@ This example is based on a [tutorial](https://geedim.readthedocs.io/en/latest/ex
252
256
library(rgeedim)
253
257
library(terra)
254
258
255
-
gd_initialize()
259
+
gd_initialize(project = "rgeedim-demo")
256
260
257
261
b <- gd_bbox(
258
262
xmin = -120.296,
@@ -314,7 +318,7 @@ z <- x |>
314
318
plot(rast(z)[[1:4]])
315
319
```
316
320
317
-
The `"q-mosaic"` method produces a composite (largely) free of artifacts in this case; this is because it prioritizes pixels with higher distance from clouds to fill in the gaps. Other methods are available such as `"medoid"`; this may give better results when compositing more contrasting inputs such as several dates over a time period where vegetation or other cover changes appreciably.
321
+
The `"q-mosaic"` method produces a composite largely free of artifacts; this is because it prioritizes pixels with higher distance from clouds to fill in the gaps. Other methods are available such as `"medoid"`; this may give better results when compositing more contrasting inputs such as several dates over a time period where vegetation or other cover changes appreciably.
0 commit comments