Skip to content

Commit 6c96db5

Browse files
jdbcodeXee authors
authored andcommitted
Add install docs
PiperOrigin-RevId: 712905652
1 parent 11305d0 commit 6c96db5

File tree

3 files changed

+121
-2
lines changed

3 files changed

+121
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ import ee
3737
import xarray
3838
```
3939

40-
Next, initialize the EE client with the high volume API:
40+
Next, specify your EE-registered cloud project ID and initialize the EE client
41+
with the high volume API:
4142

4243
```python
43-
ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')
44+
ee.Initialize(
45+
project='my-project-id'
46+
opt_url='https://earthengine-highvolume.googleapis.com')
4447
```
4548

4649
Open any Earth Engine ImageCollection by specifying the Xarray engine as `'ee'`:

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ between these tools.
3030
```{toctree}
3131
:maxdepth: 1
3232
why-xee.md
33+
installation.md
3334
api.md
3435
```

docs/installation.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Installation
2+
3+
Install Xee and its dependencies using `pip` or conda-like package managers. To
4+
help minimize system disruption and package conflicts, it's recommended to use
5+
virtual environments like Python's
6+
[`venv`](https://docs.python.org/3/library/venv.html) with `pip` or [conda's
7+
integrated environment management
8+
system](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
9+
10+
Install with `pip`:
11+
12+
```shell
13+
pip install --upgrade xee
14+
```
15+
16+
Install with conda:
17+
18+
```shell
19+
conda install -c conda-forge xee
20+
```
21+
22+
## Earth Engine setup
23+
24+
Xee makes requests to [Google Earth
25+
Engine](https://developers.google.com/earth-engine/guides) for data. To use
26+
Earth Engine, you'll need to create and register a Google Cloud project,
27+
authenticate with Google, and initialize the service.
28+
29+
If you already have a Cloud project registered for Earth Engine and are familiar
30+
with Earth Engine authentication and initialization, you can skip this section.
31+
32+
**Note**: the authentication and initialization steps described in the following
33+
sections cover the majority of common system configurations and access methods,
34+
if you're having trouble, refer to the Earth Engine [Authentication and
35+
Initialization guide](https://developers.google.com/earth-engine/guides/auth).
36+
37+
### Create and register a Cloud project
38+
39+
Follow instructions in the [Earth Engine Access
40+
guide](https://developers.google.com/earth-engine/guides/access#get_access_to_earth_engine
41+
) to create and register a Google Cloud project.
42+
43+
### Authentication
44+
45+
Google needs to know who is accessing Earth Engine to determine what services
46+
are available and what permissions are granted. The goal of authentication is to
47+
establish credentials that can be used during initialization. There are several
48+
ways to verify your identity and create credentials, depending on your working
49+
environment:
50+
51+
#### Persistent environment
52+
53+
If you're working from a system with a persistent environment, such as a local
54+
computer or on-premises server, you can authenticate using the [Earth Engine
55+
command line
56+
utility](https://developers.google.com/earth-engine/guides/command_line#authenticate):
57+
58+
```shell
59+
earthengine authenticate
60+
```
61+
62+
This command opens a browser window for authentication. Once authenticated, the
63+
credentials are stored locally (`~/.config/earthengine/credentials`), allowing
64+
them to be used in subsequent initialization to the Earth Engine service. This
65+
is typically a one-time step.
66+
67+
#### Temporary environment
68+
69+
If you're working from a system like [Google Colab](https://colab.google/) that
70+
provides a temporary environment recycled after use, you'll need to authenticate
71+
every session. In this case, you can use the `earthengine-api` library
72+
(installed with Xee) to authenticate interactively:
73+
74+
```python
75+
ee.Authenticate()
76+
```
77+
78+
This method selects the most appropriate [authentication
79+
mode](https://developers.google.com/earth-engine/guides/auth#authentication_details)
80+
and guides you through steps to generate authentication credentials. Be sure to
81+
rerun the authentication process each time the environment is reset.
82+
83+
### Initialization
84+
85+
Initialization checks user authentication credentials, sets the Cloud project to
86+
use for requests, and connects the client to Earth Engine's services. At the
87+
top of your script, include one of the following expressions with the `project`
88+
argument modified to match the Google Cloud project ID enabled and registered
89+
for Earth Engine use.
90+
91+
#### High-volume endpoint
92+
93+
If you are requesting stored data (supplying a collection ID or passing an
94+
unmodified `ee.ImageCollection()` object to `xarray.open_dataset`), connect to
95+
the [high-volume
96+
endpoint](https://developers.google.com/earth-engine/guides/processing_environments#high-volume_endpoint).
97+
98+
```python
99+
ee.Initialize(
100+
project='your-project-id',
101+
opt_url='https://earthengine-highvolume.googleapis.com'
102+
)
103+
```
104+
105+
#### Standard endpoint
106+
107+
If you are requesting computed data (applying expressions to the data), consider
108+
connecting to the [standard
109+
endpoint](https://developers.google.com/earth-engine/guides/processing_environments#standard_endpoint).
110+
It utilizes caching, so it can be more efficient if you need to rerun or adjust
111+
something about the request.
112+
113+
```python
114+
ee.Initialize(project='your-project-id')
115+
```

0 commit comments

Comments
 (0)