Skip to content

Commit

Permalink
[GEOS-8718] Remove weird logs during wps animation generation, when d…
Browse files Browse the repository at this point in the history
…ecoration is on
  • Loading branch information
aaime committed Apr 24, 2018
1 parent f13763a commit 8750e5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ RenderedImage buildImage(ReferencedEnvelope bbox, String decorationName, String
if (layer.getCapabilities() == null) {
RenderedImageMap map = renderInternalLayer(layer, template);
image = map.getImage();
map.getMapContext().dispose();
} else {
image = getImageFromWebMapServer(layer, template, bbox, serverCache);
}
Expand Down Expand Up @@ -291,6 +292,7 @@ RenderedImage buildImage(ReferencedEnvelope bbox, String decorationName, String
content.setMapWidth(width);
content.setMapHeight(height);
content.setTransparent(true);
content.getViewport().setBounds(bbox);
RenderedImageMapOutputFormat renderer = new RenderedImageMapOutputFormat(wms);
RenderedImageMap map = renderer.produceMap(content);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public int compare(Object o1, Object o2) {
// limiting number of elements we can create
if(j>= MAX_ELEMENTS_TIMES_KVP){
if(LOGGER.isLoggable(Level.INFO))
LOGGER.info("Lmiting number of elements in this periodo to "+MAX_ELEMENTS_TIMES_KVP);
LOGGER.info("Limiting number of elements in this period to " + MAX_ELEMENTS_TIMES_KVP);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,29 +309,31 @@ private static MapDecorationLayout fromDocument(MapDecorationLayout dl, Document

Dimension size = null;

String theSize = e.getAttributeValue("size");
try {
if (e.getAttributeValue("size") != null
&& !e.getAttributeValue("size").equalsIgnoreCase("auto")) {
String[] sizeArr = e.getAttributeValue("size").split(",");
if (theSize != null && !theSize.equalsIgnoreCase("auto")) {
String[] sizeArr = theSize.split(",");

size = new Dimension(Integer.valueOf(sizeArr[0]), Integer.valueOf(sizeArr[1]));
}
} catch (Exception exc){
LOGGER.log(
Level.WARNING,
"Couldn't interpret size parameter: " + e.getAttributeValue("size"),
e
LOGGER.log(Level.WARNING,
"Couldn't interpret size parameter: " + theSize, e
);
}

Point offset = null;
String theOffset = e.getAttributeValue("offset");
try {
String[] offsetArr = e.getAttributeValue("offset").split(",");
offset = new Point(Integer.valueOf(offsetArr[0]), Integer.valueOf(offsetArr[1]));
if (offset != null) {
String[] offsetArr = theOffset.split(",");
offset = new Point(Integer.valueOf(offsetArr[0]), Integer.valueOf(offsetArr[1]));
} else {
offset = new Point(0, 0);
}
} catch (Exception exc) {
LOGGER.log(
Level.WARNING,
"Couldn't interpret size parameter: " + e.getAttributeValue("offset")
LOGGER.log(Level.WARNING,
"Couldn't interpret offset parameter: " + theOffset, e
);
offset = new Point(0, 0);
}
Expand Down

0 comments on commit 8750e5a

Please sign in to comment.