DefaultMapContext mapContext = new DefaultMapContext();
mapContext.setCoordinateReferenceSystem(geoService.getCrs2(clientMapInfo.getCrs()));
MapRasterizingInfo mapInfo = (MapRasterizingInfo) clientMapInfo.getWidgetInfo(MapRasterizingInfo.WIDGET_KEY);
mapContext.setAreaOfInterest(new ReferencedEnvelope(dtoConverterService.toInternal(mapInfo.getBounds()),
mapContext.getCoordinateReferenceSystem()));
RenderingHints renderingHints = new Hints();
renderingHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
RasterizingContainer response = new RasterizingContainer();
context.put(RasterizingPipelineCode.CLIENT_MAP_INFO_KEY, clientMapInfo);
context.put(RasterizingPipelineCode.RENDERING_HINTS, renderingHints);
context.put(RasterizingPipelineCode.MAP_CONTEXT_KEY, mapContext);
pipelineService.execute(RasterizingPipelineCode.PIPELINE_RASTERIZING_GET_LEGEND_IMAGE, null, context, response);