opts.copyOf( options );
/** * Save a raster to a file. * * @param raster * @param filename * @param options * map with options for the raster writer * @throws IOException */ public static void saveRasterToFile( AbstractRaster raster, File filename, RasterIOOptions options ) throws IOException { RasterIOOptions opts = new RasterIOOptions(); opts.copyOf( options ); if ( !opts.contains( RasterIOOptions.OPT_FORMAT ) ) { String format = FileUtils.getFileExtension( filename ); opts.add( RasterIOOptions.OPT_FORMAT, format ); } RasterWriter writer = getRasterWriter( raster, opts ); if ( writer == null ) { log.error( "couldn't find raster writer for " + filename ); throw new IOException( "couldn't find raster writer" ); } writer.write( raster, filename, options ); }
opts.copyOf( options );
options.copyOf( this.rasterOptions ); options.add( RasterIOOptions.CRS, dstSRS.getAlias() ); options.add( RasterIOOptions.OPT_FORMAT, outputFormat );
try { RasterIOOptions rOptions = new RasterIOOptions(); rOptions.copyOf( options ); if ( config.getOriginLocation() != null ) { rOptions.add( RasterIOOptions.GEO_ORIGIN_LOCATION,
LOG.info( "Creating raster from file: {}", filename ); RasterIOOptions newOpts = RasterIOOptions.forFile( filename ); newOpts.copyOf( options ); AbstractRaster raster = RasterFactory.loadRasterFromFile( filename, newOpts ); ICRS rasterCRS = raster.getCoordinateSystem();
LOG.info( "Creating raster from file: {}", filename ); RasterIOOptions newOpts = RasterIOOptions.forFile( filename ); newOpts.copyOf( options ); AbstractRaster raster = RasterFactory.loadRasterFromFile( filename, newOpts, null ); ICRS rasterCRS = raster.getCoordinateSystem();
height = reader.getRows(); RasterIOOptions opts = new RasterIOOptions(); opts.copyOf( options ); setID( opts );