private void makeBboxHints(StringBuilder doc, TileLayer tl) { for (String gridSetId : tl.getGridSubsets()) { GridSubset subset = tl.getGridSubset(gridSetId); doc.append("<li>" + gridSetId + ": " + subset.getOriginalExtent().toString() + "</li>\n"); } }
private void makeBboxHints(StringBuilder doc, TileLayer tl) { for (String gridSetId : tl.getGridSubsets()) { GridSubset subset = tl.getGridSubset(gridSetId); doc.append( "<li>" + gridSetId + ": " + subset.getOriginalExtent().toString() + "</li>\n"); } }
params.put("BBOX", bbox.toString()); params.put("WIDTH", String.valueOf(widthHeight[0])); params.put("HEIGHT", String.valueOf(widthHeight[1]));
wmsParams.put("HEIGHT", String.valueOf(height)); wmsParams.put("WIDTH", String.valueOf(width)); wmsParams.put("BBOX", bbox.toString()); wmsParams.put("X", String.valueOf(x)); wmsParams.put("Y", String.valueOf(y));
params.put("WIDTH", String.valueOf(width)); params.put("HEIGHT", String.valueOf(height)); params.put("BBOX", bbox.toString());
wmsParams.put("HEIGHT", String.valueOf(height)); wmsParams.put("WIDTH", String.valueOf(width)); wmsParams.put("BBOX", bbox.toString()); wmsParams.put("X", String.valueOf(x)); wmsParams.put("Y", String.valueOf(y));
params.put("WIDTH", String.valueOf(width)); params.put("HEIGHT", String.valueOf(height)); params.put("BBOX", bbox.toString());
wmsParams.put("WIDTH", String.valueOf(width)); wmsParams.put("BBOX", bbox.toString());
HttpServletRequest fuserRequest( TileLayer layer, GridSubset gridSubset, BoundingBox bounds, int width, int height) { MockHttpServletRequest req = new MockHttpServletRequest(); Map<String, String> params = new HashMap<>(); params.put("layers", layer.getId()); params.put("srs", gridSubset.getSRS().toString()); params.put("format", "image/png"); params.put("bbox", bounds.toString()); params.put("width", Integer.toString(width)); params.put("height", Integer.toString(height)); req.setParameters(params); return req; }
public void makeRequest(ConveyorTile tile, Resource target) throws GeoWebCacheException { WMSLayer layer = (WMSLayer) tile.getLayer(); GridSubset gridSubset = layer.getGridSubset(tile.getGridSetId()); Map<String, String> wmsParams = layer.getWMSRequestTemplate(tile.getMimeType(), WMSLayer.RequestType.MAP); wmsParams.put("FORMAT", tile.getMimeType().getFormat()); wmsParams.put("SRS", layer.backendSRSOverride(gridSubset.getSRS())); wmsParams.put("HEIGHT", String.valueOf(gridSubset.getTileHeight())); wmsParams.put("WIDTH", String.valueOf(gridSubset.getTileWidth())); // strBuilder.append("&TILED=").append(requestTiled); BoundingBox bbox = gridSubset.boundsFromIndex(tile.getTileIndex()); wmsParams.put("BBOX", bbox.toString()); Map<String, String> filteringParameters = tile.getFilteringParameters(); if (filteringParameters.isEmpty()) { filteringParameters = layer.getDefaultParameterFilters(); } wmsParams.putAll(filteringParameters); if (tile.getMimeType() == XMLMime.kml) { // This is a hack for GeoServer to produce regionated KML, // but it is unlikely to do much harm, especially since nobody // else appears to produce regionated KML at this point wmsParams.put("format_options", "mode:superoverlay;overlaymode:auto"); } MimeType mimeType = tile.getMimeType(); makeRequest(tile, layer, wmsParams, mimeType, target); }
GridSubset gridSubset = layer.getGridSubset(tile.getGridSetId()); BoundingBox tileBounds = gridSubset.boundsFromIndex(tileIndex); servletResp.setHeader("geowebcache-tile-bounds", tileBounds.toString()); servletResp.setHeader("geowebcache-gridset", gridSubset.getName()); servletResp.setHeader("geowebcache-crs", gridSubset.getSRS().toString());
private String buildGetMap(final boolean directWMSIntegrationEndpoint, final String queryLayerName, final String gridsetId, String styles, final TileLayer tileLayer) { final GridSubset gridSubset = tileLayer.getGridSubset(gridsetId); long[] coverage = gridSubset.getCoverage(0); long[] tileIndex = { coverage[0], coverage[1], coverage[4] }; BoundingBox bounds = gridSubset.boundsFromIndex(tileIndex); final String endpoint = directWMSIntegrationEndpoint ? "wms" : "gwc/service/wms"; StringBuilder sb = new StringBuilder(endpoint); sb.append("?service=WMS&request=GetMap&version=1.1.1&format=image/png"); sb.append("&layers=").append(queryLayerName); sb.append("&srs=").append(gridSubset.getSRS()); sb.append("&width=").append(gridSubset.getGridSet().getTileWidth()); sb.append("&height=").append(gridSubset.getGridSet().getTileHeight()); sb.append("&styles="); if (styles != null) { sb.append(styles); } sb.append("&bbox=").append(bounds.toString()); return sb.toString(); }
/** * Verifies that this functions output remains as expected, since we communicate a lot using * strings. * * <p>Ff not you should figure out where it is used. * * @throws Exception */ public void testBBOX() throws Exception { BoundingBox bbox = new BoundingBox(-180.0, -90.0, 180.0, 90.0); assert (bbox.isSane()); String bboxStr = bbox.toString(); if (bboxStr.equalsIgnoreCase("-180.0,-90.0,180.0,90.0")) { assertTrue(true); } else { assertTrue(false); } }
kvp.put("bbox", new String[] {bounds.toString()});
+ bounds4326.toString());
private void setCacheMetadataHeaders(RawMap map, ConveyorTile cachedTile, TileLayer layer) { long[] tileIndex = cachedTile.getTileIndex(); CacheResult cacheResult = cachedTile.getCacheResult(); GridSubset gridSubset = layer.getGridSubset(cachedTile.getGridSetId()); BoundingBox tileBounds = gridSubset.boundsFromIndex(tileIndex); String cacheResultHeader = cacheResult == null ? "UNKNOWN" : cacheResult.toString(); map.setResponseHeader("geowebcache-layer", layer.getName()); map.setResponseHeader("geowebcache-cache-result", cacheResultHeader); map.setResponseHeader("geowebcache-tile-index", Arrays.toString(tileIndex)); map.setResponseHeader("geowebcache-tile-bounds", tileBounds.toString()); map.setResponseHeader("geowebcache-gridset", gridSubset.getName()); map.setResponseHeader("geowebcache-crs", gridSubset.getSRS().toString()); }
private void setCacheMetadataHeaders(RawMap map, ConveyorTile cachedTile, TileLayer layer) { long[] tileIndex = cachedTile.getTileIndex(); CacheResult cacheResult = cachedTile.getCacheResult(); GridSubset gridSubset = layer.getGridSubset(cachedTile.getGridSetId()); BoundingBox tileBounds = gridSubset.boundsFromIndex(tileIndex); String cacheResultHeader = cacheResult == null ? "UNKNOWN" : cacheResult.toString(); map.setResponseHeader("geowebcache-layer", layer.getName()); map.setResponseHeader("geowebcache-cache-result", cacheResultHeader); map.setResponseHeader("geowebcache-tile-index", Arrays.toString(tileIndex)); map.setResponseHeader("geowebcache-tile-bounds", tileBounds.toString()); map.setResponseHeader("geowebcache-gridset", gridSubset.getName()); map.setResponseHeader("geowebcache-crs", gridSubset.getSRS().toString()); }
request.addParameter("width", width + ""); request.addParameter("height", height + ""); request.addParameter("bbox", bounds.toString()); final File imageTile = new File(getClass().getResource("/image.png").toURI());
throw new GeoWebCacheException(layer.getName() + " (" + bbox.toString() + ") is too big for the sub grid set for " + gridSubset.getName() + ", allow for smaller zoom levels.");
layer.getName() + " (" + bbox.toString() + ") is too big for the sub grid set for " + gridSubset.getName()