Package org.geowebcache.grid

Examples of org.geowebcache.grid.GridSet


     * @see {@link GridSetBroker#remove(String)}
     */
    public synchronized Configuration removeGridset(final String gridSetName)
            throws IllegalStateException, IOException {

        GridSet gridSet = gridSetBroker.get(gridSetName);
        if (gridSet == null) {
            return null;
        }
        List<String> refereningLayers = new ArrayList<String>();
        for (TileLayer layer : getLayerList()) {
            GridSubset gridSubset = layer.getGridSubset(gridSetName);
            if (gridSubset != null) {
                refereningLayers.add(layer.getName());
            }
        }
        if (refereningLayers.size() > 0) {
            throw new IllegalStateException("There are TileLayers referencing gridset '"
                    + gridSetName + "': " + refereningLayers.toString());
        }
        XMLConfiguration persistingConfig = getXmlConfiguration();
        GridSet removed = gridSetBroker.remove(gridSetName);
        Assert.notNull(removed != null);
        Assert.notNull(persistingConfig.removeGridset(gridSetName));

        return persistingConfig;
    }
View Full Code Here


                if (log.isDebugEnabled()) {
                    log.debug("Reading " + xmlGridSet.getName());
                }

                GridSet gridSet = xmlGridSet.makeGridSet();

                log.info("Read GridSet " + gridSet.getName());

                gridSetBroker.put(gridSet);
            }
        }
    }
View Full Code Here

       
        if(dataBounds == null) {
            dataBounds = gridBounds;
        }
       
        GridSet gridSet;
       
        if(srs.equals(SRS.getEPSG4326()) && gridBounds.equals(BoundingBox.WORLD4326) && resolutions == null) {
            gridSet = gridSetBroker.WORLD_EPSG4326;
        } else if(srs.equals(SRS.getEPSG3857()) && gridBounds.equals(BoundingBox.WORLD3857) && resolutions == null) {
            gridSet = gridSetBroker.WORLD_EPSG3857;
View Full Code Here

        final CacheInfo info = this.cacheInfo;
        final TileCacheInfo tileCacheInfo = info.getTileCacheInfo();

        final String layerName = getName();
        final GridSetBuilder gsBuilder = new GridSetBuilder();
        GridSet gridSet = gsBuilder.buildGridset(layerName, info, layerBounds);

        gridSetBroker.put(gridSet);

        final List<LODInfo> lodInfos = tileCacheInfo.getLodInfos();
        Integer zoomStart = lodInfos.get(0).getLevelID();
        Integer zoomStop = lodInfos.get(lodInfos.size() - 1).getLevelID();

        GridSubset subSet = GridSubsetFactory.createGridSubSet(gridSet, this.layerBounds,
                zoomStart, zoomStop);

        Hashtable<String, GridSubset> subsets = new Hashtable<String, GridSubset>();
        subsets.put(gridSet.getName(), subSet);
        return subsets;
    }
View Full Code Here

        if (storageFormat.equals(CacheStorageInfo.COMPACT_FORMAT_CODE)) {
            final long[] tileIndex = tile.getTileIndex();
            final String gridSetId = tile.getGridSetId();
            final GridSubset gridSubset = this.getGridSubset(gridSetId);

            GridSet gridSet = gridSubset.getGridSet();
            final int zoom = (int) tileIndex[2];

            Grid grid = gridSet.getGridLevels()[zoom];
            long coverageMaxY = grid.getNumTilesHigh() - 1;

            final int col = (int) tileIndex[0];
            final int row = (int) (coverageMaxY - tileIndex[1]);
View Full Code Here

        final MimeType mimeType = tile.getMimeType();
        final long[] tileIndex = tile.getTileIndex();
        final String gridSetId = tile.getGridSetId();
        final GridSubset gridSubset = this.getGridSubset(gridSetId);

        GridSet gridSet = gridSubset.getGridSet();
        final int z = (int) tileIndex[2];

        Grid grid = gridSet.getGridLevels()[z];

        // long[] coverage = gridSubset.getCoverage(z);
        // long coverageMinY = coverage[1];
        long coverageMaxY = grid.getNumTilesHigh() - 1;
View Full Code Here

        Map<SRS, List<GridSubset>> bySrs = new HashMap<SRS, List<GridSubset>>();

        GridSetBroker broker = gridsetBroker;

        for (String gsetName : gridSetNames) {
            GridSet gridSet = broker.get(gsetName);
            XMLGridSubset xmlGridSubset = new XMLGridSubset();
            String gridSetName = gridSet.getName();
            xmlGridSubset.setGridSetName(gridSetName);
            GridSubset gridSubSet = xmlGridSubset.getGridSubSet(broker);
            subsets.put(gsetName, gridSubSet);

            List<GridSubset> list = bySrs.get(gridSet.getSrs());
            if (list == null) {
                list = new ArrayList<GridSubset>();
                bySrs.put(gridSet.getSrs(), list);
            }
            list.add(gridSubSet);

            when(tileLayer.getGridSubset(eq(gsetName))).thenReturn(gridSubSet);
View Full Code Here

        if (getYCoordinateFirst() == null) {
            setYCoordinateFirst(false);
        }

        GridSet gridSet;

        String name = getName();
        SRS srs = getSrs();
        BoundingBox extent = getExtent();
        Boolean alignTopLeft = getAlignTopLeft();
        double[] resolutions = getResolutions();
        double[] scaleDenominators = getScaleDenominators();
        Double metersPerUnit = getMetersPerUnit();
        Double pixelSize = getPixelSize();
        String[] scaleNames = getScaleNames();
        Integer tileWidth = getTileWidth();
        Integer tileHeight = getTileHeight();
        Boolean yCoordinateFirst = getYCoordinateFirst();

        if (getResolutions() != null || getScaleDenominators() != null) {
            gridSet = GridSetFactory.createGridSet(name, srs, extent, alignTopLeft, resolutions,
                    scaleDenominators, metersPerUnit, pixelSize, scaleNames, tileWidth, tileHeight,
                    yCoordinateFirst);
        } else {
            if (getLevels() == null) {
                setLevels(18);
            }

            Integer levels = getLevels();
            gridSet = GridSetFactory.createGridSet(name, srs, extent, alignTopLeft, levels,
                    metersPerUnit, pixelSize, tileWidth, tileHeight, yCoordinateFirst);
        }

        gridSet.setDescription(getDescription());

        return gridSet;
    }
View Full Code Here

        return new XMLGridSubset(this);
    }

    public GridSubset getGridSubSet(GridSetBroker gridSetBroker) {

        GridSet gridSet = gridSetBroker.get(getGridSetName());

        if (gridSet == null) {
            log.error("Unable to find GridSet for \"" + getGridSetName() + "\"");
            return null;
        }
View Full Code Here

            ymin = ymax - (numTilesHigh * height);
            gridSetExtent = new BoundingBox(xmin, ymin, xmax, ymax);
        }

        String gridsetName = srs.toString() + "_" + layerName;
        GridSet layerGridset = GridSetFactory.createGridSet(gridsetName, srs, gridSetExtent,
                alignTopLeft, resolutions, scaleDenominators, metersPerUnit, pixelSize, scaleNames,
                tileWidth, tileHeight, yCoordinateFirst);

        return layerGridset;
    }
View Full Code Here

TOP

Related Classes of org.geowebcache.grid.GridSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.