@Override public void dispose() { if (metaTileMap != null) { metaTileMap.dispose(); metaTileMap = null; } super.dispose(); } }
calculateMetaTileGridBounds( gridSubset.getCoverage((int) tileGridPosition[2]), tileGridPosition); tilesGridPositions = calculateTilesGridPositions(); calculateEdgeGutter(); int tileHeight = gridSubset.getTileHeight(); int tileWidth = gridSubset.getTileWidth(); this.tiles = createTiles(tileHeight, tileWidth);
private void commonCreateTileFromMetaTileTest(Color[][] colors, RenderedImage metaTileImage) throws Exception { // creating the meta tile BoundingBox boundingBox = new BoundingBox(0, 0, 180, 90); int metaHeight = 2; int metaWidth = 2; GridSubset grid = GridSubsetFactory.createGridSubSet( gridSetBroker.getWorldEpsg4326(), boundingBox, 0, 21); long[] gridPos = {0, 0, 0}; MetaTile metaTile = new MetaTile(grid, ImageMime.png, null, gridPos, metaWidth, metaHeight, null); metaTile.setImage(metaTileImage); // extracting the tiles using the create tile method int width = metaTile.getMetaTileWidth(); int height = metaTile.getMetaTileHeight(); checkImageBorderSameColor(metaTile.createTile(0, 0, width, height), colors[0][0]); checkImageBorderSameColor(metaTile.createTile(width, 0, width, height), colors[0][1]); checkImageBorderSameColor(metaTile.createTile(0, height, width, height), colors[1][0]); checkImageBorderSameColor(metaTile.createTile(width, height, width, height), colors[1][1]); }
final GridSubset gridSubset = getGridSubset(gridSetId); int width = metaTile.getMetaTileWidth(); int height = metaTile.getMetaTileHeight(); String srs = gridSubset.getSRS().toString(); String format = mimeType.getFormat(); BoundingBox bbox = metaTile.getMetaTileBounds();
createTile(tileRegion.x, tileRegion.y, tileRegion.width, tileRegion.height); disposeLater(tile);
public void setImageBytes(Resource buffer) throws GeoWebCacheException { Assert.notNull(buffer, "WMSMetaTile.setImageBytes() received null"); Assert.isTrue(buffer.getSize() > 0, "WMSMetaTile.setImageBytes() received empty contents"); try { ImageInputStream imgStream; imgStream = new ResourceImageInputStream(((ByteArrayResource) buffer).getInputStream()); RenderedImage metaTiledImage = ImageIO.read(imgStream); // read closes the stream for us setImage(metaTiledImage); } catch (IOException ioe) { throw new GeoWebCacheException( "WMSMetaTile.setImageBytes() " + "failed on ImageIO.read(byte[" + buffer.getSize() + "])", ioe); } if (metaTileImage == null) { throw new GeoWebCacheException( "ImageIO.read(InputStream) returned null. Unable to read image."); } }
final GridSubset gridSubset = getGridSubset(gridSetId); int width = metaTile.getMetaTileWidth(); int height = metaTile.getMetaTileHeight(); String srs = gridSubset.getSRS().toString(); String format = mimeType.getFormat(); BoundingBox bbox = metaTile.getMetaTileBounds();
@Override public void dispose() { if (metaTileMap != null) { metaTileMap.dispose(); metaTileMap = null; } super.dispose(); } }