Package org.geowebcache.grid

Examples of org.geowebcache.grid.BoundingBox


            System.out.println(tl.getName());
            if(tl.getName().equals("sf:AggregateGeoFeature")) {
                //tl.isInitialized();
                foudAGF = true;
                GridSubset epsg4326 = tl.getGridSubset(gwcListener.gridSetBroker.WORLD_EPSG4326.getName());
                assertTrue(epsg4326.getGridSetBounds().equals( new BoundingBox(-180.0,-90.0,180.0,90.0)));
                String mime = tl.getMimeTypes().get(1).getMimeType();
                assertTrue(mime.startsWith("image/") || mime.startsWith("application/vnd.google-earth.kml+xml"));
            }
        }
       
View Full Code Here


        double minX = latLonEnv.getMinX();
        double minY = latLonEnv.getMinY();
        double maxX = latLonEnv.getMaxX();
        double maxY = latLonEnv.getMaxY();

        BoundingBox bounds4326 = new BoundingBox(minX,minY,maxX,maxY);
        BoundingBox bounds900913 = new BoundingBox(
                longToSphericalMercatorX(minX),
                latToSphericalMercatorY(minY),
                longToSphericalMercatorX(maxX),
                latToSphericalMercatorY(maxY));
       
        Hashtable<String,GridSubset> grids = new Hashtable<String,GridSubset>(3);
       
        GridSubset gridSubset4326 = GridSubsetFactory.createGridSubSet(
                gridSetBroker.WORLD_EPSG4326,
                bounds4326, 0, 25 );
       
        grids.put(gridSetBroker.WORLD_EPSG4326.getName(), gridSubset4326);
       
        GridSubset gridSubset900913 = GridSubsetFactory.createGridSubSet(
                gridSetBroker.WORLD_EPSG3857,
                bounds900913, 0, 25 );
       
        grids.put(gridSetBroker.WORLD_EPSG3857.getName(), gridSubset900913);
       
        // Native stuff
        if(nativeSRSName != null && ! nativeSRSName.equalsIgnoreCase("EPSG:4326")) {
           
            minX = nativeEnv.getMinX();
            minY = nativeEnv.getMinY();
            maxX = nativeEnv.getMaxX();
            maxY = nativeEnv.getMaxY();

            BoundingBox nativeBounds = new BoundingBox(minX,minY,maxX,maxY);
           
            SRS srs = null;
            try {
                srs = SRS.getSRS(nativeSRSName);
            } catch (GeoWebCacheException e) {
View Full Code Here

   
    public void testTileFuserResolution() throws Exception {
        TileLayer layer = createWMSLayer();
       
        // request fits inside -30.0,15.0,45.0,30
        BoundingBox bounds = new BoundingBox(-25.0,17.0,40.0,22);
       
        // One in between
        int width = (int) bounds.getWidth() * 10;
        int height= (int) bounds.getHeight() * 10;
        WMSTileFuser tileFuser = new WMSTileFuser(layer, layer.getGridSubsets().values().iterator().next(), bounds, width, height);
        tileFuser.determineSourceResolution();
        assertEquals(0.087890625, tileFuser.srcResolution, 0.087890625*0.001);
       
        // Zoomed too far out
        height = (int) bounds.getWidth() / 10;
        width = (int) bounds.getWidth() / 10;
        tileFuser = new WMSTileFuser(layer, layer.getGridSubsets().values().iterator().next(), bounds, width, height);
        tileFuser.determineSourceResolution();
        assertEquals(0,tileFuser.srcIdx);
       
        // Zoomed too far in
        height = (int) bounds.getWidth() * 10000;
        width = (int) bounds.getWidth() * 10000;
        tileFuser = new WMSTileFuser(layer, layer.getGridSubsets().values().iterator().next(), bounds, width, height);
        tileFuser.determineSourceResolution();
        assertEquals(10,tileFuser.srcIdx);
    }
View Full Code Here

   
    public void testTileFuserSubset() throws Exception {
        TileLayer layer = createWMSLayer();
       
        // request fits inside -30.0,15.0,45.0,30
        BoundingBox bounds = new BoundingBox(-25.0,17.0,40.0,22);
       
        // One in between
        int width = (int) bounds.getWidth() * 10;
        int height= (int) bounds.getHeight() * 10;
        WMSTileFuser tileFuser = new WMSTileFuser(layer, layer.getGridSubsets().values().iterator().next(), bounds, width, height);
        tileFuser.determineSourceResolution();
        tileFuser.determineCanvasLayout();
       
        assertTrue(tileFuser.srcBounds.contains(bounds));
View Full Code Here

   
    public void testTileFuserSuperset() throws Exception {
        TileLayer layer = createWMSLayer();
       
        // request larger than -30.0,15.0,45.0,30
        BoundingBox bounds = new BoundingBox(-35.0,14.0,55.0,39);
       
        // One in between
        int width = (int) bounds.getWidth() * 25;
        int height= (int) bounds.getHeight() * 25;
        WMSTileFuser tileFuser = new WMSTileFuser(layer, layer.getGridSubsets().values().iterator().next(), bounds, width, height);
        tileFuser.determineSourceResolution();
        tileFuser.determineCanvasLayout();
    }
View Full Code Here

        List<String> formatList = new LinkedList<String>();
        formatList.add("image/png");
       
        Hashtable<String,GridSubset> grids = new Hashtable<String,GridSubset>();

        GridSubset grid = GridSubsetFactory.createGridSubSet(gridSetBroker.WORLD_EPSG4326, new BoundingBox(-30.0,15.0,45.0,30), 0,10);
       
        grids.put(grid.getName(), grid);
        int[] metaWidthHeight = {3,3};
       
        WMSLayer layer = new WMSLayer("test:layer", urls, "aStyle", "test:layer", formatList, grids, null, metaWidthHeight, "vendorparam=true", false);
View Full Code Here

        try {
            cacheInfo = persister.load(reader);
        } finally {
            stream.close();
        }
        layerBounds = new BoundingBox(-10, -10, 100, 50);
        builder = new GridSetBuilder();
        gridset = builder.buildGridset("TestLayer", cacheInfo, layerBounds);
        assertNotNull(gridset);
    }
View Full Code Here

        assertNotNull(gridset);
    }

    public void testBounds() {
        assertTrue(gridset.isTopLeftAligned());
        BoundingBox bounds = gridset.getBounds();
        TileOrigin tileOrigin = cacheInfo.getTileCacheInfo().getTileOrigin();
        assertEquals(tileOrigin.getX(), bounds.getMinX());
        assertEquals(tileOrigin.getY(), bounds.getMaxY());
        assertTrue(bounds.contains(layerBounds));
    }
View Full Code Here

    private long[][] fullCoverage;

    public void setUp() {
        RasterMaskTestUtils.debugToDisk = debugToDisk;
        layer = TestUtils.createWMSLayer("image/png", new GridSetBroker(false, false), 3, 3,
                new BoundingBox(-180, -90, 180, 90));
        gridsetId = layer.getGridSubsets().keySet().iterator().next();
        fullCoverage = layer.getGridSubset(gridsetId).getCoverages();
    }
View Full Code Here

    private String gridsetId;

    public void setUp() {
        RasterMaskTestUtils.debugToDisk = debugToDisk;
        layer = TestUtils.createWMSLayer("image/png", new GridSetBroker(false, false), 3, 3,
                new BoundingBox(-180, -90, 180, 90));
        gridsetId = layer.getGridSubsets().keySet().iterator().next();
    }
View Full Code Here

TOP

Related Classes of org.geowebcache.grid.BoundingBox

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.