forked from divisionblue/wur-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
224 lines (137 loc) · 4.76 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html>
<head>
<title>Python and GIS</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Roboto:300);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body{
font-family: 'Roboto';
font-weight: 300;
background: #00BCD4;
}
h1, h2, h3 {
font-weight: 500;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
.remark-slide-content {
font-size: 24px;
}
.inverse {
text-shadow: 0 0 5px #333;
background: #00BCD4;
}
.inverse h1, .inverse h2 {
color: #f3f3f3;
line-height: 0.8em;
}
</style>
</head>
<body>
<textarea id="source">
class: center, middle, inverse
# Learn yourself a Python for greater good
Nelen & Schuurmans in your area.
---
# Arjen
Developer by day. Poet by night.
---
# Fritz
Developer by day. Musician by night.
---
# Nelen & Schuurmans
https://nxt.lizard.net
---
# Outline
* Introduction.
* Use case.
* Data collection.
* Analysis.
* Presentation.
---
# Introduction
* Web vs Desktop.
* Geojson vs Shapefile.
* Programming vs. Software engineering.
---
# Python
Recently Brian Timoney and James Fee have been writing about how geospatial work is more and more programming and less GUI-driven operations in the ArcGIS mold.
They’ve been pointing a lot to Python for this.
(Tom Macwright, 2012, http://www.macwright.org/2012/10/31/gis-with-python-shapely-fiona.html)
---
# Use case
Your colleague from the social studies department wants to know the approximate height of a bunch of cities so he can investigate if there is a correlation between criminal behaviour and living below the sea level.
He thinks programming is clicking through wizards in Excel and that a big file means > 10MB.
He sends you an Excel spreadsheet with the names of the cities and expects an answer by 17:00 this afternoon. He agreed with the PR & marketing department that they will release a press release next week.
---
# Problems
## Your boss gets angry problems
* You don't which and how many cities you need to analyse or re-analyse.
* You don't know the geo-location of the cities.
* You know your department has access to the latest DEM of The Netherlands (AHN2) but it's too big to load in ArcGIS.
---
# Problems
## Your boss didn't expect you to also solve *these* problems
* The web guy from the marketing department wants to make an interactive online map and needs the data in Geojson.
* Some of the international students heard of the project and inquired if it would be possible to get the difference between the AHN2 and the world DEM they are using so they get a sense of the accuracy of the world DEM. They are nice guys so they don't ask you to do crazy stuff, just hand over a shapefile.
---
# Problems
## Your boss will suggest you for promotion problems
* Additionaly, for each city you give the major land use classes and soil types so the people in the environmental sciences departments.
* You not only give the height of each city but also the height along a line between 2 or possibly more cities; height profile graphs.
---
# Requirements
```bash
pip install requests shapely fiona
```
if you don't have `pip` installed
```bash
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
```
or check: https://pip.pypa.io/en/latest/installing.html
---
# Coding tips
* Think about code structure: tracer bullet.
* Think about your data structures.
* Write your code in independent, concise modules.
* Unix philosophy: use the right tool for the job.
---
### Data collection
#### Required
1. File with names of cities.
2. Find geocoordinate with Google API for each city.
3. Get AHN2 elevation information with Lizard API for each city.
#### Bonus
4. Get world DEM elevation information.
#### More bonus
5. Get a height profile between two or more cities.
6. Get information about landuse and soil.
---
# Analysis
1. Calculate the differences between AHN2 and world DEM.
2. (?).
---
# Presentation
1. Write as CSV.
2. Write as Geojson.
3. Write as shapefile.
4. Write as PNG.
---
# Synopsis
* Programming is no longer a specialist job.
* Data and algorithms are no longer centralised but distributed.
* Python is great as a glue, data crunching language between web, server, modeling and Desktop GIS.
* Programming is not the same as Software engineering.
---
# Code & Presentation
https://github.com/divisionblue/wur-python
</textarea>
<script src="https://gnab.github.io/remark/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>