Package org.geowebcache.grid

Examples of org.geowebcache.grid.GridSet


            public List<GridSet> getItems() {
                GridSetBroker gridSetBroker = GWC.get().getGridSetBroker();
                List<String> list = selection.getObject();
                List<GridSet> gridsets = new ArrayList<GridSet>(list.size());
                for (String id : list) {
                    GridSet gridSet = gridSetBroker.get(id);
                    if (gridSet != null) {
                        gridsets.add(gridSet);
                    }
                }
                return gridsets;
View Full Code Here


            mediator.addGridSet(null);
            fail();
        } catch (NullPointerException e) {
            assertTrue(true);
        }
        GridSet gset = mock(GridSet.class);
        GridSet gset2 = mock(GridSet.class);
        doThrow(new IOException("fake")).when(tld).addGridSet(same(gset));
        try {
            mediator.addGridSet(gset);
            fail();
        } catch (IOException e) {
View Full Code Here

        verify(tld, times(1)).addGridSet(same(gset2));
    }

    @Test
    public void testModifyGridsetPreconditions() throws Exception {
        GridSet oldGridset = gridSetBroker.get("EPSG:4326");
        try {
            mediator.modifyGridSet(null, oldGridset);
            fail();
        } catch (NullPointerException e) {
            assertTrue(true);
View Full Code Here

    @Test
    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();
        }
View Full Code Here

    @Test
    public void testModifyGridsetTruncates() 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);

            // make it so the gridset forces truncation
View Full Code Here

        } catch (NullPointerException e) {
            assertTrue(true);
        }

        {
            final GridSet oldGridset = gridSetBroker.get("EPSG:4326");
            final GridSet newGridset;
            XMLGridSet xmlGridSet = new XMLGridSet(oldGridset);
            xmlGridSet.setName("My4326");
            // make it a bit different
            xmlGridSet.setAlignTopLeft(!xmlGridSet.getAlignTopLeft());
            newGridset = xmlGridSet.makeGridSet();
View Full Code Here

        Multimap<SRS, GridSubset> bySrs = LinkedHashMultimap.create();

        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);
            bySrs.put(gridSet.getSrs(), gridSubSet);

            when(tileLayer.getGridSubset(eq(gsetName))).thenReturn(gridSubSet);

        }
        for (SRS srs : bySrs.keySet()) {
View Full Code Here

        /*
         * If the gridset has a top left tile origin, lets tell that to open layers. Otherwise it'll
         * calculate tile bounds based on the bbox bottom left corner, leading to misaligned
         * requests.
         */
        GridSet gridSet = gridSubset.getGridSet();
        if (gridSet.isTopLeftAligned()) {
            page += ",\n tileOrigin: new OpenLayers.LonLat(" + bbox.getMinX() + ", "
                    + bbox.getMaxY() + ")";
        }

        page += "});\n" + "map.addLayer(demolayer);\n" + "map.zoomToExtent(new OpenLayers.Bounds("
View Full Code Here

                } else {
                    String gridSetName = name + ":" + srs.toString();
                    BoundingBox extent = new BoundingBox(env.getMinX(), env.getMinY(),
                            env.getMaxX(), env.getMaxY());

                    GridSet gridSet = GridSetFactory.createGridSet(gridSetName, srs, extent, false,
                            25, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, 256, 256, false);
                    grids.put(gridSetName, GridSubsetFactory.createGridSubSet(gridSet));
                }
            }
View Full Code Here

    }

    protected void writeResponse(RuntimeStats stats) throws OWSException {
        TileLayer layer = convTile.getLayer();

        GridSet gridSet = convTile.getGridSubset().getGridSet();
        if (gridSet.getTileHeight() < j || j < 0) {
            throw new OWSException(400, "PointIJOutOfRange", "J", "J was " + j
                    + ", must be between 0 and " + gridSet.getTileHeight());
        }

        if (gridSet.getTileWidth() < i || i < 0) {
            throw new OWSException(400, "PointIJOutOfRange", "I", "I was " + i
                    + ", must be between 0 and " + gridSet.getTileWidth());
        }

        Resource data = null;
        try {
            BoundingBox bbox = convTile.getGridSubset().boundsFromIndex(convTile.getTileIndex());
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.