public Dataset Create(final String name, final int xsize, final int ysize, final int bands, final int eType, final String[] options) { return Create(name, xsize, ysize, bands, eType, StringArrayToVector(options)); }
public Dataset CreateCopy(final String name, final Dataset src, final int strict, final String[] options) { return CreateCopy(name, src, strict, StringArrayToVector(options), null); }
@Override public String name() { return gdalDrv != null ? gdalDrv.getShortName() : "GDAL"; }
writeDataset = driver.Create(fileName, destinationWidth, destinationHeight, nBands, dataType, myOptions); writeDataset = driver.CreateCopy(outputFile.getPath(), tempDataset, 0, myOptions); } finally { try{ driver.delete(); }catch (Throwable e) { if(LOGGER.isLoggable(Level.FINEST))
logger.log(Level.FINE,"Using the GDAL driver '" + this.gdalDriver.getLongName() + "' ("+this.gdalDriver.getShortName()+") to save the product."); this.gdalDataset = this.gdalDriver.Create(outputFile.toString(), imageWidth, imageHeight, bandCount, this.gdalDataType); if (this.gdalDataset == null) { throw new NullPointerException("Failed creating the file to export the product for driver '" + this.gdalDriver.getLongName() + "'.");
public Dataset extractRegionAsDataset( Envelope region, int pixelsX, int pixelsY, boolean withAlpha ) throws IOException { byte[][] buffer = extractRegionAsByteArray( region, pixelsX, pixelsY, withAlpha ); Driver vrtDriver = gdal.GetDriverByName( "MEM" ); Dataset ds = vrtDriver.Create( "/tmp/whatever", pixelsX, pixelsY, buffer.length ); ds.SetProjection( dataset.GetProjection() ); int i = 1; for ( byte[] bytes : buffer ) { Band band = ds.GetRasterBand( i ); if ( band.WriteRaster( 0, 0, pixelsX, pixelsY, pixelsX, pixelsY, GDT_Byte, bytes ) != CE_None ) { throw new RuntimeException( "Error writing raster band." ); } i++; } return ds; }
driver = dataset.GetDriver(); if (driver != null) { setDriverDescription(driver.GetDescription()); setDriverName(driver.getShortName()); try { driver.delete(); } catch (Throwable e) { if (LOGGER.isLoggable(Level.FINEST))
public static Driver IdentifyDriver(final String utf8_path, final java.util.Vector papszSiblings) { final long cPtr = gdalJNI.IdentifyDriver__SWIG_0(utf8_path, papszSiblings); return cPtr == 0 ? null : new Driver(cPtr, false); }
public Dataset CreateCopy(final String name, final Dataset src, final Vector options) { return CreateCopy(name, src, 1, options, null); }
writeDataset = driver.Create(fileName, destinationWidth, destinationHeight, nBands, dataType, myOptions); writeDataset = driver.CreateCopy(outputFile.getPath(), tempDataset, 0, myOptions); } finally { try{ driver.delete(); }catch (Throwable e) { if(LOGGER.isLoggable(Level.FINEST))
driver = dataset.GetDriver(); if (driver != null) { setDriverDescription(driver.GetDescription()); setDriverName(driver.getShortName()); try { driver.delete(); } catch (Throwable e) { if (LOGGER.isLoggable(Level.FINEST))
public static Driver IdentifyDriver(String utf8_path, java.util.Vector papszSiblings) { long cPtr = gdalJNI.IdentifyDriver__SWIG_0(utf8_path, papszSiblings); return (cPtr == 0) ? null : new Driver(cPtr, false); }
public Dataset CreateCopy(String name, Dataset src, Vector options) { return CreateCopy(name, src, 1, options, null); }
public Dataset Create(final String name, final int xsize, final int ysize, final int bands, final String[] options) { return Create(name, xsize, ysize, bands, gdalconstConstants.GDT_Byte, StringArrayToVector(options)); }
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; }
public Dataset CreateCopy(final String name, final Dataset src, final String[] options) { return CreateCopy(name, src, 1, StringArrayToVector(options), null); }
@Override public List<String> aliases() { return gdalDrv != null ? Arrays.asList(gdalDrv.getShortName()) : (List) Collections.emptyList(); }
public static Driver IdentifyDriver(String utf8_path) { long cPtr = gdalJNI.IdentifyDriver__SWIG_1(utf8_path); return (cPtr == 0) ? null : new Driver(cPtr, false); }
public Dataset Create(String name, int xsize, int ysize, int bands, int eType, String[] options) { return Create(name, xsize, ysize, bands, eType, StringArrayToVector(options)); }