public String[] getGridNames() { List<String> ret = new ArrayList<String>(gridCoverageLevels.size()); final int zoomStart = getZoomStart(); final int zoomStop = getZoomStop(); for (int i = zoomStart; i <= zoomStop; i++) { ret.add(gridSet.getGrid(i).getName()); } return ret.toArray(new String[ret.size()]); }
@Override public double getScaleDenominator(int level) { if(level<0) return Double.POSITIVE_INFINITY; if(level>=gridset.getNumLevels()) return 0; return gridset.getGrid(level).getScaleDenominator(); }
public long getGridIndex(String gridId) { final int zoomStart = getZoomStart(); final int zoomStop = getZoomStop(); for (int index = zoomStart; index <= zoomStop; index++) { if (gridSet.getGrid(index).getName().equals(gridId)) { return index; } } return -1L; }
public long[][] expandToMetaFactors(final long[][] coverages, final int[] metaFactors) { long[][] ret = ServletUtils.arrayDeepCopy(coverages); for (long[] cov : ret) { final int z = (int) cov[4]; final Grid grid = this.gridSet.getGrid(z); final long numTilesWide = grid.getNumTilesWide(); final long numTilesHigh = grid.getNumTilesHigh(); cov[0] = cov[0] - (cov[0] % metaFactors[0]); cov[1] = cov[1] - (cov[1] % metaFactors[1]); cov[2] = cov[2] - (cov[2] % metaFactors[0]) + (metaFactors[0] - 1); if (cov[2] > numTilesWide) { cov[2] = numTilesWide; } cov[3] = cov[3] - (cov[3] % metaFactors[1]) + (metaFactors[1] - 1); if (cov[3] > numTilesHigh) { cov[3] = numTilesHigh; } } return ret; }
int zoomStart = getZoomStart(); for (int i = zoomStart; i <= zoomStop; i++) { Grid grid = gridSet.getGrid(i); long[] coverage = getCoverage(i);
Grid mockGrid(int level, double denom, GridSet mockGridset) { Grid grid = createMock(Grid.class); expect(mockGridset.getGrid(level)).andStubReturn(grid); expect(grid.getScaleDenominator()).andStubReturn(denom); return grid; }
Grid grid = gridSubset.getGridSet().getGrid(zoomStop); double width = grid.getResolution() * gridSubset.getTileWidth(); double height = grid.getResolution() * gridSubset.getTileHeight();
public BoundingBox boundsFromIndex(long[] tileIndex) { final int tileZ = (int) tileIndex[2]; Grid grid = getGrid(tileZ); final long tileX = tileIndex[0]; final long tileY; if (yBaseToggle) { tileY = tileIndex[1] - grid.getNumTilesHigh(); } else { tileY = tileIndex[1]; } double width = grid.getResolution() * getTileWidth(); double height = grid.getResolution() * getTileHeight(); final double[] tileOrigin = tileOrigin(); BoundingBox tileBounds = new BoundingBox( tileOrigin[0] + width * tileX, tileOrigin[1] + height * (tileY), tileOrigin[0] + width * (tileX + 1), tileOrigin[1] + height * (tileY + 1)); return tileBounds; }