コード例 #1
0
  private void addTileOrDescendands(MeshTile tile, List<MeshTile> tileList) {
    if (!tile.getSector().intersects(this.levelSet.getSector())) return;

    if (tile.getLevelNumber() == this.visibleLevel) {
      tileList.add(tile);
      return;
    }

    if (this.levelSet.isFinalLevel(tile.getLevelNumber())) {
      return;
    }

    MeshTile[] subTiles = tile.subdivide(this.levelSet.getLevel(tile.getLevelNumber() + 1));
    for (MeshTile subTile : subTiles) {
      addTileOrDescendands(subTile, tileList);
    }
  }
コード例 #2
0
  private BufferWrapperRaster readTileRaster(MeshTile tile) {
    File file = new File(this.dataDescriptor.getFileStoreLocation(), tile.getPath());
    if (!file.exists()) return null;

    DataSource source = new BasicDataSource(file);
    source.setValue(AVKey.SECTOR, tile.getSector());

    BILRasterReader reader = new BILRasterReader();
    DataRaster[] rasters;
    try {
      rasters = reader.read(source);
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }

    return (BufferWrapperRaster) rasters[0];
  }