-
Notifications
You must be signed in to change notification settings - Fork 5
/
lecture14_Mod05_a_02_a.md.slides_linked.html
1065 lines (1018 loc) · 79.9 KB
/
lecture14_Mod05_a_02_a.md.slides_linked.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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="author" content="Karl Benedict">
<title>Geography 485L/585L - Internet Mapping</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>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; position: absolute; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; }
pre.numberSource a.sourceLine:empty
{ position: absolute; }
pre.numberSource a.sourceLine::before
{ content: attr(data-line-number);
position: absolute; left: -5em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="slides.css">
<link rel="stylesheet" href="slide_specific.css">
</head>
<body>
<section class="title">
<h1 class="title">Geography 485L/585L - Internet Mapping</h1>
<footer>
<span class="author">Karl Benedict</span> · <span class="date">Spring 2018</span>
</footer>
</section>
<section class="slide level3">
<!---------------------------------------------------------------------------->
<!-- Week 14 ----------------------------------------------------------------->
<!-- Lecture 05 a 02 a ------------------------------------------------------->
<!-- Developing and Hosting OGC Services-------------------------------------->
<!-- OGC Services and Styling in GeoServer------------------------------------>
<!---------------------------------------------------------------------------->
</section>
<section id="week-14---module-5---ogc-services-and-styling-in-geoserver" class="title-slide slide level1"><h1>Week 14 - Module 5 - OGC Services and Styling in GeoServer</h1></section><section id="overview" class="slide level3">
<h3>Overview</h3>
<ul>
<li>GeoServer Styled Layer Descriptor (SLD) Foundation: OGC Specification</li>
<li>Creation and Management of Styles in GeoServer
<ul>
<li>Definition of Styles</li>
<li>Base Styles</li>
<li>Basic New Styles</li>
<li>Basic Filters</li>
</ul></li>
</ul>
</section><section id="ogc-styled-layer-descriptor-sld" class="title-slide slide level2"><h2>OGC Styled Layer Descriptor (SLD)</h2></section><section id="ogc-styled-layer-descriptor-sld-1" class="slide level3">
<h3>OGC Styled Layer Descriptor (SLD)</h3>
<ul>
<li>GeoServer uses the OGC standard for definition of symbolization both for user and server definition (<a href="http://www.opengeospatial.org/standards/sld">OGC SLD Standard</a>)</li>
<li>Most, but not all of the OGC standard has been implemented with GeoServer</li>
<li>The materials presented here are based upon the SLD reference distributed as part of the <a href="http://docs.geoserver.org/stable/en/user/index.html">Current GeoServer HTML documentation</a>, and in particular the <a href="http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html">GeoServer SLD Cookbook</a>.</li>
</ul>
</section><section id="definitionOfStyles_01" class="slide level3">
<h3>Definition of Styles</h3>
<p>Styles are XML documents that conform to the OGC SLD standard, and consist of four major components</p>
<dl>
<dt>Symbolizers</dt>
<dd>SLD components that define the rendering style of specific types of content
</dd>
</dl>
<ul>
<li><a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/pointsymbolizer.html">Point</a></li>
<li><a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/linesymbolizer.html">Line</a></li>
<li><a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/polygonsymbolizer.html">Polygon</a></li>
<li><a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/rastersymbolizer.html">Raster</a></li>
<li><a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/textsymbolizer.html">Text</a></li>
</ul>
<dl>
<dt>Labels</dt>
<dd>Defining the placement of <a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/labeling.html">labels</a>
</dd>
<dt>Filters</dt>
<dd>Allow for the application different symbolizers to <a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/filters.html">defined sets</a> of features
</dd>
<dt>Scale Elements</dt>
<dd>Allow for the application of different symbolizers at different map scales through the definition of <a href="http://docs.geoserver.org/stable/en/user/styling/sld/reference/rules.html">styling rules</a>
</dd>
</dl>
</section><section id="definitionOfStyles_03" class="slide level3">
<h3>Definition of Styles - Header Content</h3>
<div class="sourceCode" id="SLD-header-styles_01"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="SLD-header-styles_01-1" data-line-number="1"><span class="kw"><?xml</span> version="1.0" encoding="ISO-8859-1"<span class="kw">?></span></a>
<a class="sourceLine" id="SLD-header-styles_01-2" data-line-number="2"><span class="kw"><StyledLayerDescriptor</span><span class="ot"> version=</span><span class="st">"1.0.0"</span> </a>
<a class="sourceLine" id="SLD-header-styles_01-3" data-line-number="3"><span class="ot"> xsi:schemaLocation=</span><span class="st">"http://www.opengis.net/sld StyledLayerDescriptor.xsd"</span> </a>
<a class="sourceLine" id="SLD-header-styles_01-4" data-line-number="4"><span class="ot"> xmlns=</span><span class="st">"http://www.opengis.net/sld"</span> </a>
<a class="sourceLine" id="SLD-header-styles_01-5" data-line-number="5"><span class="ot"> xmlns:ogc=</span><span class="st">"http://www.opengis.net/ogc"</span> </a>
<a class="sourceLine" id="SLD-header-styles_01-6" data-line-number="6"><span class="ot"> xmlns:xlink=</span><span class="st">"http://www.w3.org/1999/xlink"</span> </a>
<a class="sourceLine" id="SLD-header-styles_01-7" data-line-number="7"><span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span><span class="kw">></span></a>
<a class="sourceLine" id="SLD-header-styles_01-8" data-line-number="8"></a>
<a class="sourceLine" id="SLD-header-styles_01-9" data-line-number="9">one or more <span class="kw"><NamedLayer></span> ... <span class="kw"></NamedLayer></span> elements</a>
<a class="sourceLine" id="SLD-header-styles_01-10" data-line-number="10"></a>
<a class="sourceLine" id="SLD-header-styles_01-11" data-line-number="11"><span class="kw"></StyledLayerDescriptor></span></a></code></pre></div>
</section><section id="definitionOfStyles_04" class="slide level3">
<h3>Definition of Styles - Sample SLD File</h3>
<p><code>point_simplepoint.sld</code></p>
<div class="sourceCode" id="sampleSLD"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="sampleSLD-1" data-line-number="1"><span class="kw"><?xml</span> version="1.0" encoding="ISO-8859-1"<span class="kw">?></span></a>
<a class="sourceLine" id="sampleSLD-2" data-line-number="2"><span class="kw"><StyledLayerDescriptor</span><span class="ot"> version=</span><span class="st">"1.0.0"</span> </a>
<a class="sourceLine" id="sampleSLD-3" data-line-number="3"><span class="ot"> xsi:schemaLocation=</span><span class="st">"http://www.opengis.net/sld StyledLayerDescriptor.xsd"</span> </a>
<a class="sourceLine" id="sampleSLD-4" data-line-number="4"><span class="ot"> xmlns=</span><span class="st">"http://www.opengis.net/sld"</span> </a>
<a class="sourceLine" id="sampleSLD-5" data-line-number="5"><span class="ot"> xmlns:ogc=</span><span class="st">"http://www.opengis.net/ogc"</span> </a>
<a class="sourceLine" id="sampleSLD-6" data-line-number="6"><span class="ot"> xmlns:xlink=</span><span class="st">"http://www.w3.org/1999/xlink"</span> </a>
<a class="sourceLine" id="sampleSLD-7" data-line-number="7"><span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span><span class="kw">></span></a>
<a class="sourceLine" id="sampleSLD-8" data-line-number="8"> <span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD-9" data-line-number="9"> <span class="kw"><Name></span>Simple Point<span class="kw"></Name></span></a>
<a class="sourceLine" id="sampleSLD-10" data-line-number="10"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="sampleSLD-11" data-line-number="11"> <span class="kw"><Title></span>SLD Cook Book: Simple Point With Stroke<span class="kw"></Title></span></a>
<a class="sourceLine" id="sampleSLD-12" data-line-number="12"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD-13" data-line-number="13"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="sampleSLD-14" data-line-number="14"> <span class="kw"><PointSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD-15" data-line-number="15"> <span class="kw"><Graphic></span></a>
<a class="sourceLine" id="sampleSLD-16" data-line-number="16"> <span class="kw"><Mark></span></a>
<a class="sourceLine" id="sampleSLD-17" data-line-number="17"> <span class="kw"><WellKnownName></span>circle<span class="kw"></WellKnownName></span></a>
<a class="sourceLine" id="sampleSLD-18" data-line-number="18"> <span class="kw"><Fill></span></a>
<a class="sourceLine" id="sampleSLD-19" data-line-number="19"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"fill"</span><span class="kw">></span>#FF0000<span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="sampleSLD-20" data-line-number="20"> <span class="kw"></Fill></span></a>
<a class="sourceLine" id="sampleSLD-21" data-line-number="21"> <span class="kw"></Mark></span></a>
<a class="sourceLine" id="sampleSLD-22" data-line-number="22"> <span class="kw"><Size></span>6<span class="kw"></Size></span></a>
<a class="sourceLine" id="sampleSLD-23" data-line-number="23"> <span class="kw"></Graphic></span></a>
<a class="sourceLine" id="sampleSLD-24" data-line-number="24"> <span class="kw"></PointSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD-25" data-line-number="25"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="sampleSLD-26" data-line-number="26"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD-27" data-line-number="27"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="sampleSLD-28" data-line-number="28"> <span class="kw"></NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD-29" data-line-number="29"><span class="kw"></StyledLayerDescriptor></span></a></code></pre></div>
</section><section id="simple-geoserver-point-style" class="slide level3">
<h3>Simple GeoServer Point Style</h3>
<figure>
<img src="images/point_simplepoint.png" alt="Sample simple styled point layer" /><figcaption>Sample simple styled point layer</figcaption>
</figure>
<p>SLD Snippet (<a href="https://github.com/UNM-GEOG-485-585/class-materials/blob/master/sample-files/SLD/point_simplepoint.sld">Full SLD</a>)</p>
<div class="sourceCode" id="sampleSLD_simplePoint"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="sampleSLD_simplePoint-1" data-line-number="1"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-2" data-line-number="2"> <span class="kw"><Name></span>Simple Point<span class="kw"></Name></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-3" data-line-number="3"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-4" data-line-number="4"> <span class="kw"><Title></span>SLD Cook Book: Simple Point With Stroke<span class="kw"></Title></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-5" data-line-number="5"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-6" data-line-number="6"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-7" data-line-number="7"> <span class="kw"><PointSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-8" data-line-number="8"> <span class="kw"><Graphic></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-9" data-line-number="9"> <span class="kw"><Mark></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-10" data-line-number="10"> <span class="kw"><WellKnownName></span>circle<span class="kw"></WellKnownName></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-11" data-line-number="11"> <span class="kw"><Fill></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-12" data-line-number="12"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"fill"</span><span class="kw">></span>#FF0000<span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-13" data-line-number="13"> <span class="kw"></Fill></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-14" data-line-number="14"> <span class="kw"></Mark></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-15" data-line-number="15"> <span class="kw"><Size></span>6<span class="kw"></Size></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-16" data-line-number="16"> <span class="kw"></Graphic></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-17" data-line-number="17"> <span class="kw"></PointSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-18" data-line-number="18"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-19" data-line-number="19"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-20" data-line-number="20"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplePoint-21" data-line-number="21"><span class="kw"></NamedLayer></span></a></code></pre></div>
</section><section id="simple-geoserver-line-style" class="slide level3">
<h3>Simple GeoServer Line Style</h3>
<figure>
<img src="images/line_simpleline.png" alt="Sample simple styled line layer" /><figcaption>Sample simple styled line layer</figcaption>
</figure>
<p>SLD Snippet (<a href="https://github.com/karlbenedict/GEOG485-585/blob/master/sample-files/SLD/point_simplepoint.sld">Full SLD</a>)</p>
<div class="sourceCode" id="sampleSLD_simpleLine"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="sampleSLD_simpleLine-1" data-line-number="1"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-2" data-line-number="2"> <span class="kw"><Name></span>Simple Line<span class="kw"></Name></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-3" data-line-number="3"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-4" data-line-number="4"> <span class="kw"><Title></span>SLD Cook Book: Simple Line<span class="kw"></Title></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-5" data-line-number="5"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-6" data-line-number="6"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-7" data-line-number="7"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-8" data-line-number="8"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-9" data-line-number="9"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span>#000000<span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-10" data-line-number="10"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span>3<span class="kw"></CssParameter></span> </a>
<a class="sourceLine" id="sampleSLD_simpleLine-11" data-line-number="11"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-12" data-line-number="12"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-13" data-line-number="13"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-14" data-line-number="14"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-15" data-line-number="15"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleLine-16" data-line-number="16"><span class="kw"></NamedLayer></span></a></code></pre></div>
</section><section id="simple-geoserver-polygon-style" class="slide level3">
<h3>Simple GeoServer Polygon Style</h3>
<figure>
<img src="images/polygon_simplepolygon.png" alt="Sample simple styled polygon layer" /><figcaption>Sample simple styled polygon layer</figcaption>
</figure>
<p>SLD Snippet (<a href="https://github.com/karlbenedict/GEOG485-585/blob/master/sample-files/SLD/polygon_simplepolygon.sld">Full SLD</a>)</p>
<div class="sourceCode" id="sampleSLD_simplepoly"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="sampleSLD_simplepoly-1" data-line-number="1"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-2" data-line-number="2"> <span class="kw"><Name></span>Simple polygon<span class="kw"></Name></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-3" data-line-number="3"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-4" data-line-number="4"> <span class="kw"><Title></span>SLD Cook Book: Simple polygon<span class="kw"></Title></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-5" data-line-number="5"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-6" data-line-number="6"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-7" data-line-number="7"> <span class="kw"><PolygonSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-8" data-line-number="8"> <span class="kw"><Fill></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-9" data-line-number="9"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"fill"</span><span class="kw">></span>#000080<span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-10" data-line-number="10"> <span class="kw"></Fill></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-11" data-line-number="11"> <span class="kw"></PolygonSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-12" data-line-number="12"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-13" data-line-number="13"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-14" data-line-number="14"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simplepoly-15" data-line-number="15"><span class="kw"></NamedLayer></span></a></code></pre></div>
</section><section id="simple-geoserver-raster-style" class="slide level3">
<h3>Simple GeoServer Raster Style</h3>
<figure>
<img src="images/raster_twocolorgradient.png" alt="Sample simple styled raster layer" /><figcaption>Sample simple styled raster layer</figcaption>
</figure>
<p>SLD Snippet (<a href="https://github.com/karlbenedict/GEOG485-585/blob/master/sample-files/SLD/raster_twocolorgradient.sld">Full SLD</a>)</p>
<div class="sourceCode" id="sampleSLD_simpleraster"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="sampleSLD_simpleraster-1" data-line-number="1"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-2" data-line-number="2"> <span class="kw"><Name></span>Two color gradient<span class="kw"></Name></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-3" data-line-number="3"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-4" data-line-number="4"> <span class="kw"><Title></span>SLD Cook Book: Two color gradient<span class="kw"></Title></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-5" data-line-number="5"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-6" data-line-number="6"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-7" data-line-number="7"> <span class="kw"><RasterSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-8" data-line-number="8"> <span class="kw"><ColorMap></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-9" data-line-number="9"> <span class="kw"><ColorMapEntry</span><span class="ot"> color=</span><span class="st">"#008000"</span> </a>
<a class="sourceLine" id="sampleSLD_simpleraster-10" data-line-number="10"><span class="ot"> quantity=</span><span class="st">"70"</span> <span class="kw">/></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-11" data-line-number="11"> <span class="kw"><ColorMapEntry</span><span class="ot"> color=</span><span class="st">"#663333"</span> </a>
<a class="sourceLine" id="sampleSLD_simpleraster-12" data-line-number="12"><span class="ot"> quantity=</span><span class="st">"256"</span> <span class="kw">/></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-13" data-line-number="13"> <span class="kw"></ColorMap></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-14" data-line-number="14"> <span class="kw"></RasterSymbolizer></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-15" data-line-number="15"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-16" data-line-number="16"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-17" data-line-number="17"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="sampleSLD_simpleraster-18" data-line-number="18"><span class="kw"></NamedLayer></span></a></code></pre></div>
</section><section id="pointsymbolizer" class="slide level3">
<h3>PointSymbolizer</h3>
<div class="sourceCode" id="pointSymbolizer"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="pointSymbolizer-1" data-line-number="1"><span class="kw"><Graphic></span></a>
<a class="sourceLine" id="pointSymbolizer-2" data-line-number="2"> <span class="kw"><ExternalGraphic></span></a>
<a class="sourceLine" id="pointSymbolizer-3" data-line-number="3"> <span class="kw"><OnlineResource></span> (Required)</a>
<a class="sourceLine" id="pointSymbolizer-4" data-line-number="4"> <span class="kw"><Format></span></a>
<a class="sourceLine" id="pointSymbolizer-5" data-line-number="5"> <span class="kw"><Mark></span></a>
<a class="sourceLine" id="pointSymbolizer-6" data-line-number="6"> <span class="kw"><WellKnownName></span> (Required)</a>
<a class="sourceLine" id="pointSymbolizer-7" data-line-number="7"> <span class="kw"><Fill></span></a>
<a class="sourceLine" id="pointSymbolizer-8" data-line-number="8"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="pointSymbolizer-9" data-line-number="9"> <span class="kw"><Opacity></span></a>
<a class="sourceLine" id="pointSymbolizer-10" data-line-number="10"> <span class="kw"><Size></span></a>
<a class="sourceLine" id="pointSymbolizer-11" data-line-number="11"> <span class="kw"><Rotation></span></a></code></pre></div>
</section><section id="linesybolizer" class="slide level3">
<h3>LineSybolizer</h3>
<div class="sourceCode" id="lineSymbolizer"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="lineSymbolizer-1" data-line-number="1"><span class="kw"><Stroke></span></a>
<a class="sourceLine" id="lineSymbolizer-2" data-line-number="2"> <span class="kw"><GraphicFill></span></a>
<a class="sourceLine" id="lineSymbolizer-3" data-line-number="3"> <span class="kw"><Graphic></span> contents same as PointSymbolizer</a>
<a class="sourceLine" id="lineSymbolizer-4" data-line-number="4"> <span class="kw"><GraphicStroke></span></a>
<a class="sourceLine" id="lineSymbolizer-5" data-line-number="5"> <span class="kw"><Graphic></span> contents same as PointSymbolizer</a>
<a class="sourceLine" id="lineSymbolizer-6" data-line-number="6"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"..."</span><span class="kw">></span></a>
<a class="sourceLine" id="lineSymbolizer-7" data-line-number="7"> name="stroke"</a>
<a class="sourceLine" id="lineSymbolizer-8" data-line-number="8"> name="stroke-width"</a>
<a class="sourceLine" id="lineSymbolizer-9" data-line-number="9"> name="stroke-opacity"</a>
<a class="sourceLine" id="lineSymbolizer-10" data-line-number="10"> name="stroke-linejoin"</a>
<a class="sourceLine" id="lineSymbolizer-11" data-line-number="11"> name="stroke-linecap"</a>
<a class="sourceLine" id="lineSymbolizer-12" data-line-number="12"> name="stroke-dasharray"</a>
<a class="sourceLine" id="lineSymbolizer-13" data-line-number="13"> name="stroke-dashoffset"</a></code></pre></div>
</section><section id="polygonsymbolizer" class="slide level3">
<h3>PolygonSymbolizer</h3>
<div class="sourceCode" id="polySymbolizer"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="polySymbolizer-1" data-line-number="1"><span class="kw"><Fill></span></a>
<a class="sourceLine" id="polySymbolizer-2" data-line-number="2"> <span class="kw"><GraphicFill></span></a>
<a class="sourceLine" id="polySymbolizer-3" data-line-number="3"> <span class="kw"><Graphic></span> contents same as PointSymbolizer</a>
<a class="sourceLine" id="polySymbolizer-4" data-line-number="4"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"..."</span><span class="kw">></span></a>
<a class="sourceLine" id="polySymbolizer-5" data-line-number="5"> name="fill"</a>
<a class="sourceLine" id="polySymbolizer-6" data-line-number="6"> name="fill-opacity"</a>
<a class="sourceLine" id="polySymbolizer-7" data-line-number="7"> <span class="kw"><Stroke></span> same as the LineSymbolizer</a></code></pre></div>
</section><section id="raster-symbolizer" class="slide level3">
<h3>Raster Symbolizer</h3>
<div class="sourceCode" id="rasterSymbolizer"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="rasterSymbolizer-1" data-line-number="1"><span class="kw"><Opacity></span></a>
<a class="sourceLine" id="rasterSymbolizer-2" data-line-number="2"><span class="kw"><ColorMap</span><span class="ot"> type=</span><span class="st">"ramp | values | intervals"</span><span class="ot"> extended=</span><span class="st">"true | false"</span><span class="kw">></span></a>
<a class="sourceLine" id="rasterSymbolizer-3" data-line-number="3"> <span class="kw"><ColorMapEntry</span><span class="ot"> color=</span><span class="st">""</span><span class="ot"> quantity=</span><span class="st">""</span><span class="ot"> label=</span><span class="st">""</span><span class="ot"> opacity=</span><span class="st">""</span><span class="kw">/></span></a>
<a class="sourceLine" id="rasterSymbolizer-4" data-line-number="4"><span class="kw"><ChannelSelection></span></a>
<a class="sourceLine" id="rasterSymbolizer-5" data-line-number="5"> <span class="kw"><RedChannel></span> <span class="kw"><GreenChannel></span> <span class="kw"><BlueChannel></span></a>
<a class="sourceLine" id="rasterSymbolizer-6" data-line-number="6"> <span class="kw"><SourceChannelName></span></a>
<a class="sourceLine" id="rasterSymbolizer-7" data-line-number="7"> <span class="kw"><GrayChannel></span></a>
<a class="sourceLine" id="rasterSymbolizer-8" data-line-number="8"> <span class="kw"><SourceChannelName></span></a>
<a class="sourceLine" id="rasterSymbolizer-9" data-line-number="9"><span class="kw"><ContrastEnhancement></span></a>
<a class="sourceLine" id="rasterSymbolizer-10" data-line-number="10"><span class="kw"><ShadedRelief></span> (not implemented in ver 2.0)</a>
<a class="sourceLine" id="rasterSymbolizer-11" data-line-number="11"><span class="kw"><OverlapBehavior></span> (not implemented in ver 2.0)</a>
<a class="sourceLine" id="rasterSymbolizer-12" data-line-number="12"><span class="kw"><ImageOutline></span> (not implemented in ver 2.0)</a></code></pre></div>
</section><section id="filters" class="title-slide slide level2"><h2>Filters</h2></section><section id="SLDrulesVectorSymbolization_01" class="slide level3">
<h3>SLD Filter Rules and Vector Symbolization</h3>
<p>Filters based upon Attribute Values</p>
<pre><code><PropertyIsEqualTo>
<PropertyIsNotEqualTo>
<PropertyIsLessThan>
<PropertyIsLessThanOrEqualTo>
<PropertyIsGreaterThan>
<PropertyIsGreaterThanOrEqualTo>
<PropertyIsBetween></code></pre>
<p>Logical Filters - for combining multiple filters</p>
<pre><code><And>
<Or>
<Not></code></pre>
<p>Spatial Filters</p>
<pre><code><Intersects>
<Equals>
<Disjoint>
<Within>
<Overlaps>
<Crosses>
<DWithin>
<Beyond>
<Distance></code></pre>
<p>Scale-based selection</p>
<pre><code><MaxScaleDenominator>
<MinScaleDenominator></code></pre>
</section><section id="attributeFilterExample_01" class="slide level3">
<h3>Attribute Filter Example</h3>
<p>To define an <em>Attribute Filter</em> you need to know both the <em>Attribute Name</em> of the layer(s) that will use the filter and the <em>value(s)</em> of that field that will be used for the filter. <em>How do you determine the attribute name and values?</em></p>
<ul>
<li>If available, this information should be available through the documentation (metadata) for the data that is published by the data provider.</li>
<li>In GeoServer you can view a list of attribute names in the <em>data</em> tab of the layer information under the <em>Feature Type Details</em> at the bottom of the web page, but you can’t view the actual field values.</li>
<li>For vector data you can view both the attribute names and their values using the <code>ogrinfo</code> command from the command line on the class linux server.</li>
</ul>
<p>For example:</p>
<pre><code>ogrinfo -fields=YES -geom=NO kb_gpsrdsdd.shp kb_gpsrdsdd</code></pre>
<p>Where this command requests that the fields and their values be displayed, but that the detailed geometry information (i.e. all of the nodes associated with each feature) be suppressed in the output</p>
<p><a href="https://github.com/karlbenedict/GEOG485-585/blob/master/sample-files/SLD/SimpleRoads.sld">Full SLD</a></p>
<div class="sourceCode" id="styledNMRoads"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="styledNMRoads-1" data-line-number="1"><span class="kw"><?xml</span> version="1.0" encoding="ISO-8859-1"<span class="kw">?></span></a>
<a class="sourceLine" id="styledNMRoads-2" data-line-number="2"><span class="kw"><StyledLayerDescriptor</span><span class="ot"> version=</span><span class="st">"1.0.0"</span> </a>
<a class="sourceLine" id="styledNMRoads-3" data-line-number="3"><span class="ot"> xsi:schemaLocation=</span><span class="st">"http://www.opengis.net/sld StyledLayerDescriptor.xsd"</span> </a>
<a class="sourceLine" id="styledNMRoads-4" data-line-number="4"><span class="ot"> xmlns=</span><span class="st">"http://www.opengis.net/sld"</span> </a>
<a class="sourceLine" id="styledNMRoads-5" data-line-number="5"><span class="ot"> xmlns:ogc=</span><span class="st">"http://www.opengis.net/ogc"</span> </a>
<a class="sourceLine" id="styledNMRoads-6" data-line-number="6"><span class="ot"> xmlns:xlink=</span><span class="st">"http://www.w3.org/1999/xlink"</span> </a>
<a class="sourceLine" id="styledNMRoads-7" data-line-number="7"><span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-8" data-line-number="8"></a>
<a class="sourceLine" id="styledNMRoads-9" data-line-number="9"><span class="co"><!-- New Mexico Highways --></span></a>
<a class="sourceLine" id="styledNMRoads-10" data-line-number="10"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="styledNMRoads-11" data-line-number="11"><span class="kw"><Name></span>NM Roads<span class="kw"></Name></span></a>
<a class="sourceLine" id="styledNMRoads-12" data-line-number="12"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="styledNMRoads-13" data-line-number="13"> <span class="kw"><Name></span>NM Roads<span class="kw"></Name></span></a>
<a class="sourceLine" id="styledNMRoads-14" data-line-number="14"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="styledNMRoads-15" data-line-number="15"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="styledNMRoads-16" data-line-number="16"> <span class="kw"><Title></span>NM Highways<span class="kw"></Title></span></a>
<a class="sourceLine" id="styledNMRoads-17" data-line-number="17"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-18" data-line-number="18"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-19" data-line-number="19"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="styledNMRoads-20" data-line-number="20"> <span class="kw"><ogc:Literal></span>State Highway<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-21" data-line-number="21"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-22" data-line-number="22"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-23" data-line-number="23"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-24" data-line-number="24"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-25" data-line-number="25"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-26" data-line-number="26"> <span class="kw"><ogc:Literal></span>#CCCCCC<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-27" data-line-number="27"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-28" data-line-number="28"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-29" data-line-number="29"> <span class="kw"><ogc:Literal></span>2<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-30" data-line-number="30"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-31" data-line-number="31"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-32" data-line-number="32"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-33" data-line-number="33"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="styledNMRoads-34" data-line-number="34"></a>
<a class="sourceLine" id="styledNMRoads-35" data-line-number="35"><span class="co"><!-- US Highways --></span></a>
<a class="sourceLine" id="styledNMRoads-36" data-line-number="36"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="styledNMRoads-37" data-line-number="37"> <span class="kw"><Title></span>US Highways<span class="kw"></Title></span></a>
<a class="sourceLine" id="styledNMRoads-38" data-line-number="38"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-39" data-line-number="39"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-40" data-line-number="40"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="styledNMRoads-41" data-line-number="41"> <span class="kw"><ogc:Literal></span>US Highway<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-42" data-line-number="42"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-43" data-line-number="43"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-44" data-line-number="44"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-45" data-line-number="45"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-46" data-line-number="46"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-47" data-line-number="47"> <span class="kw"><ogc:Literal></span>#ff0000<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-48" data-line-number="48"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-49" data-line-number="49"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-50" data-line-number="50"> <span class="kw"><ogc:Literal></span>3<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-51" data-line-number="51"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-52" data-line-number="52"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-53" data-line-number="53"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-54" data-line-number="54"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-55" data-line-number="55"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-56" data-line-number="56"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-57" data-line-number="57"> <span class="kw"><ogc:Literal></span>#CCCCCC<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-58" data-line-number="58"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-59" data-line-number="59"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-60" data-line-number="60"> <span class="kw"><ogc:Literal></span>1<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-61" data-line-number="61"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-62" data-line-number="62"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-63" data-line-number="63"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-64" data-line-number="64"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="styledNMRoads-65" data-line-number="65"></a>
<a class="sourceLine" id="styledNMRoads-66" data-line-number="66"><span class="co"><!-- Interstate Highways --></span></a>
<a class="sourceLine" id="styledNMRoads-67" data-line-number="67"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="styledNMRoads-68" data-line-number="68"> <span class="kw"><Title></span>Interstates<span class="kw"></Title></span></a>
<a class="sourceLine" id="styledNMRoads-69" data-line-number="69"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-70" data-line-number="70"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-71" data-line-number="71"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="styledNMRoads-72" data-line-number="72"> <span class="kw"><ogc:Literal></span>Interstate<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-73" data-line-number="73"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="styledNMRoads-74" data-line-number="74"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="styledNMRoads-75" data-line-number="75"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-76" data-line-number="76"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-77" data-line-number="77"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-78" data-line-number="78"> <span class="kw"><ogc:Literal></span>#fcff00<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-79" data-line-number="79"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-80" data-line-number="80"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-81" data-line-number="81"> <span class="kw"><ogc:Literal></span>5<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-82" data-line-number="82"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-83" data-line-number="83"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-84" data-line-number="84"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-85" data-line-number="85"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-86" data-line-number="86"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-87" data-line-number="87"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-88" data-line-number="88"> <span class="kw"><ogc:Literal></span>#222222<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-89" data-line-number="89"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-90" data-line-number="90"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="styledNMRoads-91" data-line-number="91"> <span class="kw"><ogc:Literal></span>3<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="styledNMRoads-92" data-line-number="92"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="styledNMRoads-93" data-line-number="93"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="styledNMRoads-94" data-line-number="94"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="styledNMRoads-95" data-line-number="95"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="styledNMRoads-96" data-line-number="96"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="styledNMRoads-97" data-line-number="97"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="styledNMRoads-98" data-line-number="98"><span class="kw"></NamedLayer></span></a>
<a class="sourceLine" id="styledNMRoads-99" data-line-number="99"></a>
<a class="sourceLine" id="styledNMRoads-100" data-line-number="100"><span class="kw"></StyledLayerDescriptor></span></a></code></pre></div>
</section><section id="attributeFilterWscaleFactor_01" class="slide level3">
<h3>Attribute Filter with Scale Factor</h3>
<p>The only change needed to introduce scale-dependencies into styles is to include <code><MaxScaleDenominator></code> or <code><MinScaleDenominator></code> elements within a rule where they should be applied. These elements should be placed just before the symbolizer element so that GeoServer can properly validate the provided SLD.</p>
<p><a href="https://github.com/karlbenedict/GEOG485-585/blob/master/sample-files/SLD/SimpleRoadsScaled.sld">Full SLD</a> </p>
<div class="sourceCode" id="attributeFilterWscale_highways"><pre class="sourceCode xml"><code class="sourceCode xml"><a class="sourceLine" id="attributeFilterWscale_highways-1" data-line-number="1"><span class="kw"><?xml</span> version="1.0" encoding="ISO-8859-1"<span class="kw">?></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-2" data-line-number="2"><span class="kw"><StyledLayerDescriptor</span><span class="ot"> version=</span><span class="st">"1.0.0"</span> </a>
<a class="sourceLine" id="attributeFilterWscale_highways-3" data-line-number="3"><span class="ot"> xsi:schemaLocation=</span><span class="st">"http://www.opengis.net/sld StyledLayerDescriptor.xsd"</span> </a>
<a class="sourceLine" id="attributeFilterWscale_highways-4" data-line-number="4"><span class="ot"> xmlns=</span><span class="st">"http://www.opengis.net/sld"</span> </a>
<a class="sourceLine" id="attributeFilterWscale_highways-5" data-line-number="5"><span class="ot"> xmlns:ogc=</span><span class="st">"http://www.opengis.net/ogc"</span> </a>
<a class="sourceLine" id="attributeFilterWscale_highways-6" data-line-number="6"><span class="ot"> xmlns:xlink=</span><span class="st">"http://www.w3.org/1999/xlink"</span> </a>
<a class="sourceLine" id="attributeFilterWscale_highways-7" data-line-number="7"><span class="ot"> xmlns:xsi=</span><span class="st">"http://www.w3.org/2001/XMLSchema-instance"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-8" data-line-number="8"></a>
<a class="sourceLine" id="attributeFilterWscale_highways-9" data-line-number="9"><span class="co"><!-- New Mexico Highways --></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-10" data-line-number="10"><span class="kw"><NamedLayer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-11" data-line-number="11"><span class="kw"><Name></span>NM Roads<span class="kw"></Name></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-12" data-line-number="12"> <span class="kw"><UserStyle></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-13" data-line-number="13"> <span class="kw"><Name></span>NM Roads<span class="kw"></Name></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-14" data-line-number="14"> <span class="kw"><FeatureTypeStyle></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-15" data-line-number="15"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-16" data-line-number="16"> <span class="kw"><Title></span>NM Highways<span class="kw"></Title></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-17" data-line-number="17"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-18" data-line-number="18"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-19" data-line-number="19"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-20" data-line-number="20"> <span class="kw"><ogc:Literal></span>State Highway<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-21" data-line-number="21"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-22" data-line-number="22"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-23" data-line-number="23"> <span class="kw"><MaxScaleDenominator></span>1000000<span class="kw"></MaxScaleDenominator></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-24" data-line-number="24"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-25" data-line-number="25"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-26" data-line-number="26"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-27" data-line-number="27"> <span class="kw"><ogc:Literal></span>#CCCCCC<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-28" data-line-number="28"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-29" data-line-number="29"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-30" data-line-number="30"> <span class="kw"><ogc:Literal></span>2<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-31" data-line-number="31"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-32" data-line-number="32"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-33" data-line-number="33"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-34" data-line-number="34"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-35" data-line-number="35"></a>
<a class="sourceLine" id="attributeFilterWscale_highways-36" data-line-number="36"><span class="co"><!-- US Highways --></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-37" data-line-number="37"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-38" data-line-number="38"> <span class="kw"><Title></span>US Highways<span class="kw"></Title></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-39" data-line-number="39"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-40" data-line-number="40"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-41" data-line-number="41"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-42" data-line-number="42"> <span class="kw"><ogc:Literal></span>US Highway<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-43" data-line-number="43"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-44" data-line-number="44"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-45" data-line-number="45"> <span class="kw"><MaxScaleDenominator></span>5000000<span class="kw"></MaxScaleDenominator></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-46" data-line-number="46"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-47" data-line-number="47"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-48" data-line-number="48"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-49" data-line-number="49"> <span class="kw"><ogc:Literal></span>#ff0000<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-50" data-line-number="50"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-51" data-line-number="51"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-52" data-line-number="52"> <span class="kw"><ogc:Literal></span>3<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-53" data-line-number="53"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-54" data-line-number="54"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-55" data-line-number="55"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-56" data-line-number="56"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-57" data-line-number="57"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-58" data-line-number="58"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-59" data-line-number="59"> <span class="kw"><ogc:Literal></span>#CCCCCC<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-60" data-line-number="60"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-61" data-line-number="61"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-62" data-line-number="62"> <span class="kw"><ogc:Literal></span>1<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-63" data-line-number="63"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-64" data-line-number="64"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-65" data-line-number="65"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-66" data-line-number="66"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-67" data-line-number="67"></a>
<a class="sourceLine" id="attributeFilterWscale_highways-68" data-line-number="68"><span class="co"><!-- Interstate Highways --></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-69" data-line-number="69"> <span class="kw"><Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-70" data-line-number="70"> <span class="kw"><Title></span>Interstates<span class="kw"></Title></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-71" data-line-number="71"> <span class="kw"><ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-72" data-line-number="72"> <span class="kw"><ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-73" data-line-number="73"> <span class="kw"><ogc:PropertyName></span>TYPE<span class="kw"></ogc:PropertyName></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-74" data-line-number="74"> <span class="kw"><ogc:Literal></span>Interstate<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-75" data-line-number="75"> <span class="kw"></ogc:PropertyIsEqualTo></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-76" data-line-number="76"> <span class="kw"></ogc:Filter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-77" data-line-number="77"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-78" data-line-number="78"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-79" data-line-number="79"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-80" data-line-number="80"> <span class="kw"><ogc:Literal></span>#fcff00<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-81" data-line-number="81"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-82" data-line-number="82"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-83" data-line-number="83"> <span class="kw"><ogc:Literal></span>5<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-84" data-line-number="84"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-85" data-line-number="85"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-86" data-line-number="86"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-87" data-line-number="87"> <span class="kw"><LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-88" data-line-number="88"> <span class="kw"><Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-89" data-line-number="89"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-90" data-line-number="90"> <span class="kw"><ogc:Literal></span>#222222<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-91" data-line-number="91"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-92" data-line-number="92"> <span class="kw"><CssParameter</span><span class="ot"> name=</span><span class="st">"stroke-width"</span><span class="kw">></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-93" data-line-number="93"> <span class="kw"><ogc:Literal></span>3<span class="kw"></ogc:Literal></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-94" data-line-number="94"> <span class="kw"></CssParameter></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-95" data-line-number="95"> <span class="kw"></Stroke></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-96" data-line-number="96"> <span class="kw"></LineSymbolizer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-97" data-line-number="97"> <span class="kw"></Rule></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-98" data-line-number="98"> <span class="kw"></FeatureTypeStyle></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-99" data-line-number="99"> <span class="kw"></UserStyle></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-100" data-line-number="100"><span class="kw"></NamedLayer></span></a>
<a class="sourceLine" id="attributeFilterWscale_highways-101" data-line-number="101"></a>
<a class="sourceLine" id="attributeFilterWscale_highways-102" data-line-number="102"><span class="kw"></StyledLayerDescriptor></span></a></code></pre></div>
</section><section id="demonstrations" class="slide level3">
<h3>Demonstrations</h3>
<p>Class GeoServer Instance: <a href="http://internetmapping.net:8080/geoserver/web/" class="uri">http://internetmapping.net:8080/geoserver/web/</a></p>
<p>SLD Creation Using QGIS: Link to the <a href="http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/vector_properties.html#style-menu">QGIS Vector Properties Dialog</a> Documentation.</p>
</section>
<hr />
<section>
<div class="license">
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work by <span data-xmlns:cc="http://creativecommons.org/ns#" data-property="cc:attributionName">Karl Benedict</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
</div>
</section>
<!-- {{{{ dzslides core
#
#
# __ __ __ . __ ___ __
# | \ / /__` | | | \ |__ /__`
# |__/ /_ .__/ |___ | |__/ |___ .__/ core :€
#
#
# The following block of code is not supposed to be edited.
# But if you want to change the behavior of these slides,
# feel free to hack it!
#
-->
<div id="progress-bar"></div>
<!-- Default Style -->
<style>
* { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
[role="note"] { display: none; }
body {
width: 800px; height: 600px;
margin-left: -400px; margin-top: -300px;
position: absolute; top: 50%; left: 50%;
overflow: hidden;
display: none;
}
.view body {
position: static;
margin: 0; padding: 0;
width: 100%; height: 100%;
display: inline-block;
overflow: visible; overflow-x: hidden;
/* undo Dz.onresize */
transform: none !important;
-moz-transform: none !important;
-webkit-transform: none !important;
-o-transform: none !important;
-ms-transform: none !important;
}
.view head, .view head > title { display: block }
section {
position: absolute;
pointer-events: none;
width: 100%; height: 100%;
}
.view section {
pointer-events: auto;
position: static;
width: 800px; height: 600px;
margin: -150px -200px;
float: left;
transform: scale(.4);
-moz-transform: scale(.4);
-webkit-transform: scale(.4);
-o-transform: scale(.4);
-ms-transform: scale(.4);
}
.view section > * { pointer-events: none; }
section[aria-selected] { pointer-events: auto; }
html { overflow: hidden; }
html.view { overflow: visible; }
body.loaded { display: block; }
.incremental {visibility: hidden; }
.incremental[active] {visibility: visible; }
#progress-bar{
bottom: 0;
position: absolute;
-moz-transition: width 400ms linear 0s;
-webkit-transition: width 400ms linear 0s;
-ms-transition: width 400ms linear 0s;
transition: width 400ms linear 0s;
}
.view #progress-bar {
display: none;
}
</style>
<script>
var Dz = {
remoteWindows: [],
idx: -1,
step: 0,
html: null,
slides: null,
progressBar : null,
params: {
autoplay: "1"
}
};
Dz.init = function() {
document.body.className = "loaded";
this.slides = Array.prototype.slice.call($$("body > section"));
this.progressBar = $("#progress-bar");
this.html = document.body.parentNode;
this.setupParams();
this.onhashchange();
this.setupTouchEvents();
this.onresize();
this.setupView();
}
Dz.setupParams = function() {
var p = window.location.search.substr(1).split('&');
p.forEach(function(e, i, a) {
var keyVal = e.split('=');
Dz.params[keyVal[0]] = decodeURIComponent(keyVal[1]);
});
// Specific params handling
if (!+this.params.autoplay)
$$.forEach($$("video"), function(v){ v.controls = true });
}
Dz.onkeydown = function(aEvent) {
// Don't intercept keyboard shortcuts
if (aEvent.altKey
|| aEvent.ctrlKey
|| aEvent.metaKey
|| aEvent.shiftKey) {
return;
}
if ( aEvent.keyCode == 37 // left arrow
|| aEvent.keyCode == 38 // up arrow
|| aEvent.keyCode == 33 // page up
) {
aEvent.preventDefault();
this.back();
}
if ( aEvent.keyCode == 39 // right arrow
|| aEvent.keyCode == 40 // down arrow
|| aEvent.keyCode == 34 // page down
) {
aEvent.preventDefault();
this.forward();
}
if (aEvent.keyCode == 35) { // end
aEvent.preventDefault();
this.goEnd();
}
if (aEvent.keyCode == 36) { // home
aEvent.preventDefault();
this.goStart();
}
if (aEvent.keyCode == 32) { // space
aEvent.preventDefault();
this.toggleContent();
}
if (aEvent.keyCode == 70) { // f
aEvent.preventDefault();
this.goFullscreen();
}
if (aEvent.keyCode == 79) { // o
aEvent.preventDefault();
this.toggleView();
}
}
/* Touch Events */
Dz.setupTouchEvents = function() {
var orgX, newX;
var tracking = false;
var db = document.body;
db.addEventListener("touchstart", start.bind(this), false);
db.addEventListener("touchmove", move.bind(this), false);
function start(aEvent) {
aEvent.preventDefault();
tracking = true;
orgX = aEvent.changedTouches[0].pageX;
}
function move(aEvent) {
if (!tracking) return;
newX = aEvent.changedTouches[0].pageX;
if (orgX - newX > 100) {
tracking = false;
this.forward();
} else {
if (orgX - newX < -100) {
tracking = false;
this.back();
}
}
}
}
Dz.setupView = function() {
document.body.addEventListener("click", function ( e ) {
if (!Dz.html.classList.contains("view")) return;
if (!e.target || e.target.nodeName != "SECTION") return;
Dz.html.classList.remove("view");
Dz.setCursor(Dz.slides.indexOf(e.target) + 1);
}, false);
}
/* Adapt the size of the slides to the window */
Dz.onresize = function() {
var db = document.body;
var sx = db.clientWidth / window.innerWidth;
var sy = db.clientHeight / window.innerHeight;
var transform = "scale(" + (1/Math.max(sx, sy)) + ")";
db.style.MozTransform = transform;
db.style.WebkitTransform = transform;
db.style.OTransform = transform;
db.style.msTransform = transform;
db.style.transform = transform;
}
Dz.getNotes = function(aIdx) {
var s = $("section:nth-of-type(" + aIdx + ")");
var d = s.$("[role='note']");
return d ? d.innerHTML : "";
}
Dz.onmessage = function(aEvent) {
var argv = aEvent.data.split(" "), argc = argv.length;
argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) });
var win = aEvent.source;
if (argv[0] === "REGISTER" && argc === 1) {
this.remoteWindows.push(win);
this.postMsg(win, "REGISTERED", document.title, this.slides.length);
this.postMsg(win, "CURSOR", this.idx + "." + this.step);
return;
}
if (argv[0] === "BACK" && argc === 1)
this.back();
if (argv[0] === "FORWARD" && argc === 1)
this.forward();
if (argv[0] === "START" && argc === 1)
this.goStart();
if (argv[0] === "END" && argc === 1)
this.goEnd();
if (argv[0] === "TOGGLE_CONTENT" && argc === 1)
this.toggleContent();
if (argv[0] === "SET_CURSOR" && argc === 2)
window.location.hash = "#" + argv[1];
if (argv[0] === "GET_CURSOR" && argc === 1)
this.postMsg(win, "CURSOR", this.idx + "." + this.step);
if (argv[0] === "GET_NOTES" && argc === 1)
this.postMsg(win, "NOTES", this.getNotes(this.idx));
}
Dz.toggleContent = function() {
// If a Video is present in this new slide, play it.
// If a Video is present in the previous slide, stop it.
var s = $("section[aria-selected]");
if (s) {
var video = s.$("video");
if (video) {
if (video.ended || video.paused) {
video.play();
} else {
video.pause();
}
}
}
}
Dz.setCursor = function(aIdx, aStep) {
// If the user change the slide number in the URL bar, jump
// to this slide.
aStep = (aStep != 0 && typeof aStep !== "undefined") ? "." + aStep : ".0";
window.location.hash = "#" + aIdx + aStep;
}
Dz.onhashchange = function() {
var cursor = window.location.hash.split("#"),
newidx = 1,
newstep = 0;
if (cursor.length == 2) {
newidx = ~~cursor[1].split(".")[0];
newstep = ~~cursor[1].split(".")[1];
if (newstep > Dz.slides[newidx - 1].$$('.incremental > *').length) {
newstep = 0;
newidx++;
}
}
this.setProgress(newidx, newstep);
if (newidx != this.idx) {
this.setSlide(newidx);
}
if (newstep != this.step) {
this.setIncremental(newstep);
}
for (var i = 0; i < this.remoteWindows.length; i++) {
this.postMsg(this.remoteWindows[i], "CURSOR", this.idx + "." + this.step);
}
}
Dz.back = function() {
if (this.idx == 1 && this.step == 0) {
return;
}
if (this.step == 0) {
this.setCursor(this.idx - 1,
this.slides[this.idx - 2].$$('.incremental > *').length);
} else {
this.setCursor(this.idx, this.step - 1);
}
}
Dz.forward = function() {
if (this.idx >= this.slides.length &&
this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {
return;
}
if (this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {
this.setCursor(this.idx + 1, 0);
} else {
this.setCursor(this.idx, this.step + 1);
}
}
Dz.goStart = function() {
this.setCursor(1, 0);
}
Dz.goEnd = function() {
var lastIdx = this.slides.length;
var lastStep = this.slides[lastIdx - 1].$$('.incremental > *').length;
this.setCursor(lastIdx, lastStep);
}
Dz.toggleView = function() {
this.html.classList.toggle("view");
if (this.html.classList.contains("view")) {
$("section[aria-selected]").scrollIntoView(true);
}
}
Dz.setSlide = function(aIdx) {
this.idx = aIdx;
var old = $("section[aria-selected]");
var next = $("section:nth-of-type("+ this.idx +")");
if (old) {
old.removeAttribute("aria-selected");
var video = old.$("video");
if (video) {
video.pause();
}
}
if (next) {
next.setAttribute("aria-selected", "true");
if (this.html.classList.contains("view")) {
next.scrollIntoView();
}
var video = next.$("video");
if (video && !!+this.params.autoplay) {
video.play();
}
} else {
// That should not happen
this.idx = -1;
// console.warn("Slide doesn't exist.");
}
}
Dz.setIncremental = function(aStep) {
this.step = aStep;
var old = this.slides[this.idx - 1].$('.incremental > *[aria-selected]');
if (old) {
old.removeAttribute('aria-selected');
}
var incrementals = $$('.incremental');
if (this.step <= 0) {
$$.forEach(incrementals, function(aNode) {
aNode.removeAttribute('active');
});
return;
}
var next = this.slides[this.idx - 1].$$('.incremental > *')[this.step - 1];
if (next) {
next.setAttribute('aria-selected', true);
next.parentNode.setAttribute('active', true);
var found = false;
$$.forEach(incrementals, function(aNode) {
if (aNode != next.parentNode)
if (found)
aNode.removeAttribute('active');
else
aNode.setAttribute('active', true);
else
found = true;
});
} else {
setCursor(this.idx, 0);
}
return next;
}
Dz.goFullscreen = function() {
var html = $('html'),
requestFullscreen = html.requestFullscreen || html.requestFullScreen || html.mozRequestFullScreen || html.webkitRequestFullScreen;
if (requestFullscreen) {
requestFullscreen.apply(html);
}
}
Dz.setProgress = function(aIdx, aStep) {
var slide = $("section:nth-of-type("+ aIdx +")");
if (!slide)
return;
var steps = slide.$$('.incremental > *').length + 1,
slideSize = 100 / (this.slides.length - 1),