Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdanielw committed Aug 17, 2022
2 parents 6ced3b4 + b9b688b commit bb8745a
Show file tree
Hide file tree
Showing 115 changed files with 38,727 additions and 25,715 deletions.
4 changes: 2 additions & 2 deletions demos/cloud-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ npm install

[Create and authorize a Service
Account](https://developers.google.com/earth-engine/service_account), and put
your `privatekey.json` file in the project root folder. Next, test the endpoint
(Cloud Function) script locally:
your `.private-key.json` file in the project root folder. Next, test the
endpoint (Cloud Function) script locally:

```
npm test
Expand Down
2 changes: 1 addition & 1 deletion demos/cloud-functions/function.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const hexGrid = require('@turf/hex-grid').default;
const ee = require('@google/earthengine');

const PRIVATE_KEY = require('./privatekey.json');
const PRIVATE_KEY = require('./.private-key.json');

const DEGREES_LATITUDE_TO_MILES = 69;

Expand Down
38 changes: 26 additions & 12 deletions demos/export-to-drive/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
Earth Engine Demo: Export to Drive
==================================
# Earth Engine Demo: Export to Drive

This is an example [Google App Engine](https://cloud.google.com/appengine/docs)
web app that communicates with [Google Earth Engine](https://earthengine.google.org).
It allows users to view night-time lights for different years and export drawn regions
to [Google Drive](https://www.google.com/drive/).
web app that communicates with
[Google Earth Engine](https://earthengine.google.org). It allows users to view
night-time lights for different years and export drawn regions to
[Google Drive](https://www.google.com/drive/).

Set up
------
## Set up Google Cloud command-line tools

The [gcloud](https://cloud.google.com/sdk/gcloud/) utility is needed to run an
instance of the sample app on your machine. The same utility can be helpful in
pushing things into the production App Engine cloud.

1. Download and install the [Google Cloud SDK](https://cloud.google.com/sdk/).
2. Authenticate to Google Cloud Platform by running `gcloud auth login`.
3. Configure the command line tools to use your cloud project by running:
`gcloud config set project <project-id>`

## Set up the repo

To set up yourself, download the Earth Engine API repository from GitHub:

git clone https://github.com/google/earthengine-api.git
```
git clone https://github.com/google/earthengine-api.git
```

Navigate to this demo:

cd ./earthengine-api/demos/export-to-drive/
```
cd ./earthengine-api/demos/export-to-drive/
```

Then follow the instructions in the Developer Docs to
[deploy an EE-based App Engine app](
https://developers.google.com/earth-engine/app_engine_intro#deploying-app-engine-apps-with-earth-engine).
For the credentials section, you'll need both a Service Account and an OAuth2 Client ID.
[deploy an EE-based App Engine app](https://developers.google.com/earth-engine/app_engine_intro#deploying-app-engine-apps-with-earth-engine).
For the credentials section, you'll need both a Service Account and an OAuth2
Client ID.
14 changes: 0 additions & 14 deletions demos/export-to-drive/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,3 @@ BuildDep https://github.com/sigmavirus24/uritemplate.git tags/0.3.0 uritemplate

# Build the Earth Engine Python client library.
BuildDep https://github.com/google/earthengine-api.git tags/v0.1.60 python/ee

# Install the Google App Engine command line tools.
if ! hash dev_appserver.py 2>/dev/null; then
# Install the `gcloud` command line tool.
curl https://sdk.cloud.google.com/ | bash
# Ensure the `gcloud` command is in our path.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
elif [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi
# Install the Google App Engine command line tools.
gcloud components update gae-python
fi
Empty file modified demos/export-to-drive/index.html
100644 → 100755
Empty file.
8 changes: 3 additions & 5 deletions demos/export-to-drive/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@
# The Jinja templating system we use to dynamically generate HTML. See:
# http://jinja.pocoo.org/docs/dev/
JINJA2_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=True,
extensions=['jinja2.ext.autoescape'])
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), autoescape=True)

# Check https://developers.google.com/drive/scopes for all available scopes.
OAUTH_SCOPE = 'https://www.googleapis.com/auth/drive'
Expand Down Expand Up @@ -370,8 +368,8 @@ def _GiveFilesToUser(temp_file_prefix, email, user_id, filename):
Copies and then deletes the source files from the app's Drive.
Args:
temp_file_prefix: The prefix of the temp files in the service
account's Drive.
temp_file_prefix: The prefix of the temp files in the service account's
Drive.
email: The email address of the user to give the files to.
user_id: The ID of the user to give the files to.
filename: The name to give the files in the user's Drive.
Expand Down
2 changes: 1 addition & 1 deletion demos/server-auth-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Then follow the instructions in the Developer Docs to
For the credentials section, you'll need a Service Account, not an OAuth2 Client
ID. Next:

1. Move the Service Account private key (`privatekey.json`) into the
1. Move the Service Account private key (`.private-key.json`) into the
`demos/server-auth-python` folder.
2. [Create an API key](https://developers.google.com/maps/documentation/javascript/get-api-key)
and include it in `index.html` to load Google Maps API.
Expand Down
2 changes: 1 addition & 1 deletion demos/server-auth-python/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
EE_ACCOUNT = '<YOUR-SERVICE-ACCOUNT-ID>@developer.gserviceaccount.com'

# The private key associated with your service account in JSON format.
EE_PRIVATE_KEY_FILE = 'privatekey.json'
EE_PRIVATE_KEY_FILE = '.private-key.json'

EE_CREDENTIALS = ee.ServiceAccountCredentials(EE_ACCOUNT, EE_PRIVATE_KEY_FILE)
Empty file modified demos/trendy-lights/build.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion demos/trendy-lights/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
EE_ACCOUNT = '<YOUR-SERVICE-ACCOUNT-ID>@developer.gserviceaccount.com'

# The private key associated with your service account in JSON format.
EE_PRIVATE_KEY_FILE = 'privatekey.json'
EE_PRIVATE_KEY_FILE = '.private-key.json'
6 changes: 1 addition & 5 deletions demos/trendy-lights/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
requests more quickly.
"""

from __future__ import print_function
import json
import os

Expand Down Expand Up @@ -232,9 +230,7 @@ def GetFeature(polygon_id):
# Create the Jinja templating system we use to dynamically generate HTML. See:
# http://jinja.pocoo.org/docs/dev/
JINJA2_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
autoescape=True,
extensions=['jinja2.ext.autoescape'])
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), autoescape=True)

# Initialize the EE API.
ee.Initialize(EE_CREDENTIALS)
3 changes: 0 additions & 3 deletions demos/wmts/app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

runtime: python27
api_version: 1
threadsafe: true
Expand All @@ -20,8 +19,6 @@ builtins:

handlers:



################################################################################
# App entry points
################################################################################
Expand Down
12 changes: 12 additions & 0 deletions javascript/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,15 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

====================================================================================
The following applies to MochiKit, embedded in Closure in compiled JavaScript files.
====================================================================================

Copyright (c) 2005 Bob Ippolito. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit bb8745a

Please sign in to comment.