From 7c6a061d95f5ac805e09e59ebadd6b3040075e8e Mon Sep 17 00:00:00 2001 From: iserge Date: Thu, 14 Apr 2016 10:45:21 +0300 Subject: [PATCH] Fixes and add some functional --- .../coverage/GSImageMosaicEncoder.java | 66 +++++++++++++++++-- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/src/main/java/it/geosolutions/geoserver/rest/encoder/coverage/GSImageMosaicEncoder.java b/src/main/java/it/geosolutions/geoserver/rest/encoder/coverage/GSImageMosaicEncoder.java index ccef631f..1ce3f178 100644 --- a/src/main/java/it/geosolutions/geoserver/rest/encoder/coverage/GSImageMosaicEncoder.java +++ b/src/main/java/it/geosolutions/geoserver/rest/encoder/coverage/GSImageMosaicEncoder.java @@ -230,14 +230,14 @@ public void setInputTransparentColor(final String val) { addInputTransparentColor(val); } - public Boolean getInputTransparentColor() { + public String getInputTransparentColor() { Element el = getParameter(inputTransparentColorFilter); if (el != null) { List values = el.getChildren(); for (Element elm : values) { String value = elm.getValue(); if (!value.equalsIgnoreCase(inputTransparentColor)) { - return Boolean.valueOf(value); + return value; } } } @@ -265,16 +265,16 @@ protected void addOutputTransparentColor(final String val) { public void setOutputTransparentColor(final String val) { removeParameter(outputTransparentColorFilter); - addInputTransparentColor(val); + addOutputTransparentColor(val); } - public Boolean getOutputTransparentColor() { + public String getOutputTransparentColor() { Element el = getParameter(outputTransparentColorFilter); if (el != null) { List values = el.getChildren(); for (Element elm : values) { String value = elm.getValue(); if (!value.equalsIgnoreCase(outputTransparentColor)) { - return Boolean.valueOf(value); + return value; } } } @@ -409,7 +409,7 @@ protected void addSORTING(final String val) { public void setSORTING(final String val) { removeParameter(SORTING_FILTER); - addBackgroundValues(val); + addSORTING(val); } // @@ -432,6 +432,58 @@ protected void addMergeBehavior(final String val) { public void setMergeBehavior(final String val) { removeParameter(MERGEBEHAVIOR_FILTER); - addBackgroundValues(val); + addMergeBehavior(val); + } + + public final static String ACCURATERESOLUTIONCOMPUTATION = "Accurate resolution computation"; + protected void addAccurateResolutionComputation(final boolean val) { + final List list = new ArrayList(2); + list.add(new Element(STRING).setText(ACCURATERESOLUTIONCOMPUTATION)); + list.add(new Element(STRING).setText((val) ? "true" : "false")); + parameters.add(null, list); + } + private final static Filter ACCURATERESOLUTIONCOMPUTATION_FILTER = new parametersFilter(ACCURATERESOLUTIONCOMPUTATION); + public void setAccurateResolutionComputation(final boolean val) { + removeParameter(ACCURATERESOLUTIONCOMPUTATION_FILTER); + addAccurateResolutionComputation(val); + } + public Boolean getAccurateResolutionComputation() { + Element el = getParameter(ACCURATERESOLUTIONCOMPUTATION_FILTER); + if (el != null) { + List values = el.getChildren(); + for (Element elm : values) { + String value = elm.getValue(); + if (!value.equalsIgnoreCase(ACCURATERESOLUTIONCOMPUTATION)) { + return Boolean.valueOf(value); + } + } + } + return null; + } + + public final static String FOOTPRONTBEHAVIOR = "FootprintBehavior"; + protected void addFootprintBehavior(final String val) { + final List list = new ArrayList(2); + list.add(new Element(STRING).setText(FOOTPRONTBEHAVIOR)); + list.add(new Element(STRING).setText(val)); + parameters.add(null, list); + } + private final static Filter FOOTPRONTBEHAVIOR_FILTER = new parametersFilter(FOOTPRONTBEHAVIOR); + public void setFootprintBehavior(final String val) { + removeParameter(FOOTPRONTBEHAVIOR_FILTER); + addFootprintBehavior(val); + } + public String getFootprintBehavior() { + Element el = getParameter(FOOTPRONTBEHAVIOR_FILTER); + if (el != null) { + List values = el.getChildren(); + for (Element elm : values) { + String value = elm.getValue(); + if (!value.equalsIgnoreCase(FOOTPRONTBEHAVIOR)) { + return value; + } + } + } + return null; } }