private static void truncate( final GeoServerTileLayer tileLayer, final String gridsetId, final Geometry geomInGridsetCrs, final TileBreeder breeder) { final List<MimeType> mimeTypes = tileLayer.getMimeTypes(); final Set<String> cachedStyles = getCachedStyles(tileLayer); final String defaultStyle = tileLayer.getStyles(); GridSubset gridSubset = tileLayer.getGridSubset(gridsetId); for (String style : cachedStyles) { Map<String, String> parameters; if (style.isEmpty() || style.equals(defaultStyle)) { parameters = null; } else { parameters = Collections.singletonMap("STYLES", style); } for (MimeType mime : mimeTypes) { truncate(breeder, tileLayer, gridSubset, mime, parameters, geomInGridsetCrs); } } }
GridSubset gridSubset = tileLayer.getGridSubset(gridsetId); final CoordinateReferenceSystem gridSetCrs = getGridsetCrs(gridSubset);
bySrs.put(gridSet.getSrs(), gridSubSet); when(tileLayer.getGridSubset(eq(gsetName))).thenReturn(gridSubSet); assertNotNull(tileLayer.getGridSubset(gsetName));
final GridSubset gridSubset = getGridSubset(gridSetId);
BoundingBox layerBounds = tileLayer.getGridSubset("EPSG:4326").getGridSet() .getOriginalExtent();
final GridSubset gridSubset = getGridSubset(gridSetId);
private GeoServerMetaTile createMetaTile(ConveyorTile tile, final int metaX, final int metaY) { GeoServerMetaTile metaTile; String tileGridSetId = tile.getGridSetId(); GridSubset gridSubset = getGridSubset(tileGridSetId); MimeType responseFormat = tile.getMimeType(); FormatModifier formatModifier = null; long[] tileGridPosition = tile.getTileIndex(); int gutter = info.getGutter(); metaTile = new GeoServerMetaTile(gridSubset, responseFormat, formatModifier, tileGridPosition, metaX, metaY, gutter); return metaTile; }
@Override public void seedTile(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException, IOException { // Ignore a seed call on a tile that's outside the cached grid levels range final GridSubset gridSubset = getGridSubset(tile.getGridSetId()); final int zLevel = (int) tile.getTileIndex()[2]; if (!gridSubset.shouldCacheAtZoom(zLevel)) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Ignoring seed call on tile " + tile + " as it's outside the cacheable zoom level range"); } return; } int metaX = info.getMetaTilingX(); int metaY = info.getMetaTilingY(); if (!tile.getMimeType().supportsTiling()) { metaX = metaY = 1; } getMetatilingReponse(tile, tryCache, metaX, metaY); }
@Override public void seedTile(ConveyorTile tile, boolean tryCache) throws GeoWebCacheException, IOException { // Ignore a seed call on a tile that's outside the cached grid levels range final GridSubset gridSubset = getGridSubset(tile.getGridSetId()); final int zLevel = (int) tile.getTileIndex()[2]; if (!gridSubset.shouldCacheAtZoom(zLevel)) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest( "Ignoring seed call on tile " + tile + " as it's outside the cacheable zoom level range"); } return; } int metaX = info.getMetaTilingX(); int metaY = info.getMetaTilingY(); if (!tile.getMimeType().supportsTiling()) { metaX = metaY = 1; } getMetatilingReponse(tile, tryCache, metaX, metaY); }
final GridSubset gridSubset = getGridSubset(tileGridSetId); if (gridSubset == null) { throw new IllegalArgumentException("Requested gridset not found: " + tileGridSetId);
final GridSubset gridSubset = getGridSubset(tileGridSetId); if (gridSubset == null) { throw new IllegalArgumentException("Requested gridset not found: " + tileGridSetId);
private ConveyorTile getMetatilingReponse(ConveyorTile tile, final boolean tryCache, final int metaX, final int metaY) throws GeoWebCacheException, IOException { final GridSubset gridSubset = getGridSubset(tile.getGridSetId()); final int zLevel = (int) tile.getTileIndex()[2]; tile.setMetaTileCacheOnly(!gridSubset.shouldCacheAtZoom(zLevel));
private GeoServerMetaTile createMetaTile(ConveyorTile tile, final int metaX, final int metaY) { GeoServerMetaTile metaTile; String tileGridSetId = tile.getGridSetId(); GridSubset gridSubset = getGridSubset(tileGridSetId); MimeType responseFormat = tile.getMimeType(); FormatModifier formatModifier = null; long[] tileGridPosition = tile.getTileIndex(); int gutter = responseFormat.isVector() ? 0 : info.getGutter(); metaTile = new GeoServerMetaTile( gridSubset, responseFormat, formatModifier, tileGridPosition, metaX, metaY, gutter); return metaTile; }
throws GeoWebCacheException, IOException { final GridSubset gridSubset = getGridSubset(tile.getGridSetId()); final int zLevel = (int) tile.getTileIndex()[2]; tile.setMetaTileCacheOnly(!gridSubset.shouldCacheAtZoom(zLevel));
public void testModifyGridsetNoNeedToTruncate() throws Exception { final String oldName = "EPSG:4326"; final String newName = "MyEPSG:4326"; final GridSet oldGridset = gridSetBroker.get(oldName); final GridSet newGridset; { XMLGridSet xmlGridSet = new XMLGridSet(oldGridset); xmlGridSet.setName(newName); newGridset = xmlGridSet.makeGridSet(); } XMLConfiguration xmlConfig = mock(XMLConfiguration.class); mediator = spy(mediator); when(mediator.getXmlConfiguration()).thenReturn(xmlConfig); assertNotNull(tileLayer.getGridSubset(oldName)); assertNotNull(tileLayerGroup.getGridSubset(oldName)); when(tld.getConfiguration(same(tileLayer))).thenReturn(config); when(tld.getConfiguration(same(tileLayerGroup))).thenReturn(config); mediator.modifyGridSet(oldName, newGridset); assertNull(tileLayer.getGridSubset(oldName)); assertNull(tileLayerGroup.getGridSubset(oldName)); assertNotNull(tileLayer.getGridSubset(newName)); assertNotNull(tileLayerGroup.getGridSubset(newName)); verify(xmlConfig, times(1)).removeGridset(eq(oldName)); verify(xmlConfig, times(1)).addOrReplaceGridSet(eq(new XMLGridSet(newGridset))); verify(xmlConfig, times(1)).save(); assertNull(gridSetBroker.get(oldName)); assertEquals(newGridset, gridSetBroker.get(newName)); verify(config, times(1)).save(); }
bounds = tileLayer.getGridSubset(expectedGridset).boundsFromIndex(tileIndex);
bounds = tileLayer.getGridSubset("EPSG:900913").boundsFromIndex(new long[] { 0, 0, 1 });