Mercurial > gemma
changeset 3827:6028326b88d6 sld-colors
go fmt'ed
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 03 Jul 2019 17:48:47 +0200 |
parents | 4b1184fa0326 |
children | 885eb90255ff |
files | pkg/geoserver/boot.go |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/geoserver/boot.go Wed Jul 03 17:47:17 2019 +0200 +++ b/pkg/geoserver/boot.go Wed Jul 03 17:48:47 2019 +0200 @@ -14,20 +14,20 @@ package geoserver import ( + "bytes" "context" - "bytes" + "database/sql" "encoding/json" "encoding/xml" "fmt" - "strconv" - "math" "io" "log" + "math" "net/http" "net/url" + "strconv" "strings" "text/template" - "database/sql" "golang.org/x/net/html/charset" @@ -45,8 +45,8 @@ bootRole = "sys_admin" - startupSQL = `SELECT public.setrole('${user,'||encode('waterway_user', 'hex')||'}')` - closeupSQL = `RESET ROLE` + startupSQL = `SELECT public.setrole('${user,'||encode('waterway_user', 'hex')||'}')` + closeupSQL = `RESET ROLE` selectClassBreaksSQL = `SELECT config_val FROM sys_admin.system_config WHERE config_key = 'morphology_classbreaks'` ) @@ -438,10 +438,10 @@ rightG, _ := strconv.ParseFloat(rightHex[1], 32) rightB, _ := strconv.ParseFloat(rightHex[2], 32) - interpolatedR := leftR + float64(interpolationFactor) * (rightR - leftR) - interpolatedG := leftG + float64(interpolationFactor) * (rightG - leftG) - interpolatedB := leftB + float64(interpolationFactor) * (rightB - leftB) - + interpolatedR := leftR + float64(interpolationFactor)*(rightR-leftR) + interpolatedG := leftG + float64(interpolationFactor)*(rightG-leftG) + interpolatedB := leftB + float64(interpolationFactor)*(rightB-leftB) + // hexR := fmt.Sprintf("%x", math.Round(interpolatedR)) // hexG := fmt.Sprintf("%x", math.Round(interpolatedG)) // hexB := fmt.Sprintf("%x", math.Round(interpolatedB)) @@ -473,7 +473,7 @@ // interpolate colors for i, cb := range classBreaks { - if (len(cb) == 1) { + if len(cb) == 1 { classBreaks[i] = append(cb, interpolateColor(i, classBreaks)) } } @@ -485,20 +485,20 @@ if i == 0 { high = classBreaks[i][0] } else { - low = classBreaks[i - 1][0] + low = classBreaks[i-1][0] high = classBreaks[i][0] } classBreaksForTmpl = append(classBreaksForTmpl, classBreak{ - Low: low, - High: high, + Low: low, + High: high, Color: classBreaks[i][1], }) } // add last class break (> last value) classBreaksForTmpl = append(classBreaksForTmpl, classBreak{ - Low: classBreaks[len(classBreaks) - 1][0], - High: "", - Color: classBreaks[len(classBreaks) - 1][1], + Low: classBreaks[len(classBreaks)-1][0], + High: "", + Color: classBreaks[len(classBreaks)-1][1], }) log.Printf("%v", classBreaksForTmpl) return classBreaksForTmpl @@ -515,7 +515,7 @@ if err != nil { return err } - + // Parse data as template if entry.Name == "sounding_results_contour_lines_geoserver" { tmpl, err := template.New(entry.Name).Parse(data)