/
index.html
416 lines (341 loc) · 11.1 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(sotm-pdx.css);
.big {
font-size: 128px;
}
.caption {
font-size: 96px;
text-align: center;
text-shadow: 0px 2px 6px rgba(0,0,0,.5);
}
.caption-small {
font-size: 76px;
text-align: center;
text-shadow: 0px 2px 6px rgba(0,0,0,.5);
}
.caption-smaller {
font-size: 56px;
text-align: center;
text-shadow: 0px 2px 6px rgba(0,0,0,.5);
}
</style>
<body class="overview">
<!-- slide for while people gather :) -->
<section style="background: #222 url(images/mapnik_cape.jpg); background-repeat:no-repeat; background-position:center center;">
</section>
<section>
<h1 class="caption">New Features in Mapnik >= 2.1</h1>
<!--
<iframe width='100%' height='60%' frameBorder='0' src='http://a.tiles.mapbox.com/v3/examples.map-4l7djmvo.html#13.00/45.5154/-122.6752'></iframe>
-->
<h1 class="caption-small">Artem Pavlenko & Dane Springmeyer</h1>
<h1 class="caption-smaller">SOTM US PDX 2012</h1>
</section>
<section>
<h3>What is Mapnik?</h3>
<ul>
<li>Cross platform</li>
<li>High performance</li>
<li>C++ map renderer</li>
</ul>
</section>
<section>
<h3>What is Mapnik?</h3>
<ul>
<li>About having fun, making beautiful maps using open data</li>
</ul>
</section>
<section>
<h3>What is Mapnik?</h3>
<ul>
<li>tile.osm.org, mapquest.com, maps.stamen.org, mapbox.com, cartodb and hundreds more…</li>
</ul>
</section>
<section>
<h3>Artem:</h3>
<p>scale_factor, vertex converters, image-filters, vector output</p>
<h3>Dane:</h3>
<p>compositing, svg, new datasources</p>
</section>
<section style="background: #222 url(images/durdle-door.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Scale factor</h1>
</section>
<section>
<p>Supported across all backends (AGG, Cairo etc)</p>
</section>
<section>
<p>Supported across all backends (AGG, Cairo etc)</p>
<p>Printing, retina display, ???</p>
</section>
<section style="background-image:url(images/map-scale-factor-1.png);
background-size:100%;background-repeat:no-repeat; background-position:center center; ">
</section>
<section style="background-image:url(images/map-scale-factor-2.png); background-repeat:no-repeat;
background-size:100%; background-position:center center;">
</section>
<section style="background-image:url(images/map-scale-factor-3.png); background-repeat:no-repeat;
background-size:100%;background-position:center center;">
</section>
<section style="background-image:url(images/map-scale-factor-4.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
</section>
<section style="background-image:url(images/map-scale-factor-5.png); background-repeat:no-repeat; background-position:center center;background-size:100%;">
</section>
<section style="background-image:url(images/map-scale-factor-6.png); background-repeat:no-repeat; background-position:center center;background-size:100%;">
</section>
<section style="background: #222 url(images/dunes.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Vertex converters</h1>
</section>
<section style="background: #222 url(images/dunes.jpg); background-repeat:no-repeat; background-position:center center;">
<p>Efficient, flexible rendering pipelines with complex transformations</p>
</section>
<section>
<ul>
<li>coordinate transforms</li>
<li>clipping</li>
<li>smoothing</li>
<li>offsetting</li>
<li>simplifying</li>
</ul>
</section>
<section>
<p>Simplification algorithms:</p>
<ul>
<li>Radial distance</li>
<li>Visvalingam-Whyatt</li>
<li>Zhao-Saalfeld</li>
</ul>
</section>
<section style="background: #222 url(images/map-simplify-0.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Original</h1>
</section>
<section style="background: #222 url(images/map-simplify-1.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Simplify</h1>
</section>
<section style="background: #222 url(images/map-simplify-2.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Simplify a bit more..</h1>
</section>
<section style="background: #222 url(images/map-simplify-smooth.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Smooth</h1>
</section>
<section style="background: #222 url(images/map-simplify-smooth-transform.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">translate(10 10) <br/>and blur</h1>
</section>
<section style="background: #222 url(images/horses.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Image filters</h1>
</section>
<section>
<p>Familiar concept - ImageMagick, GIMP, Photoshop</p>
</section>
<section>
<p>Familiar concept - ImageMagick, GIMP, Photoshop</p>
<p>Now can be used directly in Mapnik</p>
</section>
<section>
<p>Familiar concept - ImageMagick, GIMP, Photoshop</p>
<p>Now can be used directly in Mapnik</p>
<p>Chaining</p>
</section>
<section>
<ul>
<li>emboss</li>
<li>blur</li>
<li>gray</li>
<li>edge_detect</li>
<li>sobel</li>
<li>sharpen</li>
<li>x/y gradient</li>
<li>invert</li>
<li>agg-stack-blur</li>
</ul>
</section>
<section style="background: #222 url(images/map-blur-dodge.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Blur</h1>
</section>
<section style="background: #222 url(images/map-emboss.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Emboss</h1>
</section>
<section style="background: #222 url(images/map-emboss-blur-gradient.png); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Emboss + blur + gradient</h1>
</section>
<section style="background: #222 url(images/corfe-castle-2.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Vector output</h1>
</section>
<section>
<h2>GeoJSON</h2>
<pre>
>>> f.to_geojson()
...
{"type":"Feature","id":1,
"geometry": {"type":"Point",
"coordinates":[-13656028.9,5703798.9]},
"properties":{"name":"Portland",
"osm_id":1666626393,"place":"city"}}'
</pre>
</section>
<section>
<h2>WKT</h2>
<pre>
>>> f.geometries().to_wkt()
...
Point(-13656028.907842 5703798.985657)
</pre>
</section>
<section>
<h2>WKB</h2>
<pre>
>>> bo = mapnik.wkbByteOrder.XDR
>>> f.geometries().to_wkb(bo)
...
'\x00\x00\x00\x00\x01\xc1j\x0b\xfb\x9d\r\nuAU\xc2\x1d\xbf\x14\xff\x8c'
</pre>
</section>
<section>
<h2>SVG</h2>
<pre>
>>> f.geometries().to_svg()
...
cx="-13656028.907842" cy="5703798.985657"
</pre>
</section>
<section style="background: #222 url(images/sunset.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Compositing</h1>
</section>
<section>
<h1>Style Level Compositing</h1>
<h3>(whole canvas)</h3>
<pre>
<Style comp-op="color-burn">
...
</Style>
</pre>
</section>
<section>
<h1>Style Level Opacity</h1>
<h3>(whole canvas)</h3>
<pre>
<Style opacity=".5">
...
</Style>
</pre>
</section>
<section>
<h1>Feature Level</h1>
<h3>(each shape against canvas)</h3>
<pre>
<Style>
<Rule>
<LineSymbolizer comp-op="multiply"/>
</Rule>
</Style>
</pre>
</section>
<section style="background: #222 url(images/trees-cabs-crime.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
</section>
<section style="background: #222 url(images/gclass-without.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
<h1 class="caption">No compositing</h1>
</section>
<section style="background: #222 url(images/gclass-with-compositing.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
<h1 class="caption">style-level opacity + blur + hard-light/tint-bands</h1>
</section>
<section style="background: #222 url(images/gclass-with-compositing-terrain.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
<h1 class="caption">+terrain</h1>
</section>
<section style="background: #222 url(images/difference-paper-smooth.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
</section>
<section style="background: #222 url(images/windmill.jpg); background-repeat:no-repeat; background-position:center center; background-size:100%;">
<h1 class="caption">SVG and Marker Advances</h1>
</section>
<section>
<h1>Dynamically transform Markers</h1>
<pre>
marker-transform="scale(2),
rotate([FIELD]),
translate(2,2)"
</pre>
<p>^^ CartoCSS</p>
</section>
<section style="background: #222 url(images/marker-data-driven.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
</section>
<section>
<h1>Dynamically restyle SVG</h1>
<ul>
<li>opacity, fill-opacity, stroke-opacity</li>
<li>fill and stroke color</li>
<li>width/height in px</li>
</ul>
</section>
<section style="background: #222 url(images/octocat-expressions.png); background-repeat:no-repeat; background-position:center center; background-size:100%;">
</section>
<section>
<h3>SVG restyling also works with compositing, image-filters</h3>
</section>
<section style="background: #222 url(images/octo-mask.png); background-repeat:no-repeat; background-position:center center;">
</section>
<section style="background: #222 url(images/tomatoes.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">New Datasource Plugins</h1>
</section>
<section>
<h1>CSV</h1>
<ul>
<li>destroys myth: mapnik needs a database</li>
<li>extremely fast for small and medium sized data</li>
<li>supports geodata in x,y fields or WKT/GeoJSON</li>
</ul>
</section>
<section>
<h1>CSV</h1>
<pre>
>>> import mapnik
>>> csv_string = '''wkt,name
... "POINT(-122.663,45.528)","PDX"'''
>>> ds = mapnik.Datasource(**
... { "type":"csv",
... "inline":csv_string
... })
</pre>
</section>
<section>
<h1>Python</h1>
<ul>
<li>stream your data from anywhere</li>
<li>mapnik calls into python, iterator returns features</li>
</ul>
</section>
<section>
<h1>Python</h1>
<pre>
<Datasource>
<Parameter name="type">
python
</Parameter>
<Parameter name="factory">
python_file:python_func
</Parameter>
</Datasource>
</pre>
</section>
<section>
<h1>GeoJSON</h1>
<ul>
<li>Ultra optimized - faster than reading via OGR</li>
<li>Building block code for remote, tiled json datasource</li>
</ul>
</section>
<section style="background: #222 url(images/bird_watching.jpg); background-repeat:no-repeat; background-position:center center;">
<h1 class="caption">Looking to the future</h1>
</section>
<section>
<h1>What's next?</h1>
<ul>
<li>Direct .osm/.pbf read support</li>
<li>High performance datasource formats (tiled?)</li>
<li>Support for every world language</li>
</ul>
</section>
<section>
<h1 class="caption">Join us on <br/> github.com/mapnik <br><br> Thank you!</h1>
</section>
<script src="d3.v2.js?2.7.3"></script>
<script src="stack.v0.js"></script>