Пример #1
0
 public PixelBlock(final int iBand) throws IOException {
   bands = new IRasterBandCollectionProxy(rasterDataset);
   band = bands.item(iBand);
   rawPix = new IRawPixelsProxy(band);
   rasProps = new IRasterPropsProxy(rawPix);
   this.iBand = iBand;
 }
Пример #2
0
  public ESRIRaster(final String path, final String rasterName, final int rows, final int cols)
      throws IOException {

    final IWorkspaceFactory factory = new RasterWorkspaceFactory();
    final IRasterWorkspace2 workspace = new IRasterWorkspace2Proxy(factory.openFromFile(path, 0));
    rasterDataset = new IRasterDataset2Proxy(workspace.openRasterDataset(rasterName));

    m_iRows = rows;
    m_iCols = cols;
    final IGeoDataset geoDataset = new IGeoDatasetProxy(rasterDataset);
    final IRasterBandCollection rasterBands = new IRasterBandCollectionProxy(geoDataset);
    pixelBlock = new PixelBlock[rasterBands.getCount()];
    for (int i = 0; i < pixelBlock.length; i++) {
      pixelBlock[i] = new PixelBlock(i);
    }
    m_dNoData = pixelBlock[0].getNoDataValue();
    m_iDataType = pixelBlock[0].getDataType();
  }