Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added guidance on conda and a Python IDE; changed tutorial numbering #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
author: "David Swinkels"
contributors: "Andrei Mirt"
date: "`r format(Sys.time(), '%d %B, %Y')`"
pagetitle: "Lesson 12: Google Earth Engine"
pagetitle: "Lesson 8: Google Earth Engine"
output:
knitrBootstrap::bootstrap_document:
theme: "simplex"
Expand All @@ -14,7 +14,7 @@ output:

# [WUR Geoscripting](https://geoscripting-wur.github.io/) <img src="https://www.wur.nl/upload/5e55a1d9-47c3-4149-9384-26d5147ee2d7_WUR_RGB_standard.png" alt="WUR logo" style="height: 35px;"/>

# Week 3, Lesson 12: Google Earth Engine
# Week 2, Lesson 8: Google Earth Engine

Good morning! Today we will start working with Google Earth Engine.

Expand Down Expand Up @@ -85,15 +85,16 @@ This [presentation](https://docs.google.com/presentation/d/1MVVeyCdm-FrMVRPop6wB

Earth Engine normally uses Python 2.7. However Earth Engine is trying to make code compatible for both Python 2 and Python 3. Since Python 3 is the future, we will use Python 3. Your Google account needs to be accepted to authenticate your local Earth Engine Python module. So we need to setup the Python environment and get authenticated:

```{block2, type="alert alert-warning"}
**Warning:** The code below will likely not work without running some scripts in your Linux VM. Please first go to [the Python Refresher of next week](https://geoscripting-wur.github.io/PythonRefresher/) and follow the steps under 'Conda installation'.
```

```{r, engine = 'bash', eval = FALSE}
# Create Conda environment
conda create -n ee_py3 -c conda-forge python=3 google-api-python-client pyCrypto spyder jupyter

source activate ee_py3

# Ensure that a crypto library is available
python -c "from oauth2client import crypt"

# Install earthengine-api
pip install earthengine-api

Expand All @@ -108,6 +109,10 @@ python -c "import ee; ee.Initialize()"

After setting up the Python environment, you can start a jupyter notebook or spyder and run some Python code.

```{block2, type="alert alert-info"}
ProTip: Don't know how to start Spyder or a Jupyter Notebook? Take a look at [the Python Refresher of next week](https://geoscripting-wur.github.io/PythonRefresher/).
```

```{r, engine = 'python', eval = FALSE}
# Import the Earth Engine Python Package
import ee
Expand Down
33 changes: 22 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="David Swinkels" />
<title>Lesson 12: Google Earth Engine</title>
<style>
<title>Lesson 8: Google Earth Engine</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- jQuery -->
Expand Down Expand Up @@ -875,7 +872,7 @@
<div class="row row-offcanvas row-offcanvas-right">
<div class="contents col-xs-12 col-md-10">
<h1 id="wur-geoscripting"><a href="https://geoscripting-wur.github.io/">WUR Geoscripting</a> <img src="https://www.wur.nl/upload/5e55a1d9-47c3-4149-9384-26d5147ee2d7_WUR_RGB_standard.png" alt="WUR logo" style="height: 35px;"/></h1>
<h1 id="week-3-lesson-12-google-earth-engine">Week 3, Lesson 12: Google Earth Engine</h1>
<h1 id="week-2-lesson-8-google-earth-engine">Week 2, Lesson 8: Google Earth Engine</h1>
<p>Good morning! Today we will start working with Google Earth Engine.</p>
<!--

Expand Down Expand Up @@ -908,7 +905,7 @@ <h2 id="what-does-google-earth-engine-do">What does Google Earth Engine do?</h2>
</ul>
<h2 id="google-earth-engine-code-editor-in-javascript">Google Earth Engine: Code Editor in JavaScript</h2>
<p>Today you will learn about Google Earth Engine by going through 9 tutorials made by Google. In the morning you will work on these tutorials. Have fun working in the cloud!</p>
<ol type="1">
<ol style="list-style-type: decimal">
<li><a href="https://developers.google.com/earth-engine/tutorial_js_01">Get familiar with basic JavaScript syntax</a></li>
<li><a href="https://developers.google.com/earth-engine/tutorial_js_02">Get familiar with advanced JavaScript syntax</a></li>
<li><a href="https://developers.google.com/earth-engine/playground">Get familiar with the Code Editor</a></li>
Expand Down Expand Up @@ -942,6 +939,13 @@ <h2 id="google-earth-engine-python-api">Google Earth Engine: Python API</h2>
<p>This <a href="https://docs.google.com/presentation/d/1MVVeyCdm-FrMVRPop6wB3iyd85TAlwB-F9ygTQZ8S1w/pub?slide=id.g1e419debf0_1_205">presentation</a> on the Earth Engine user summit explains more about the Python API.</p>
<p>Earth Engine normally uses Python 2.7. However Earth Engine is trying to make code compatible for both Python 2 and Python 3. Since Python 3 is the future, we will use Python 3. Your Google account needs to be accepted to authenticate your local Earth Engine Python module. So we need to setup the Python environment and get authenticated:</p>
<div class="row">

<div class="alert alert-warning">
<strong>Warning:</strong> The code below will likely not work without running some scripts in your Linux VM. Please first go to <a href="https://geoscripting-wur.github.io/PythonRefresher/">the Python Refresher of next week</a> and follow the steps under ‘Conda installation’.
</div>

</div>
<div class="row">
<button class="source bash toggle btn btn-xs btn-primary">
<span class="glyphicon glyphicon-chevron-down"></span> bash source
</button>
Expand All @@ -966,6 +970,13 @@ <h2 id="google-earth-engine-python-api">Google Earth Engine: Python API</h2>
</div>
<p>After setting up the Python environment, you can start a jupyter notebook or spyder and run some Python code.</p>
<div class="row">

<div class="alert alert-info">
ProTip: Don’t know how to start Spyder or a Jupyter Notebook? Take a look at <a href="https://geoscripting-wur.github.io/PythonRefresher/">the Python Refresher of next week</a>.
</div>

</div>
<div class="row">
<button class="source python toggle btn btn-xs btn-primary">
<span class="glyphicon glyphicon-chevron-down"></span> python source
</button>
Expand Down