Skip to content

Commit 53cd859

Browse files
author
Leah Wasser
authored
Merge pull request #855 from earthlab/ea-wk04
Ea wk04 - update links and time series cleanup
2 parents bddd1a6 + bc4cbeb commit 53cd859

File tree

29 files changed

+106
-115
lines changed

29 files changed

+106
-115
lines changed

_posts/courses/earth-analytics-python/02-intro-to-lidar-and-raster/interactive-maps/2018-02-05-maps02-interactive.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ topics:
2424

2525
{% include toc title="In This Lesson" icon="file-text" %}
2626

27-
This tutorial walks you through how to create interactive maps with `Python` in `Jupyter Notebook` using the `folium` package and how to overlay a raster on an interactive map created with `folium`.
27+
This tutorial walks you through how to create interactive maps with `Python` in `Jupyter Notebook` using the `folium` package and how to overlay a raster on an interactive map created with `folium`.
2828

2929
<div class='notice--success' markdown="1">
3030

@@ -33,7 +33,7 @@ This tutorial walks you through how to create interactive maps with `Python` in
3333
After completing this tutorial, you will be able to:
3434

3535
* Create interactive map in `Jupyter Notebook` using the `folium` package for `Python`
36-
* Overlay a raster on an interactive map created with `folium`
36+
* Overlay a raster on an interactive map created with `folium`
3737

3838
## <i class="fa fa-check-square-o fa-2" aria-hidden="true"></i> What You Need
3939

@@ -43,33 +43,33 @@ You will need a computer with internet access to complete this lesson.
4343

4444
## Why Use Interactive Maps
4545

46-
Interactive Maps are useful for earth data science because they:
46+
Interactive Maps are useful for earth data science because they:
4747

4848
* Clearly convey complex information
49-
* Are more engaging for viewers than static maps
50-
* Can be seamlessly integrated into `Jupyter Notebooks`
49+
* Are more engaging for viewers than static maps
50+
* Can be seamlessly integrated into `Jupyter Notebooks`
5151

52-
There are two great `Python` packages for creating interactive maps: `folium` and `mapboxgl`. Both of these packages are build on top off the `javascript` library called `leaflet.js`.
52+
There are two great `Python` packages for creating interactive maps: `folium` and `mapboxgl`. Both of these packages are build on top off the `javascript` library called `leaflet.js`.
5353

54-
This lesson will focus on `folium`, which has been around longer than `mapboxgl` and thus, is well-documented by the `Python` community.
54+
This lesson will focus on `folium`, which has been around longer than `mapboxgl` and thus, is well-documented by the `Python` community.
5555

5656
One major difference between the two packages is that `mapboxgl` requires a MapBox Access Token. If you are interested in exploring `mapboxgl` on your own, note that the MapBox Access token is free to use, but does require making an account with MapBox. You can find more information on the <a href="https://github.com/mapbox/mapboxgl-jupyter" target="_blank">Github page for this package</a>.
5757

5858

5959
## What is an API?
6060

61-
An API (or application programming interface) is an interface that opens a computer-based system to external requests and simplifies certain tasks, such as extracting subsets of data from a large repository or database.
61+
An API (or application programming interface) is an interface that opens a computer-based system to external requests and simplifies certain tasks, such as extracting subsets of data from a large repository or database.
6262

63-
For example, web-based APIs allow you to access data available using web-based interfaces that are separate from the API that you are accessing. Thus, web APIs are a way to avoid the extraneous visual interfaces that you do not need and get the desired data into the tool that you want to use.
63+
For example, web-based APIs allow you to access data available using web-based interfaces that are separate from the API that you are accessing. Thus, web APIs are a way to avoid the extraneous visual interfaces that you do not need and get the desired data into the tool that you want to use.
6464

65-
Often, you access data from web-based APIs using a URL that contains sets of parameters that specifies the type and particular subset of data that you are interested in. You will learn more about using APIs later in this course.
65+
Often, you access data from web-based APIs using a URL that contains sets of parameters that specifies the type and particular subset of data that you are interested in. You will learn more about using APIs later in this course.
6666

