determineCanvasLayout();
createCanvas();
renderCanvas();
scaleRaster();
AccountingOutputStream aos=null;
RenderedImage finalImage =null;
try{
finalImage = canvas;
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType(this.outputFormat.getMimeType());
response.setCharacterEncoding("UTF-8");
ServletOutputStream os = response.getOutputStream();
aos = new AccountingOutputStream(os);
// Image encoding with the associated writer
encoderMap.encode(finalImage, outputFormat, aos,
encoderMap.isAggressiveOutputStreamSupported(outputFormat.getMimeType()), null);
log.debug("WMS response size: " + aos.getCount() + "bytes.");
stats.log(aos.getCount(), CacheResult.WMS);
} catch (Exception e) {
log.debug("IOException writing untiled response to client: " + e.getMessage(),e);
// closing the stream
if(aos!=null){