-
Notifications
You must be signed in to change notification settings - Fork 5
/
lecture14_Mod05_a_02_a.md.html
574 lines (574 loc) · 66.3 KB
/
lecture14_Mod05_a_02_a.md.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<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="page.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1 class="title">Geography 485L/585L - Internet Mapping</h1>
<p class="author">Karl Benedict</p>
<p class="date">Spring 2018</p>
</header>
<!---------------------------------------------------------------------------->
<!-- Week 14 ----------------------------------------------------------------->
<!-- Lecture 05 a 02 a ------------------------------------------------------->
<!-- Developing and Hosting OGC Services-------------------------------------->
<!-- OGC Services and Styling in GeoServer------------------------------------>
<!---------------------------------------------------------------------------->
<h1 id="week-14---module-5---ogc-services-and-styling-in-geoserver">Week 14 - Module 5 - OGC Services and Styling in GeoServer</h1>
<h3 id="overview">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>
<h2 id="ogc-styled-layer-descriptor-sld">OGC Styled Layer Descriptor (SLD)</h2>
<h3 id="ogc-styled-layer-descriptor-sld-1">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>
<h3 id="definitionOfStyles_01">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>
<h3 id="definitionOfStyles_03">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>
<h3 id="definitionOfStyles_04">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>
<h3 id="simple-geoserver-point-style">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>
<h3 id="simple-geoserver-line-style">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>
<h3 id="simple-geoserver-polygon-style">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>
<h3 id="simple-geoserver-raster-style">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>
<h3 id="pointsymbolizer">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>
<h3 id="linesybolizer">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>
<h3 id="polygonsymbolizer">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>
<h3 id="raster-symbolizer">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>
<h2 id="filters">Filters</h2>
<h3 id="SLDrulesVectorSymbolization_01">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>
<h3 id="attributeFilterExample_01">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>
<h3 id="attributeFilterWscaleFactor_01">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>
<h3 id="demonstrations">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>
<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>
</body>
</html>