Skip to content

Commit ccb221b

Browse files
committed
bump README
1 parent b46f779 commit ccb221b

7 files changed

+55
-47
lines changed

README.Rmd

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ if (!require("remotes")) install.packages("remotes")
4545
remotes::install_github("brownag/rgeedim")
4646
```
4747

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+
4858
## Dependencies
4959

5060
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
8191

8292
If using Python within RStudio, you may need to set your default interpreter in _Tools_ >> _Global Options..._ >> _Python_.
8393

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
9195

9296
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.
9397

@@ -106,7 +110,7 @@ gd_authenticate(auth_mode = "gcloud")
106110
In each R session you will need to initialize the Earth Engine library.
107111

108112
```{r}
109-
gd_initialize()
113+
gd_initialize(project = "rgeedim-demo")
110114
```
111115

112116
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
156160
library(rgeedim)
157161
library(terra)
158162
159-
gd_initialize()
163+
gd_initialize(project = "rgeedim-demo")
160164
161165
b <- gd_bbox(
162166
xmin = -120.296,
@@ -205,7 +209,7 @@ library(rgeedim)
205209
library(terra)
206210
207211
# search and download from USGS 1m lidar data collection
208-
gd_initialize()
212+
gd_initialize(project = "rgeedim-demo")
209213
210214
# wkt->SpatVector->GeoJSON
211215
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
252256
library(rgeedim)
253257
library(terra)
254258
255-
gd_initialize()
259+
gd_initialize(project = "rgeedim-demo")
256260
257261
b <- gd_bbox(
258262
xmin = -120.296,
@@ -314,7 +318,7 @@ z <- x |>
314318
plot(rast(z)[[1:4]])
315319
```
316320

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

319323
```{r include=FALSE}
320324
unlink('image.tif')

README.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,25 @@ if (!require("remotes")) install.packages("remotes")
4343
remotes::install_github("brownag/rgeedim")
4444
```
4545

46+
## How {rgeedim} Works
47+
48+
{rgeedim} uses on the `geedim` and `earthengine-api` Python modules via
49+
{reticulate}. If you do not have Python installed on your computer you
50+
can use `reticulate::install_python()` to download and set up a Python
51+
binary and virtual environment.
52+
53+
If you are running {rgeedim} interactively for the first time you may be
54+
prompted to create a default Python environment called `"r-reticulate"`
55+
for {reticulate} to use. Select ‘Yes’ at the prompt. If you select ‘No’
56+
you will need to manually configure a Python environment. {rgeedim}
57+
provides a helper function, `gd_install()`, to facilitate installing the
58+
required Python dependencies.
59+
60+
``` r
61+
library(rgeedim)
62+
#> rgeedim v0.2.8 -- using geedim 1.9.0 w/ earthengine-api 1.5.2
63+
```
64+
4665
## Dependencies
4766

4867
You will need Python 3 with the `geedim` module installed to use
@@ -85,16 +104,7 @@ within an active Python virtual environment.
85104
If using Python within RStudio, you may need to set your default
86105
interpreter in *Tools* \>\> *Global Options…* \>\> *Python*.
87106

88-
## How {rgeedim} Works
89-
90-
This example shows how to extract a Google Earth Engine asset by name
91-
for an arbitrary extent. The coordinates of the bounding box are
92-
expressed in WGS84 decimal degrees (`"OGC:CRS84"`).
93-
94-
``` r
95-
library(rgeedim)
96-
#> rgeedim v0.2.7 -- using geedim 1.7.2 w/ earthengine-api 0.1.385
97-
```
107+
## Authentication & Initialization
98108

99109
If this is your first time using any Google Earth Engine tools,
100110
authenticate with `gd_authenticate()`. You can pass arguments to use
@@ -119,7 +129,7 @@ gd_authenticate(auth_mode = "gcloud")
119129
In each R session you will need to initialize the Earth Engine library.
120130

121131
``` r
122-
gd_initialize()
132+
gd_initialize(project = "rgeedim-demo")
123133
```
124134

125135
Note that with `auth_mode="gcloud"` you need to specify the project via
@@ -168,7 +178,7 @@ where data are available).
168178

