Source:
public WebMap produceMap(final WMSMapContent mapContent) throws ServiceException, IOException { checkNotNull(mapContent); checkNotNull(mapContent.getRenderingArea()); checkArgument(mapContent.getMapWidth() > 0); checkArgument(mapContent.getMapHeight() > 0); final ReferencedEnvelope renderingArea = mapContent.getRenderingArea(); int mapWidth = mapContent.getMapWidth(); int mapHeight = mapContent.getMapHeight(); Rectangle paintArea = new Rectangle(mapWidth, mapHeight); if (this.tileBuilderFactory.shouldOversampleScale()) { paintArea = new Rectangle( this.tileBuilderFactory.getOversampleX() * mapWidth, this.tileBuilderFactory.getOversampleY() * mapHeight); } VectorTileBuilder vectorTileBuilder; vectorTileBuilder = this.tileBuilderFactory.newBuilder(paintArea, renderingArea); CoordinateReferenceSystem sourceCrs; for (Layer layer : mapContent.layers()) { FeatureSource<?, ?> featureSource = layer.getFeatureSource(); GeometryDescriptor geometryDescriptor = featureSource.getSchema().getGeometryDescriptor(); if (null == geometryDescriptor) { continue; } sourceCrs = geometryDescriptor.getType().getCoordinateReferenceSystem(); int buffer = VectorMapRenderUtils.getComputedBuffer( mapContent.getBuffer(), VectorMapRenderUtils.getFeatureStyles( layer, paintArea, VectorMapRenderUtils.getMapScale(mapContent, renderingArea), (FeatureType) featureSource.getSchema())); buffer *= Math.max( Math.max( this.tileBuilderFactory.getOversampleX(), this.tileBuilderFactory.getOversampleY()), 1); Pipeline pipeline = getPipeline(mapContent, renderingArea, paintArea, sourceCrs, buffer); Query query = getStyleQuery(layer, mapContent); query.getHints().remove(Hints.SCREENMAP); FeatureCollection<?, ?> features = featureSource.getFeatures(query); run(features, pipeline, geometryDescriptor, vectorTileBuilder, layer); } WebMap map = vectorTileBuilder.build(mapContent); return map; }

Target:
public WebMap produceMap(final WMSMapContent mapContent) throws ServiceException, IOException { checkNotNull(mapContent); checkNotNull(mapContent.getRenderingArea()); checkArgument(mapContent.getMapWidth() > 0); checkArgument(mapContent.getMapHeight() > 0); final ReferencedEnvelope renderingArea = mapContent.getRenderingArea(); int mapWidth = mapContent.getMapWidth(); int mapHeight = mapContent.getMapHeight(); Rectangle paintArea = new Rectangle(mapWidth, mapHeight); if (this.tileBuilderFactory.shouldOversampleScale()) { paintArea = new Rectangle( this.tileBuilderFactory.getOversampleX() * mapWidth, this.tileBuilderFactory.getOversampleY() * mapHeight); } VectorTileBuilder vectorTileBuilder; vectorTileBuilder = this.tileBuilderFactory.newBuilder(paintArea, renderingArea); CoordinateReferenceSystem sourceCrs; for (Layer layer : mapContent.layers()) { FeatureSource<?, ?> featureSource = layer.getFeatureSource(); GeometryDescriptor geometryDescriptor = featureSource.getSchema().getGeometryDescriptor(); if (null == geometryDescriptor) { continue; } sourceCrs = geometryDescriptor.getType().getCoordinateReferenceSystem(); int buffer = VectorMapRenderUtils.getComputedBuffer( mapContent.getBuffer(), VectorMapRenderUtils.getFeatureStyles( layer, paintArea, VectorMapRenderUtils.getMapScale(mapContent, renderingArea), (FeatureType) featureSource.getSchema())); if (this.tileBuilderFactory.shouldOversampleScale()) { buffer *= Math.max( Math.max( this.tileBuilderFactory.getOversampleX(), this.tileBuilderFactory.getOversampleY()), 1); } Pipeline pipeline = getPipeline(mapContent, renderingArea, paintArea, sourceCrs, buffer); Query query = getStyleQuery(layer, mapContent); query.getHints().remove(Hints.SCREENMAP); FeatureCollection<?, ?> features = featureSource.getFeatures(query); run(features, pipeline, geometryDescriptor, vectorTileBuilder, layer); } WebMap map = vectorTileBuilder.build(mapContent); return map; }