67-
For this lesson, you simply need to know that the basemaps that you will access to create your interactive maps come from APIs that are provided by various organizations such as OpenStreetMap, MapBox, Stamen, Google, etc.
67+
For this lesson, you simply need to know that the basemaps that you will access to create your interactive maps come from APIs that are provided by various organizations such as OpenStreetMap, MapBox, Stamen, Google, etc.
6868

6969
{:.input}
7070
```python
7171
# Import necessary packages
72-
import os
72+
import os
7373
import folium
7474
from folium import plugins
7575
import rasterio as rio
@@ -84,7 +84,7 @@ os.chdir(os.path.join(et.io.HOME, 'earth-analytics'))
8484

8585
## Simple Basemap
8686

87-
You can make an interactive map with `folium` using just one line of code!
87+
You can make an interactive map with `folium` using just one line of code!
8888

8989
You can use the `Map()` function from `folium` and providing a latitude and longitude to center the map. The map is created using the default basemap from OpenStreetMap.
9090

@@ -110,7 +110,7 @@ m
110110

111111
### Change Basemap
112112

113-
You can change the basemap for the map by providing a value for the `tiles` parameter of the `Map()` function.
113+
You can change the basemap for the map by providing a value for the `tiles` parameter of the `Map()` function.
114114

115115
There are many different options including `Stamen Terrain`, `Stamen Toner` and `cartodbpositron`. More details and basemaps names available on the <a href="http://python-visualization.github.io/folium/modules.html#folium.map.Layer" target="_blank">Folium Documentation</a> for the `Map()` function.
116116

@@ -137,12 +137,12 @@ m
137137

138138
### Add Markers
139139

140-
You can also add markers to label specific points on top of a `folium` basemap, such as the coordinates that are being used to center the map. You can even add a pop-up label for the marker that is activated when you click on it.
140+
You can also add markers to label specific points on top of a `folium` basemap, such as the coordinates that are being used to center the map. You can even add a pop-up label for the marker that is activated when you click on it.
141141

142142
{:.input}
143143
```python
144144
# Create a map using Stamen Terrain, centered on Boulder, CO
145-
m = folium.Map(location=[40.0150, -105.2705],
145+
m = folium.Map(location=[40.0150, -105.2705],
146146
tiles = 'Stamen Terrain')
147147

148148
# Add marker for Boulder, CO
@@ -169,20 +169,20 @@ m
169169

170170
## Raster Overlay on Interactive Map
171171

172-
You can also overlay rasters on `folium` basemaps.
172+
You can also overlay rasters on `folium` basemaps.
173173

174-
The default coordinate system and projection for web-based basemaps is WGS84 Web Mercator. To overlay data on web-based basemaps, the overlay data needs to be in the WGS84 coordinate system (<a href= "http://spatialreference.org/ref/epsg/wgs-84/" target="_blank">see this link for more information on this coordinate system</a>).
174+
The default coordinate system and projection for web-based basemaps is WGS84 Web Mercator. To overlay data on web-based basemaps, the overlay data needs to be in the WGS84 coordinate system (<a href= "http://spatialreference.org/ref/epsg/wgs-84/" target="_blank">see this link for more information on this coordinate system</a>).
175175

176176
Thus, to overlay a raster on a basemap, you first need to project the raster to WGS84 (EPSG 4326).
177177

178178
### Project Raster
179179

180-
You can use the `rasterio` package, which you imported as rio, to project a raster. In this example, you will use a raster for a post-flood digital terrain model (DTM) in the Northwest Boulder area: `post_DTM.tif`.
180+
You can use the `rasterio` package, which you imported as rio, to project a raster. In this example, you will use a raster for a post-flood digital terrain model (DTM) in the Northwest Boulder area: `post_DTM.tif`.
181181

182182
{:.input}
183183
```python
184184
# Create variables for destination coordinate system and the name of the projected raster
185-
dst_crs = 'EPSG:4326'
185+
dst_crs = 'EPSG:4326'
186186
out_path = 'data/colorado-flood/spatial/boulder-leehill-rd/outputs/reproj_post_DTM.tif'
187187

188188

@@ -197,7 +197,7 @@ with rio.open('data/colorado-flood/spatial/boulder-leehill-rd/post-flood/lidar/p
197197
'width': width,
198198
'height': height
199199
})
200-
200+
201201

202202
# Use rasterio package as rio to write out the new projected raster
203203
# Code uses loop to account for multi-band rasters
@@ -233,7 +233,7 @@ m = folium.Map(location=[40.06, -105.30],
233233
tiles='Stamen Terrain', zoom_start = 13)
234234

235235
# Overlay raster called img using add_child() function (opacity and bounding box set)
236-
m.add_child(folium.raster_layers.ImageOverlay(img[0], opacity=.7,
236+
m.add_child(folium.raster_layers.ImageOverlay(img[0], opacity=.7,
237237
bounds =[[40.05577828237005, -105.32837712340124], [40.073923431943214, -105.28139535136515]]))
238238

239239
# Display map
@@ -253,7 +253,7 @@ m
253253

254254
<div class="notice--warning" markdown="1">
255255

256-
## <i class="fa fa-pencil-square-o" aria-hidden="true"></i> Optional Challenge
256+
## <i class="fa fa-pencil-square-o" aria-hidden="true"></i> Optional Challenge
257257

258258
Update the previously created map with the following characteristics:
259259
* change the basemap to `Stamen Toner`

_posts/courses/earth-analytics-python/03-spatial-data/2018-02-05-spatial-data-landing-page.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Introduction to Shapefiles and Vector Data in Open Source Python - Spati
55
permalink: /courses/earth-analytics-python/spatial-data-vector-shapefiles/
66
week-landing: 3
77
week: 3
8-
modified: 2020-02-01
8+
modified: 2020-02-06
99
sidebar:
1010
nav:
1111
comments: false
@@ -18,6 +18,7 @@ module-type: 'session'
1818

1919

2020

21+
2122
<div class="notice--info" markdown="1">
2223

2324
## <i class="fa fa-ship" aria-hidden="true"></i> Welcome to Week {{ page.week }}!
@@ -51,22 +52,19 @@ You can also download the data using the link below.
5152

5253
### The Homework Assignment for This Week Can Be Found on Github
5354

54-
5555
<a href="https://github.com/earthlab-education/ea-python-2020-03-spatial-vector-template" target="_blank">Click here to view the GitHub Repo with the assignment template. </a>
5656

5757
The lessons for this week have been moved to our <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/">Intermediate Earth Analytics Textbook. </a>
5858

5959
Please read the following chapters to support completing this week's assignment:
60-
* <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/courses/use-data-open-source-python/intro-vector-data-python/">Chapters 5-6 - Introduction to vector data- spatial data in open source python </a>
60+
* <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/intro-vector-data-python/">Chapters 2-3 - Introduction to vector data- spatial data in open source python </a>
6161

6262
</div>
6363

6464

6565

6666

6767

68-
69-
7068
{:.output}
7169
Downloading from https://ndownloader.figshare.com/files/12459464
7270
Extracted output to /root/earth-analytics/data/spatial-vector-lidar/.

_posts/courses/earth-analytics-python/04-raster-vector-extract-data/2018-06-15-lidar-remote-sensing-uncertainty-landing-page.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ category: courses
44
title: "Lidar Remote Sensing Uncertainty - Compare Ground to Lidar Measurements of Tree Height in Python"
55
permalink: /courses/earth-analytics-python/lidar-remote-sensing-uncertainty/
66
week-landing: 4
7-
modified: 2020-02-05
7+
modified: 2020-02-06
88
week: 4
99
sidebar:
1010
nav:
@@ -43,7 +43,7 @@ The lessons for this week have been moved to our <a href="https://www.earthdatas
4343

4444
Please read the following chapters to support completing this week's assignment:
4545
* <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/spatial-data-applications/lidar-remote-sensing-uncertainty/">NEW: Raster / Vector Spatial Data Applications: Compare Lidar to Human Measured Tree Heights -- Uncertainty</a>
46-
* <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/courses/use-data-open-source-python/intro-vector-data-python/">REVIEW: Intro to Vector Spatial Data in Open Source Python</a>
46+
* <a href="https://www.earthdatascience.org/courses/use-data-open-source-python/intro-vector-data-python/">REVIEW: Intro to Vector Spatial Data in Open Source Python</a>
4747

4848

4949
### 1. Readings

0 commit comments

Comments
 (0)