169179
``` r
170180
library(terra)
171-
#> terra 1.7.65
181+
#> terra 1.8.25
172182
f <- rast(x)
173183
f
174184
#> class : SpatRaster
@@ -194,7 +204,7 @@ calculate some terrain derivatives (slope, aspect) and a hillshade.
194204
library(rgeedim)
195205
library(terra)
196206

197-
gd_initialize()
207+
gd_initialize(project = "rgeedim-demo")
198208

199209
b <- gd_bbox(
200210
xmin = -120.296,
@@ -260,7 +270,7 @@ library(rgeedim)
260270
library(terra)
261271

262272
# search and download from USGS 1m lidar data collection
263-
gd_initialize()
273+
gd_initialize(project = "rgeedim-demo")
264274

265275
# wkt->SpatVector->GeoJSON
266276
b <- 'POLYGON((-121.355 37.56,-121.355 37.555,
@@ -279,10 +289,9 @@ a <- "USGS/3DEP/1m" |>
279289

280290
# inspect individual image metadata in the collection
281291
gd_properties(a)
282-
#> id
283-
#> 1 USGS/3DEP/1m/USGS_1M_10_x64y416_CA_UpperSouthAmerican_Eldorado_2019_B19
284-
#> date
285-
#> 1 2006-01-01
292+
#> id date
293+
#> 1 USGS/3DEP/1m/USGS_1M_10_x64y416_CA_SanJoaquin_2021_A21 2006-01-01
294+
#> 2 USGS/3DEP/1m/USGS_1M_10_x64y416_CA_UpperSouthAmerican_Eldorado_2019_B19 2006-01-01
286295

287296
# resampling images as part of composite; before download
288297
x <- a |>
@@ -317,7 +326,7 @@ in the `geedim` manual.
317326
library(rgeedim)
318327
library(terra)
319328

320-
gd_initialize()
329+
gd_initialize(project = "rgeedim-demo")
321330

322331
b <- gd_bbox(
323332
xmin = -120.296,
@@ -339,16 +348,11 @@ x <- 'LANDSAT/LE07/C02/T1_L2' |>
339348

340349
# inspect individual image metadata in the collection
341350
gd_properties(x)
342-
#> id date fill cloudless grmse
343-
#> 1 LANDSAT/LE07/C02/T1_L2/LE07_043034_20201130 2020-11-30 86.41 99.98 4.92
344-
#> 2 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210101 2021-01-01 86.85 98.89 4.79
345-
#> 3 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210117 2021-01-17 86.05 99.93 5.44
346-
#> 4 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210218 2021-02-18 85.66 99.91 5.73
347-
#> saa sea
348-
#> 1 151.45 25.21
349-
#> 2 148.07 22.47
350-
#> 3 145.16 23.71
351-
#> 4 138.46 30.91
351+
#> id date fill cloudless grmse saa sea
352+
#> 1 LANDSAT/LE07/C02/T1_L2/LE07_043034_20201130 2020-11-30 86.41 99.98 4.92 151.45 25.21
353+
#> 2 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210101 2021-01-01 86.85 98.89 4.79 148.07 22.47
354+
#> 3 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210117 2021-01-17 86.05 99.93 5.44 145.16 23.71
355+
#> 4 LANDSAT/LE07/C02/T1_L2/LE07_043034_20210218 2021-02-18 85.66 99.91 5.73 138.46 30.91
352356

353357
# download a single image, no compositing
354358
y <- gd_properties(x)$id[1] |>
@@ -396,9 +400,9 @@ plot(rast(z)[[1:4]])
396400

397401
<img src="man/figures/README-landsat7-qmosaic-1.jpeg" width="100%" />
398402

399-
The `"q-mosaic"` method produces a composite (largely) free of artifacts
400-
in this case; this is because it prioritizes pixels with higher distance
401-
from clouds to fill in the gaps. Other methods are available such as
402-
`"medoid"`; this may give better results when compositing more
403-
contrasting inputs such as several dates over a time period where
404-
vegetation or other cover changes appreciably.
403+
The `"q-mosaic"` method produces a composite largely free of artifacts;
404+
this is because it prioritizes pixels with higher distance from clouds
405+
to fill in the gaps. Other methods are available such as `"medoid"`;
406+
this may give better results when compositing more contrasting inputs
407+
such as several dates over a time period where vegetation or other cover
408+
changes appreciably.
338 Bytes
Loading

man/figures/README-inspect-1.jpeg

2.03 KB
Loading
13.8 KB
Loading
-2.18 KB
Loading
-1.32 KB
Loading

0 commit comments

Comments
 (0)