WFSTileGrid { public double[] getTileExtent(TileCoord tile) { double tileSizeInNature = TILE_SIZE * resolutions[tile.getZ()]; double x1 = originX + tile.getX() * tileSizeInNature; double y1 = originY - tile.getY() * tileSizeInNature; return new double[] { x1, y1 - tileSizeInNature, x1 + tileSizeInNature, y1 }; } WFSTileGrid(double[] extent, int maxZoom); double[] getOrigin(); double[] getResolutions(); double getTileSize(); int getMaxZoom(); double[] getTileExtent(TileCoord tile); static int getMatrixSize(int z); int getZForResolution(int resolution, int direction); double getResolutionForZ(int z); static final int TILE_SIZE; }
@Test public void testETRSTM35FIN() { WFSTileGrid etrsTM35fin = new WFSTileGrid(new double[] { -548576, 6291456, 1548576, 8388608 }, 15); double[] actuals = etrsTM35fin.getTileExtent(new TileCoord(0, 0, 0)); double[] expecteds = { -548576, 6291456, 1548576, 8388608 }; assertArrayEquals(expecteds, actuals, 0); double[] actuals2 = etrsTM35fin.getTileExtent(new TileCoord(1, 0, 1)); double[] expecteds2 = { -548576, 6291456, -548576 + 4096*256, 8388608 - 4096*256 }; assertArrayEquals(expecteds2, actuals2, 0); double[] actuals3 = etrsTM35fin.getTileExtent(new TileCoord(1, 1, 1)); double[] expecteds3 = { -548576 + 4096*256, 6291456, 1548576, 8388608 - 4096*256 }; assertArrayEquals(expecteds3, actuals3, 0); }