result.clear(); short[] tileArray = this.fetchTileArray(tileMatrix, row, col); if (tileArray != null) { result.putTileArray(row, col, tileArray); } else { return false;
int i1 = (int) WWMath.clamp(iMax, coliMin, coliMax) % tileWidth; short[] tileArray = tileBlock.getTileArray(row, col);
matrixMinLon <= lon && lon <= matrixMaxLon) { short i0j0 = tileBlock.readTexel(row0, col0, i0 % tileWidth, j0 % tileHeight); short i1j0 = tileBlock.readTexel(row0, col1, i1 % tileWidth, j0 % tileHeight); short i0j1 = tileBlock.readTexel(row1, col0, i0 % tileWidth, j1 % tileHeight); short i1j1 = tileBlock.readTexel(row1, col1, i1 % tileWidth, j1 % tileHeight);
result.clear(); result.rows.put(row, 0); result.cols.put(col, 0); result.putTileArray(row, col, tileArray); } else { return false;
@Override protected void doGetHeightLimits(Sector sector, float[] result) { if (!this.tileMatrixSet.sector.intersects(sector)) { return; // no coverage in the specified sector } double targetPixelSpan = sector.deltaLatitude() / GET_HEIGHT_LIMIT_SAMPLES; int targetIdx = this.tileMatrixSet.indexOfMatrixNearest(targetPixelSpan); TileBlock tileBlock = new TileBlock(); for (int idx = targetIdx; idx >= 0; idx--) { this.setEnableRetrieval(idx == targetIdx || idx == 0); // enable retrieval of the target matrix and the first matrix TileMatrix tileMatrix = this.tileMatrixSet.matrix(idx); if (this.fetchTileBlock(sector, tileMatrix, tileBlock)) { this.scanHeightLimits(sector, tileBlock, result); return; } } }
@Override protected void doGetHeightGrid(Sector gridSector, int gridWidth, int gridHeight, float[] result) { if (!this.tileMatrixSet.sector.intersects(gridSector)) { return; // no coverage in the specified sector } double targetPixelSpan = gridSector.deltaLatitude() / gridHeight; int targetIdx = this.tileMatrixSet.indexOfMatrixNearest(targetPixelSpan); TileBlock tileBlock = new TileBlock(); for (int idx = targetIdx; idx >= 0; idx--) { this.setEnableRetrieval(idx == targetIdx || idx == 0); // enable retrieval of the target matrix and the first matrix TileMatrix tileMatrix = this.tileMatrixSet.matrix(idx); if (this.fetchTileBlock(gridSector, gridWidth, gridHeight, tileMatrix, tileBlock)) { this.readHeightGrid(gridSector, gridWidth, gridHeight, tileBlock, result); return; } } }
public short readTexel(int row, int column, int i, int j) { short[] array = this.getTileArray(row, column); int pos = i + j * this.tileMatrix.tileWidth; return array[pos]; } }