diff style-templates/sounding_results_areas_geoserver.sld-template @ 4594:db4e7fecad0d iso-areas

Updated SLD templates for sounding results and differences.
author Raimund Renkert <raimund@renkert.org>
date Wed, 09 Oct 2019 13:29:43 +0200
parents 51dc19001808
children 60e096d52758
line wrap: on
line diff
--- a/style-templates/sounding_results_areas_geoserver.sld-template	Wed Oct 09 10:22:47 2019 +0200
+++ b/style-templates/sounding_results_areas_geoserver.sld-template	Wed Oct 09 13:29:43 2019 +0200
@@ -50,7 +50,8 @@
             </ogc:And>
           </ogc:Filter>
         {{- end }}
-           <se:PolygonSymbolizer>
+          <se:MaxScaleDenominator>34e3</se:MaxScaleDenominator>
+          <se:PolygonSymbolizer>
             <se:Fill>
               <se:SvgParameter name="fill">{{ .Color }}</se:SvgParameter>
             </se:Fill>
@@ -60,6 +61,46 @@
             </se:Stroke>
           </se:PolygonSymbolizer>
         </se:Rule>
+        <se:Rule>
+        {{- if not .HasLow }}
+          <se:Name>&#8804; {{ printf "%g" .High }}</se:Name>
+          <ogc:Filter>
+            <ogc:PropertyIsLessThanOrEqualTo>
+              <ogc:PropertyName>height</ogc:PropertyName>
+              <ogc:Literal>{{ printf "%f" .High }}</ogc:Literal>
+            </ogc:PropertyIsLessThanOrEqualTo>
+          </ogc:Filter>
+        {{- else if not .HasHigh }}
+          <se:Name>&gt; {{ printf "%g" .Low }}</se:Name>
+          <ogc:Filter>
+            <ogc:PropertyIsGreaterThanOrEqualTo>
+              <ogc:PropertyName>height</ogc:PropertyName>
+              <ogc:Literal>{{ printf "%f" .Low }}</ogc:Literal>
+            </ogc:PropertyIsGreaterThanOrEqualTo>
+          </ogc:Filter>
+        {{- else }}
+          <se:Name>&#8804; {{ printf "%g" .High }}</se:Name>
+          <ogc:Filter>
+            <ogc:And>
+              <ogc:PropertyIsGreaterThan>
+                <ogc:PropertyName>height</ogc:PropertyName>
+                <ogc:Literal>{{ printf "%f" .Low }}</ogc:Literal>
+              </ogc:PropertyIsGreaterThan>
+              <ogc:PropertyIsLessThanOrEqualTo>
+                <ogc:PropertyName>height</ogc:PropertyName>
+                <ogc:Literal>{{ printf "%f" .High }}</ogc:Literal>
+              </ogc:PropertyIsLessThanOrEqualTo>
+            </ogc:And>
+          </ogc:Filter>
+        {{- end }}
+          <se:MinScaleDenominator>34e3</se:MinScaleDenominator>
+          <se:PolygonSymbolizer>
+            <se:Fill>
+              <se:SvgParameter name="fill">{{ .Color }}</se:SvgParameter>
+            </se:Fill>
+          </se:PolygonSymbolizer>
+        </se:Rule>
+        <se:VendorOption name="sortBy">height</se:VendorOption>
         {{ end }}
       </se:FeatureTypeStyle>
       <se:FeatureTypeStyle>
@@ -70,12 +111,25 @@
           </se:Abstract>
         </se:Description>
         <se:Rule>
-            <!--
           <se:MaxScaleDenominator>5e3</se:MaxScaleDenominator>
-          -->
           <se:TextSymbolizer>
+            <se:VendorOption name="spaceAround">10</se:VendorOption>
             <se:Label>
-              <ogc:PropertyName>height</ogc:PropertyName>
+              <ogc:Function name="Recode">
+                <ogc:Function name="numberFormat">
+                  <ogc:Literal>0.000000</ogc:Literal>
+                  <ogc:PropertyName>height</ogc:PropertyName>
+                </ogc:Function>
+                {{ range . -}}
+                {{ if .HasHigh -}}
+                    <ogc:Literal>
+                    {{- printf "%f" .High -}}
+                    </ogc:Literal><ogc:Literal>
+                    {{- printf "%g" .High -}}
+                    </ogc:Literal>
+                {{ end -}}
+                {{ end }}
+              </ogc:Function>
             </se:Label>
             <se:Font>
               <se:SvgParameter name="font-family">Avenir</se:SvgParameter>