public int GetRasterCount() { return getRasterCount(); }
public int GetRasterCount() { return getRasterCount(); }
private byte[][] readBands( Dataset dataset ) { int numBands = dataset.getRasterCount(); byte[][] bands = new byte[numBands][width * height]; for ( int i = 0; i < numBands; i++ ) { Band band = dataset.GetRasterBand( i + 1 ); byte[] bandBytes = bands[i]; band.ReadRaster( 0, 0, width, height, width, height, GDT_Byte, bandBytes, 0, 0 ); } return bands; }
/** * Fetches metadata from the given GDAL dataset. */ GridGeometry(final Dataset ds) throws IOException { if (ds == null) { throw new IOException("DataSet is closed."); } xSize = ds.getRasterXSize(); ySize = ds.getRasterYSize(); numBands = ds.getRasterCount(); final double[] gt = ds.GetGeoTransform(); gridToCRS = new AffineTransform(gt[1], gt[4], gt[2], gt[5], gt[0], gt[3]); crs = CRS.create(ds.GetProjection()); }
private Dataset createMemDataset( Envelope nativeBbox, String nativeProjection, byte[][] composedRegion ) { Driver vrtDriver = gdal.GetDriverByName( "MEM" ); Dataset dataset = vrtDriver.Create( "/tmp/whatever", width, height, composedRegion.length ); dataset.SetProjection( nativeProjection ); dataset.SetGeoTransform( getGeoTransform( nativeBbox, width, height ) ); for ( int i = 1; i <= dataset.getRasterCount(); i++ ) { Band band = dataset.GetRasterBand( i ); if ( band.WriteRaster( 0, 0, width, height, width, height, GDT_Byte, composedRegion[i - 1] ) != CE_None ) { throw new RuntimeException( "Error writing composed raster." ); } } return dataset; }
private Dataset reproject( Dataset src, String dstCrsWkt ) { Driver vrtDriver = gdal.GetDriverByName( "MEM" ); Dataset region = vrtDriver.Create( "/tmp/whatever", width, height, src.getRasterCount() ); region.SetProjection( dstCrsWkt ); region.SetGeoTransform( getGeoTransform( bbox, width, height ) ); gdal.ReprojectImage( src, region ); return region; }
synchronized (dataset) { final int bandCount = dataset.getRasterCount(); final ByteBuffer[] bandData = new ByteBuffer[bandCount]; final int[] banks = new int[bandCount];
product.setFileLocation(inputFile.toFile()); int bandCount = gdalDataset.getRasterCount();
final int numBands = dataset.getRasterCount(); setNumBands(numBands); if (numBands <= 0)
final int numBands = dataset.getRasterCount(); setNumBands(numBands); if (numBands <= 0)