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));
GridSet gridSet = baseGridSet(name, srs, tileWidth, tileHeight); return createGridSet( name, srs,
@Override protected GridSet getGoodInfo(String id, int rand) { GridSet gridset = GridSetFactory.createGridSet( id, SRS.getSRS(4326), new BoundingBox(0, 0, 1, 1), true, 3, 1.0, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, 256, 256, false); gridset.setDescription(Integer.toString(rand)); return gridset; }
GridSetFactory.createGridSet( unprojectedName, SRS.getEPSG4326(), GridSetFactory.createGridSet( mercatorName, googleMapsCompatibleSRS, GridSetFactory.createGridSet( "GlobalCRS84Pixel", SRS.getEPSG4326(), GridSetFactory.createGridSet( "GlobalCRS84Scale", SRS.getEPSG4326(), GridSetFactory.createGridSet( "GoogleCRS84Quad", SRS.getEPSG4326(),
GridSetFactory.createGridSet( gridSetName, srs,
if (resolutions != null) { gridSet = GridSetFactory.createGridSet( srs.toString(), srs, GridSetFactory.createGridSet( srs.toString(), srs,
GridSetFactory.createGridSet( gridsetName, srs,
GridSetFactory.createGridSet( "test", SRS.getEPSG4326(), GridSetFactory.createGridSet( "test", SRS.getEPSG4326(),
@Test public void testAddGridset() throws GeoWebCacheException, IOException { String gridsetName = "EPSG:3005"; GridSet epsg3005 = GridSetFactory.createGridSet( gridsetName, SRS.getSRS(gridsetName), new BoundingBox(35043.6538, 440006.8768, 1885895.3117, 1735643.8497), false, null, new double[] {25000000, 1250000, 500000, 250000}, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, null, 256, 256, false); tileLayerDispatcher.addGridSet(epsg3005); assertTrue(gridSetBroker.getNames().contains(gridsetName)); assertEquals(gridSetBroker.get(gridsetName), epsg3005); }
@Test public void testAddGridset() throws GeoWebCacheException, IOException { String gridsetName = "EPSG:3005"; GridSet epsg3005 = GridSetFactory.createGridSet( gridsetName, SRS.getSRS(gridsetName), new BoundingBox(35043.6538, 440006.8768, 1885895.3117, 1735643.8497), false, null, new double[] {25000000, 1250000, 500000, 250000}, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, null, 256, 256, false); gridSetBroker.addGridSet(epsg3005); assertTrue(gridSetBroker.getNames().contains(gridsetName)); assertEquals(gridSetBroker.get(gridsetName), epsg3005); }
@Override public void setUp() throws Exception { mimeType = MimeType.createFromFormat("image/png"); parameters = null; gridSet = new GridSetBroker(true, false).getWorldEpsg3857(); BoundingBox extent = new BoundingBox(0, 0, 100, 100); boolean alignTopLeft = false; int levels = 12; Double metersPerUnit = Double.valueOf(1); double pixelSize = 1; int tileWidth = 100; int tileHeight = 100; boolean yCoordinateFirst = false; gridSet = GridSetFactory.createGridSet( "TestGridSet", SRS.getSRS(100000), extent, alignTopLeft, levels, metersPerUnit, pixelSize, tileWidth, tileHeight, yCoordinateFirst); gridSubSet = GridSubsetFactory.createGridSubSet(gridSet); gridCoverages = gridSubSet.getCoverages(); }
public void testTopLeftNaive() throws Exception { // This mimics the Spearfish layer BoundingBox bbox = new BoundingBox(-180.0, -90.0, 180.0, 90.0); BoundingBox gridBase = new BoundingBox(-180.0, -90.0, 180.0, 90.0); GridSet gridSet = GridSetFactory.createGridSet( "bogus", SRS.getSRS(4326), gridBase, true, 30, null, 0.00028, 256, 256, false); GridSubset gridSubset = GridSubsetFactory.createGridSubSet(gridSet, bbox, 0, 20); // Check the actual max bounds long[] solution = {0, 0, 0}; long[] closest = gridSubset.closestIndex(new BoundingBox(-180.0, -90.0, 0.0, 90.0)); assertTrue(Arrays.equals(solution, closest)); long[] solution2 = {1, 0, 0}; closest = gridSubset.closestIndex(new BoundingBox(0.0, -90.0, 180.0, 90.0)); assertTrue(Arrays.equals(solution2, closest)); long[] t1 = {0, 0, 1}; // 90x90 degrees BoundingBox test1 = gridSubset.boundsFromIndex(t1); assertTrue(Math.abs(test1.getMinX() + 180.0) < 0.01); assertTrue(Math.abs(test1.getMinY() + 90.0) < 0.01); assertTrue(Math.abs(test1.getMaxY()) < 0.01); }
GridSetFactory.createGridSet( name, srs,
GridSetFactory.createGridSet( "bogus", SRS.getSRS(26713),
public void testBoundingBoxEPSG3785() throws Exception { BoundingBox extent = new BoundingBox(-20037508.34, -20037508.34, 20037508.34, 20037508.34); GridSet gridSet = GridSetFactory.createGridSet( "test", SRS.getEPSG3857(), extent, false, 6, null, 0.00028, 256, 256, false); Grid grid0 = gridSet.getGridLevels()[0]; assertEquals((20037508.34 * 2) / 256, grid0.getResolution()); assertEquals(1L, grid0.getNumTilesWide()); assertEquals(1L, grid0.getNumTilesHigh()); Grid grid3 = gridSet.getGridLevels()[3]; assertEquals((long) Math.pow(2, 3), grid3.getNumTilesWide()); assertEquals((long) Math.pow(2, 3), grid3.getNumTilesHigh()); }
GridSetFactory.createGridSet( "bogus", SRS.getSRS(26713),
boolean yCoordinateFirst = false; GridSet gridSet = GridSetFactory.createGridSet( "EPSG:3395", SRS.getSRS("EPSG:3395"),
boolean yCoordinateFirst = false; GridSet gridSet = GridSetFactory.createGridSet( "EPSG:3395", SRS.getSRS("EPSG:3395"),
public void testResolutionsArrayEPSG3785() throws Exception { BoundingBox extent = new BoundingBox(-20037508.34, -20037508.34, 20037508.34, 20037508.34); double[] resolutions = { (20037508.34 * 2) / 256, (20037508.34 * 2) / 512, (20037508.34 * 2) / 1024, (20037508.34 * 2) / 2048 }; GridSet gridSet = GridSetFactory.createGridSet( "test", SRS.getEPSG3857(), extent, false, resolutions, null, null, 0.00028, null, 256, 256, false); Grid grid0 = gridSet.getGridLevels()[0]; assertEquals((20037508.34 * 2) / 256, grid0.getResolution()); assertEquals(1L, grid0.getNumTilesWide()); assertEquals(1L, grid0.getNumTilesHigh()); Grid grid3 = gridSet.getGridLevels()[3]; assertEquals((long) Math.pow(2, 3), grid3.getNumTilesWide()); assertEquals((long) Math.pow(2, 3), grid3.getNumTilesHigh()); }
GridSetFactory.createGridSet( name, srs, GridSetFactory.createGridSet( name, srs,