Package org.geowebcache.grid

Examples of org.geowebcache.grid.Grid


        final GridSubset gridSubset = this.getGridSubset(gridSetId);

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

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

        // long[] coverage = gridSubset.getCoverage(z);
        // long coverageMinY = coverage[1];
        long coverageMaxY = grid.getExtent()[1] - 1;

        final long x = tileIndex[0];
        // invert the order of the requested Y ordinate, since ArcGIS caches are top-left to
        // bottom-right, and GWC computes tiles in bottom-left to top-right order
        final long y = (coverageMaxY - tileIndex[1]);
View Full Code Here


            e.setBounds(box);
            e.setSrid(srid);

            GridSet gridSet = gridSubset.getGridSet();
            for (int z = minmax[0]; z < minmax[1]; z++) {
                Grid g = gridSet.getGrid(z);

                TileMatrix m = new TileMatrix();
                m.setZoomLevel(z);
                m.setMatrixWidth((int) g.getNumTilesWide());
                m.setMatrixHeight((int) g.getNumTilesHigh());
                m.setTileWidth(gridSubset.getTileWidth());
                m.setTileHeight(gridSubset.getTileHeight());

                // TODO: not sure about this
                m.setXPixelSize(g.getResolution());
                m.setYPixelSize(g.getResolution());
                // m.setXPixelSize(gridSet.getPixelSize());
                // m.setYPixelSize(gridSet.getPixelSize());

                e.getTileMatricies().add(m);
            }
View Full Code Here

                null);

        int i = 0;
        double error = Math.abs(gridSet.getGrid(i).getScaleDenominator() - reqScale);
        while (i < gridSet.getNumLevels() - 1) {
            Grid g = gridSet.getGrid(i + 1);
            double e = Math.abs(g.getScaleDenominator() - reqScale);

            if (e > error) {
                break;
            } else {
                error = e;
View Full Code Here

        super.onBeforeRender();
    }

    public void addZoomLevel(ReferencedEnvelope bbox, int tileWidth, int tileHeight) {
        List<Grid> list = grids.getModelObject();
        final Grid newGrid = new Grid();
        if (list.isEmpty()) {
            BoundingBox extent = new BoundingBox(bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(),
                    bbox.getMaxY());
            final int levels = 1;
            GridSet tmpGridset = GridSetFactory.createGridSet("stub", SRS.getEPSG4326(), extent,
                    false, levels, 1D, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, tileWidth,
                    tileHeight, false);
            Grid grid = tmpGridset.getGridLevels()[0];
            newGrid.setResolution(grid.getResolution());
            newGrid.setScaleDenominator(grid.getScaleDenominator());
        } else {
            Grid prev = list.get(list.size() - 1);
            newGrid.setResolution(prev.getResolution() / 2);
            newGrid.setScaleDenominator(prev.getScaleDenominator() / 2);
        }
        list.add(newGrid);
        grids.setModelObject(list);
        // TileMatrixSetEditor.this.convertInput();
    }
View Full Code Here

                validatable.error(error);
                return;
            }

            for (int i = 1; i < grids.size(); i++) {
                Grid prev = grids.get(i - 1);
                Grid curr = grids.get(i);

                if (curr.getResolution() >= prev.getResolution()) {
                    String message = "Each resolution should be lower than it's prior one. Res["
                            + i + "] == " + curr.getResolution() + ", Res[" + (i - 1) + "] == "
                            + prev.getResolution() + ".";
                    error.setMessage(message);
                    validatable.error(error);
                    return;
                }

                if (curr.getScaleDenominator() >= prev.getScaleDenominator()) {
                    String message = "Each scale denominator should be lower "
                            + "than it's prior one. Scale[" + i + "] == "
                            + curr.getScaleDenominator() + ", Scale[" + (i - 1) + "] == "
                            + prev.getScaleDenominator() + ".";
                    error.setMessage(message);
                    validatable.error(error);
                    return;
                }
View Full Code Here

            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]);

            if (compactCache.tileExists(zoom, row, col))
View Full Code Here

        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;

        final long x = tileIndex[0];
        // invert the order of the requested Y ordinate, since ArcGIS caches are top-left to
        // bottom-right, and GWC computes tiles in bottom-left to top-right order
        final long y = (coverageMaxY - tileIndex[1]);
View Full Code Here

TOP

Related Classes of org.geowebcache.grid.Grid

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.