Mercurial > gemma
diff pkg/geoserver/templates_test.go @ 3832:cbced21c6d94 sld-colors
Adjusted unit test for SLD templating.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 04 Jul 2019 17:18:05 +0200 |
parents | 464a6a6e05e6 |
children | 3fcc4e11fc00 |
line wrap: on
line diff
--- a/pkg/geoserver/templates_test.go Thu Jul 04 11:26:11 2019 +0200 +++ b/pkg/geoserver/templates_test.go Thu Jul 04 17:18:05 2019 +0200 @@ -34,21 +34,37 @@ <UserStyle> <se:Name>sounding_results_contour_lines</se:Name> <se:FeatureTypeStyle> - <se:Name>contour_line_colours</se:Name> + <se:Name>contour_line_colours</se:Name> <se:Description> <se:Abstract> FeatureTypeStyle defining colour classes for height attribute </se:Abstract> </se:Description> {{ range . -}} - {{- if and .HasLow .HasHigh -}} <se:Rule> - <se:Name>≤ {{ printf "%.1f" .High }}</se:Name> + {{- if not .HasLow }} + <se:Name>≤ {{ printf "%g" .High }}</se:Name> + <ogc:Filter> + <ogc:PropertyIsLessThanOrEqualTo> + <ogc:PropertyName>height</ogc:PropertyName> + <ogc:Literal>{{ printf "%g" .High }}</ogc:Literal> + </ogc:PropertyIsLessThanOrEqualTo> + </ogc:Filter> + {{- else if not .HasHigh }} + <se:Name>> {{ printf "%g" .Low }}</se:Name> + <ogc:Filter> + <ogc:PropertyIsGreaterThanOrEqualTo> + <ogc:PropertyName>height</ogc:PropertyName> + <ogc:Literal>{{ printf "%g" .Low }}</ogc:Literal> + </ogc:PropertyIsGreaterThanOrEqualTo> + </ogc:Filter> + {{- else }} + <se:Name>≤ {{ printf "%g" .High }}</se:Name> <ogc:Filter> <ogc:And> <ogc:PropertyIsGreaterThan> <ogc:PropertyName>height</ogc:PropertyName> - <ogc:Literal>{{.Low}}</ogc:Literal> + <ogc:Literal>{{ printf "%g" .Low }}</ogc:Literal> </ogc:PropertyIsGreaterThan> <ogc:PropertyIsLessThanOrEqualTo> <ogc:PropertyName>height</ogc:PropertyName> @@ -56,46 +72,14 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + {{- end }} + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">{{.Color}}</se:SvgParameter> + <se:SvgParameter name="stroke">{{ .Color }}</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> - {{ else if .HasLow -}} - <se:Rule> - <se:Name>> {{ printf "%.1f" .Low }}</se:Name> - <ogc:Filter> - <ogc:PropertyIsGreaterThan> - <ogc:PropertyName>height</ogc:PropertyName> - <ogc:Literal>{{ printf "%g" .Low }}</ogc:Literal> - </ogc:PropertyIsGreaterThan> - </ogc:Filter> - <se:LineSymbolizer> - <se:Stroke> - <se:SvgParameter name="stroke">{{.Color}}</se:SvgParameter> - <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> - </se:Stroke> - </se:LineSymbolizer> - </se:Rule> - {{ else if .HasHigh -}} - <se:Rule> - <se:Name>≤ {{ printf "%.1f" .High }}</se:Name> - <ogc:Filter> - <ogc:PropertyIsLessThanOrEqualTo> - <ogc:PropertyName>height</ogc:PropertyName> - <ogc:Literal>{{ printf "%g" .High }}</ogc:Literal> - </ogc:PropertyIsLessThanOrEqualTo> - </ogc:Filter> - <se:LineSymbolizer> - <se:Stroke> - <se:SvgParameter name="stroke">{{.Color}}</se:SvgParameter> - <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> - </se:Stroke> - </se:LineSymbolizer> - </se:Rule> - {{ end -}} {{ end }} </se:FeatureTypeStyle> <se:FeatureTypeStyle> @@ -104,25 +88,25 @@ <se:Abstract> FeatureTypeStyle for emphasized contour lines </se:Abstract> - </se:Description> - <se:Rule> - <se:LegendGraphic> - <se:Graphic> + </se:Description> + <se:Rule> + <se:LegendGraphic> + <se:Graphic> </se:Graphic> </se:LegendGraphic> <ogc:Filter> - <ogc:Or> - {{- range . }} - {{if .HasHigh -}} - <ogc:PropertyIsEqualTo> + <ogc:Or> + {{ range . -}} + {{ if .HasHigh -}} + <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>{{ printf "%.1f" .High }}</ogc:Literal> - </ogc:PropertyIsEqualTo> - {{- end -}} - {{end }} + <ogc:Literal>{{ printf "%g" .High }}</ogc:Literal> + </ogc:PropertyIsEqualTo> + {{ end -}} + {{ end }} </ogc:Or> </ogc:Filter> <se:MaxScaleDenominator>5e3</se:MaxScaleDenominator> @@ -135,12 +119,12 @@ <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - {{- range .}} - {{if .HasHigh -}} - <ogc:Literal>{{ printf "%.1f" .High }}</ogc:Literal> - <ogc:Literal>{{.Color}}</ogc:Literal> - {{- end -}} - {{end}} + {{ range . -}} + {{ if .HasHigh -}} + <ogc:Literal>{{ printf "%g" .High }}</ogc:Literal> + <ogc:Literal>{{ .Color }}</ogc:Literal> + {{ end -}} + {{ end }} </ogc:Function> </se:SvgParameter> </se:Stroke> @@ -163,13 +147,15 @@ <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - {{- range . }} + {{ range . -}} {{ if .HasHigh -}} - <ogc:Literal>{{ printf "%.1f" .High}}</ogc:Literal><ogc:Literal>{{ printf "%.1f" .High}}</ogc:Literal> - {{- else if .HasLow -}} - <ogc:Literal>{{ printf "%.1f" .Low}}</ogc:Literal><ogc:Literal>{{ printf "%.1f" .Low}}</ogc:Literal> - {{- end }} - {{- end }} + <ogc:Literal> + {{- printf "%g" .High -}} + </ogc:Literal><ogc:Literal> + {{- printf "%g" .High -}} + </ogc:Literal> + {{ end -}} + {{ end }} </ogc:Function> </se:Label> <se:LabelPlacement> @@ -194,8 +180,7 @@ </StyledLayerDescriptor> ` -const origSLD = ` -<?xml version="1.0" encoding="UTF-8"?> +const origSLD = `<?xml version="1.0" encoding="UTF-8"?> <StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:se="http://www.opengis.net/se" @@ -208,21 +193,21 @@ <UserStyle> <se:Name>sounding_results_contour_lines</se:Name> <se:FeatureTypeStyle> - <se:Name>contour_line_colours</se:Name> + <se:Name>contour_line_colours</se:Name> <se:Description> <se:Abstract> FeatureTypeStyle defining colour classes for height attribute </se:Abstract> </se:Description> <se:Rule> - <se:Name>≤ 1.0</se:Name> + <se:Name>≤ 1</se:Name> <ogc:Filter> <ogc:PropertyIsLessThanOrEqualTo> <ogc:PropertyName>height</ogc:PropertyName> <ogc:Literal>1</ogc:Literal> </ogc:PropertyIsLessThanOrEqualTo> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> <se:SvgParameter name="stroke">#ff00dd</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> @@ -243,9 +228,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#fb08b6</se:SvgParameter> + <se:SvgParameter name="stroke">#fb209e</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -264,9 +249,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f81090</se:SvgParameter> + <se:SvgParameter name="stroke">#f92c85</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -285,9 +270,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f5196a</se:SvgParameter> + <se:SvgParameter name="stroke">#f7396c</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -306,9 +291,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f22144</se:SvgParameter> + <se:SvgParameter name="stroke">#f54652</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -327,9 +312,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f03326</se:SvgParameter> + <se:SvgParameter name="stroke">#f45239</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -348,7 +333,7 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> <se:SvgParameter name="stroke">#f25f20</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> @@ -369,9 +354,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f38b1a</se:SvgParameter> + <se:SvgParameter name="stroke">#e46f1f</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -390,9 +375,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f5b814</se:SvgParameter> + <se:SvgParameter name="stroke">#d67e1e</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -411,9 +396,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#f7e40e</se:SvgParameter> + <se:SvgParameter name="stroke">#c88e1e</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -432,9 +417,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#e2f30e</se:SvgParameter> + <se:SvgParameter name="stroke">#bb9e1d</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -453,15 +438,15 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#b6e414</se:SvgParameter> + <se:SvgParameter name="stroke">#adae1c</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> <se:Rule> - <se:Name>≤ 4.0</se:Name> + <se:Name>≤ 4</se:Name> <ogc:Filter> <ogc:And> <ogc:PropertyIsGreaterThan> @@ -474,7 +459,7 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> <se:SvgParameter name="stroke">#8ad51a</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> @@ -495,15 +480,15 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#5ec620</se:SvgParameter> + <se:SvgParameter name="stroke">#76b540</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> <se:Rule> - <se:Name>≤ 5.0</se:Name> + <se:Name>≤ 5</se:Name> <ogc:Filter> <ogc:And> <ogc:PropertyIsGreaterThan> @@ -516,9 +501,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#32b726</se:SvgParameter> + <se:SvgParameter name="stroke">#639566</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -537,15 +522,15 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#249a49</se:SvgParameter> + <se:SvgParameter name="stroke">#4f758d</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> <se:Rule> - <se:Name>≤ 6.0</se:Name> + <se:Name>≤ 6</se:Name> <ogc:Filter> <ogc:And> <ogc:PropertyIsGreaterThan> @@ -558,9 +543,9 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#207977</se:SvgParameter> + <se:SvgParameter name="stroke">#3b54b3</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> @@ -579,15 +564,15 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> - <se:SvgParameter name="stroke">#1c57a4</se:SvgParameter> + <se:SvgParameter name="stroke">#2834d9</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> <se:Rule> - <se:Name>≤ 7.0</se:Name> + <se:Name>≤ 7</se:Name> <ogc:Filter> <ogc:And> <ogc:PropertyIsGreaterThan> @@ -600,28 +585,29 @@ </ogc:PropertyIsLessThanOrEqualTo> </ogc:And> </ogc:Filter> - <se:LineSymbolizer> - <se:Stroke> - <se:SvgParameter name="stroke">#1835d1</se:SvgParameter> - <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> - </se:Stroke> - </se:LineSymbolizer> - </se:Rule> - <se:Rule> - <se:Name>> 7.0</se:Name> - <ogc:Filter> - <ogc:PropertyIsGreaterThan> - <ogc:PropertyName>height</ogc:PropertyName> - <ogc:Literal>7</ogc:Literal> - </ogc:PropertyIsGreaterThan> - </ogc:Filter> - <se:LineSymbolizer> + <se:LineSymbolizer> <se:Stroke> <se:SvgParameter name="stroke">#1414ff</se:SvgParameter> <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> </se:Stroke> </se:LineSymbolizer> </se:Rule> + <se:Rule> + <se:Name>> 7</se:Name> + <ogc:Filter> + <ogc:PropertyIsGreaterThanOrEqualTo> + <ogc:PropertyName>height</ogc:PropertyName> + <ogc:Literal>7</ogc:Literal> + </ogc:PropertyIsGreaterThanOrEqualTo> + </ogc:Filter> + <se:LineSymbolizer> + <se:Stroke> + <se:SvgParameter name="stroke">#1414ff</se:SvgParameter> + <se:SvgParameter name="stroke-width">0.5</se:SvgParameter> + </se:Stroke> + </se:LineSymbolizer> + </se:Rule> + </se:FeatureTypeStyle> <se:FeatureTypeStyle> <se:Name>contour_lines_emph</se:Name> @@ -629,154 +615,148 @@ <se:Abstract> FeatureTypeStyle for emphasized contour lines </se:Abstract> - </se:Description> - <se:Rule> - <se:LegendGraphic> - <se:Graphic> + </se:Description> + <se:Rule> + <se:LegendGraphic> + <se:Graphic> </se:Graphic> </se:LegendGraphic> <ogc:Filter> - <ogc:Or> + <ogc:Or> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>1.0</ogc:Literal> - </ogc:PropertyIsEqualTo> + <ogc:Literal>1</ogc:Literal> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>1.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>1.7</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>1.9</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>2.1</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>2.3</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>2.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>2.7</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>2.9</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>3.1</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>3.3</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>3.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>4.0</ogc:Literal> - </ogc:PropertyIsEqualTo> + <ogc:Literal>4</ogc:Literal> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>4.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>5.0</ogc:Literal> - </ogc:PropertyIsEqualTo> + <ogc:Literal>5</ogc:Literal> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>5.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>6.0</ogc:Literal> - </ogc:PropertyIsEqualTo> + <ogc:Literal>6</ogc:Literal> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> <ogc:Literal>6.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:Function name="numberFormat"> <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>7.0</ogc:Literal> - </ogc:PropertyIsEqualTo> - <ogc:PropertyIsEqualTo> - <ogc:Function name="numberFormat"> - <ogc:Literal>0.0</ogc:Literal> - <ogc:PropertyName>height</ogc:PropertyName> - </ogc:Function> - <ogc:Literal>7.5</ogc:Literal> - </ogc:PropertyIsEqualTo> + <ogc:Literal>7</ogc:Literal> + </ogc:PropertyIsEqualTo> + </ogc:Or> </ogc:Filter> <se:MaxScaleDenominator>5e3</se:MaxScaleDenominator> @@ -789,46 +769,45 @@ <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>1.0</ogc:Literal> + <ogc:Literal>1</ogc:Literal> <ogc:Literal>#ff00dd</ogc:Literal> <ogc:Literal>1.5</ogc:Literal> - <ogc:Literal>#fb08b6</ogc:Literal> + <ogc:Literal>#fb209e</ogc:Literal> <ogc:Literal>1.7</ogc:Literal> - <ogc:Literal>#f81090</ogc:Literal> + <ogc:Literal>#f92c85</ogc:Literal> <ogc:Literal>1.9</ogc:Literal> - <ogc:Literal>#f5196a</ogc:Literal> + <ogc:Literal>#f7396c</ogc:Literal> <ogc:Literal>2.1</ogc:Literal> - <ogc:Literal>#f22144</ogc:Literal> + <ogc:Literal>#f54652</ogc:Literal> <ogc:Literal>2.3</ogc:Literal> - <ogc:Literal>#f03326</ogc:Literal> + <ogc:Literal>#f45239</ogc:Literal> <ogc:Literal>2.5</ogc:Literal> <ogc:Literal>#f25f20</ogc:Literal> <ogc:Literal>2.7</ogc:Literal> - <ogc:Literal>#f38b1a</ogc:Literal> + <ogc:Literal>#e46f1f</ogc:Literal> <ogc:Literal>2.9</ogc:Literal> - <ogc:Literal>#f5b814</ogc:Literal> + <ogc:Literal>#d67e1e</ogc:Literal> <ogc:Literal>3.1</ogc:Literal> - <ogc:Literal>#f7e40e</ogc:Literal> + <ogc:Literal>#c88e1e</ogc:Literal> <ogc:Literal>3.3</ogc:Literal> - <ogc:Literal>#e2f30e</ogc:Literal> + <ogc:Literal>#bb9e1d</ogc:Literal> <ogc:Literal>3.5</ogc:Literal> - <ogc:Literal>#b6e414</ogc:Literal> - <ogc:Literal>4.0</ogc:Literal> + <ogc:Literal>#adae1c</ogc:Literal> + <ogc:Literal>4</ogc:Literal> <ogc:Literal>#8ad51a</ogc:Literal> <ogc:Literal>4.5</ogc:Literal> - <ogc:Literal>#5ec620</ogc:Literal> - <ogc:Literal>5.0</ogc:Literal> - <ogc:Literal>#32b726</ogc:Literal> + <ogc:Literal>#76b540</ogc:Literal> + <ogc:Literal>5</ogc:Literal> + <ogc:Literal>#639566</ogc:Literal> <ogc:Literal>5.5</ogc:Literal> - <ogc:Literal>#249a49</ogc:Literal> - <ogc:Literal>6.0</ogc:Literal> - <ogc:Literal>#207977</ogc:Literal> + <ogc:Literal>#4f758d</ogc:Literal> + <ogc:Literal>6</ogc:Literal> + <ogc:Literal>#3b54b3</ogc:Literal> <ogc:Literal>6.5</ogc:Literal> - <ogc:Literal>#1c57a4</ogc:Literal> - <ogc:Literal>7.0</ogc:Literal> - <ogc:Literal>#1835d1</ogc:Literal> - <ogc:Literal>7.5</ogc:Literal> + <ogc:Literal>#2834d9</ogc:Literal> + <ogc:Literal>7</ogc:Literal> <ogc:Literal>#1414ff</ogc:Literal> + </ogc:Function> </se:SvgParameter> </se:Stroke> @@ -851,7 +830,7 @@ <ogc:Literal>0.0</ogc:Literal> <ogc:PropertyName>height</ogc:PropertyName> </ogc:Function> - <ogc:Literal>1.0</ogc:Literal><ogc:Literal>1.0</ogc:Literal> + <ogc:Literal>1</ogc:Literal><ogc:Literal>1</ogc:Literal> <ogc:Literal>1.5</ogc:Literal><ogc:Literal>1.5</ogc:Literal> <ogc:Literal>1.7</ogc:Literal><ogc:Literal>1.7</ogc:Literal> <ogc:Literal>1.9</ogc:Literal><ogc:Literal>1.9</ogc:Literal> @@ -863,14 +842,14 @@ <ogc:Literal>3.1</ogc:Literal><ogc:Literal>3.1</ogc:Literal> <ogc:Literal>3.3</ogc:Literal><ogc:Literal>3.3</ogc:Literal> <ogc:Literal>3.5</ogc:Literal><ogc:Literal>3.5</ogc:Literal> - <ogc:Literal>4.0</ogc:Literal><ogc:Literal>4.0</ogc:Literal> + <ogc:Literal>4</ogc:Literal><ogc:Literal>4</ogc:Literal> <ogc:Literal>4.5</ogc:Literal><ogc:Literal>4.5</ogc:Literal> - <ogc:Literal>5.0</ogc:Literal><ogc:Literal>5.0</ogc:Literal> + <ogc:Literal>5</ogc:Literal><ogc:Literal>5</ogc:Literal> <ogc:Literal>5.5</ogc:Literal><ogc:Literal>5.5</ogc:Literal> - <ogc:Literal>6.0</ogc:Literal><ogc:Literal>6.0</ogc:Literal> + <ogc:Literal>6</ogc:Literal><ogc:Literal>6</ogc:Literal> <ogc:Literal>6.5</ogc:Literal><ogc:Literal>6.5</ogc:Literal> - <ogc:Literal>7.0</ogc:Literal><ogc:Literal>7.0</ogc:Literal> - <ogc:Literal>7.5</ogc:Literal><ogc:Literal>7.5</ogc:Literal> + <ogc:Literal>7</ogc:Literal><ogc:Literal>7</ogc:Literal> + </ogc:Function> </se:Label> <se:LabelPlacement> @@ -897,7 +876,8 @@ const classBreaksConfig = `1:#ff00dd,1.5,1.7,1.9,2.1,2.3,` + `2.5:#f25f20,2.7,2.9,3.1,3.3,3.5,` + - `4:#8ad51a,4.5,5,5.5,6,6.5,7.5:#1414ff` + `4:#8ad51a,4.5,5,5.5,6,6.5,` + + `7:#1414ff` func TestTemplate(t *testing.T) { @@ -906,16 +886,6 @@ t.Fatalf("parsing color config failed: %v", err) } - /* - for i := range ccs { - fmt.Printf("%.1f #%02x%02x%02x\n", - ccs[i].value, - ccs[i].color.R, - ccs[i].color.G, - ccs[i].color.B) - } - */ - cbs := ccs.toClassBreaks() tmpl, err := template.New("test").Parse(sldTmplTxt)