congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RasterIOOptions.add
Code IndexAdd Tabnine to your IDE (free)

How to use
add
method
in
org.deegree.coverage.raster.io.RasterIOOptions

Best Java code snippets using org.deegree.coverage.raster.io.RasterIOOptions.add (Showing top 15 results out of 315)

origin: deegree/deegree3

/**
 * Set the default loading policy to one configured in the {@link RasterDataContainerFactory}
 * 
 * @param ref
 * @param format
 *            of the raster to read, e.g. png, jpg, tiff..., may be <code>null</code>
 */
public RasterIOOptions( RasterGeoReference ref, String format ) {
  this( ref );
  if ( format != null && !"".equals( format ) ) {
    add( OPT_FORMAT, format );
  }
}
origin: deegree/deegree3

@Override
public void write( OutputStream out )
            throws IOException {
  RasterIOOptions options = new RasterIOOptions();
  // lets fake GeoTiff until we have a real GeoTiff writer (TODO)
  if ( format.equalsIgnoreCase( "GeoTiff" ) ) {
    options.add( RasterIOOptions.OPT_FORMAT, "tiff" );
  } else {
    options.add( RasterIOOptions.OPT_FORMAT, format );
  }
  RasterFactory.saveRasterToStream( result, out, options );
}
origin: deegree/deegree3

/**
 * An empty constructor, nothing is set. The loading policy is the default value taken from the
 * {@link RasterDataContainerFactory}. Worldfile reading is on.
 */
public RasterIOOptions() {
  add( READ_WLD_FILE, "yes" );
  add( DATA_LOADING_POLICY, RasterDataContainerFactory.getDefaultLoadingPolicy().name() );
}
origin: deegree/deegree3

/**
 * Return a RasterIOOption object with the format set according to the given file with an optional
 * {@link RasterGeoReference}.
 * 
 * @param file
 * @param envelope
 * @return RasterIOOption proper format.
 */
public static RasterIOOptions forFile( File file, RasterGeoReference envelope ) {
  RasterIOOptions result = new RasterIOOptions( envelope );
  String ext = FileUtils.getFileExtension( file );
  result.add( OPT_FORMAT, ext );
  result.add( READ_WLD_FILE, null );
  return result;
}
origin: deegree/deegree3

private RasterIOOptions getOptions( MultiResolutionRasterConfig config, ICRS parentCrs ) {
  RasterIOOptions opts = new RasterIOOptions();
  if ( config.getStorageCRS() != null ) {
    opts.add( "CRS", config.getStorageCRS() );
  } else {
    opts.add( "CRS", parentCrs.getAlias() );
  }
  return opts;
}
origin: deegree/deegree3

/**
 * Return a RasterIOOption object with the format set according to the given file.
 * 
 * @param file
 * @return RasterIOOption proper format.
 */
public static RasterIOOptions forFile( File file ) {
  RasterIOOptions result = new RasterIOOptions();
  String ext = FileUtils.getFileExtension( file );
  result.add( OPT_FORMAT, ext );
  return result;
}
origin: deegree/deegree3

options.add( RasterIOOptions.OPT_FORMAT, inputType );
options.add( RasterIOOptions.CRS, crs );
if ( noDataType != DataType.UNDEFINED ) {
  byte[] noDatas = RasterIOOptions.createNoData( new String[] { noDataValue }, noDataType );
  File cd = new File( cacheDir );
  if ( cd.exists() && cd.isDirectory() ) {
    options.add( RasterIOOptions.RASTER_CACHE_DIR, cacheDir );
  } else {
    LOG.warn( "Using default cache dir: " + RasterCache.DEFAULT_CACHE_DIR
origin: deegree/deegree3

    dir = directory.getParentFile().getName() + "_" + directory.getName();
  opts.add( RasterIOOptions.LOCAL_RASTER_CACHE_DIR, dir );
  opts.add( RasterIOOptions.CREATE_RASTER_MISSING_CACHE_DIR, "yes" );
opts.add( RasterIOOptions.OPT_FORMAT, format );
boolean readSingleBlobTile = false;
if ( format != null && ( "grid".equalsIgnoreCase( format ) || "bin".equalsIgnoreCase( format ) ) ) {
origin: deegree/deegree3

    dir = directory.getParentFile().getName() + "_" + directory.getName();
  opts.add( RasterIOOptions.LOCAL_RASTER_CACHE_DIR, dir );
  opts.add( RasterIOOptions.CREATE_RASTER_MISSING_CACHE_DIR, "yes" );
opts.add( RasterIOOptions.OPT_FORMAT, format );
boolean readSingleBlobTile = false;
if ( format != null && ( "grid".equalsIgnoreCase( format ) || "bin".equalsIgnoreCase( format ) ) ) {
origin: deegree/deegree3

/**
 * 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 );
}
origin: deegree/deegree3

final RasterIOOptions options = new RasterIOOptions();
options.copyOf( this.rasterOptions );
options.add( RasterIOOptions.CRS, dstSRS.getAlias() );
options.add( RasterIOOptions.OPT_FORMAT, outputFormat );
origin: deegree/deegree3

rOptions.copyOf( options );
if ( config.getOriginLocation() != null ) {
  rOptions.add( RasterIOOptions.GEO_ORIGIN_LOCATION,
         config.getOriginLocation().toString().toUpperCase() );
  rOptions.add( RasterIOOptions.IMAGE_INDEX, imageIndex.toString() );
  boolean recursive = directory.isRecursive();
  if ( crs != null ) {
    rOptions.add( RasterIOOptions.CRS, crs.getAlias() );
    return null;
  rOptions.add( RasterIOOptions.OPT_FORMAT, file.substring( file.lastIndexOf( '.' ) + 1 ) );
  AbstractRaster raster = loadRasterFromFile( loc, rOptions, metadata );
  if ( raster != null ) {
origin: deegree/deegree3

private static void transformRaster( String[] args, String srcCRS, String dstCRS, InterpolationType type,
                   OriginLocation location ) {
  try {
    MemoryTileContainer tileContainer = new MemoryTileContainer();
    for ( int i = 0; i < args.length - 1; i++ ) {
      if ( args[i] != null ) {
        File f = new File( args[i] );
        RasterIOOptions options = RasterIOOptions.forFile( f );
        options.add( RasterIOOptions.GEO_ORIGIN_LOCATION, location.name() );
        tileContainer.addTile( RasterFactory.loadRasterFromFile( f, options ) );
      }
    }
    AbstractRaster srcRaster = new TiledRaster( tileContainer, null );
    RasterTransformer transf = new RasterTransformer( dstCRS );
    srcRaster.setCoordinateSystem( CRSManager.getCRSRef( srcCRS ) );
    AbstractRaster result = transf.transform( srcRaster, type );
    RasterFactory.saveRasterToFile( result, new File( args[args.length - 1] ) );
  } catch ( Exception ex ) {
    System.err.println( "Couldn't transform raster file: " );
    ex.printStackTrace();
    System.exit( 2 );
  }
}
origin: deegree/deegree3

add( DATA_LOADING_POLICY, otherOptions.getLoadingPolicy().name() );
add( READ_WLD_FILE, otherOptions.readWorldFile() + "" );
add( GEO_ORIGIN_LOCATION, otherOptions.getRasterOriginLocation().name() );
add( CRS, otherOptions.getCRS().getAlias() );
origin: deegree/deegree3

opts.add( IMAGE_INDEX, "" + i );
opts.add( OPT_FORMAT, "tiff" );
opts.add( CRS, crs.getAlias() );
org.deegree.coverage.raster.ioRasterIOOptionsadd

Popular methods of RasterIOOptions

  • <init>
    Set the default loading policy to one configured in the RasterDataContainerFactory
  • copyOf
    Copies the the values from the given options.
  • forFile
    Return a RasterIOOption object with the format set according to the given file with an optional Rast
  • get
  • getCRS
  • getRasterOriginLocation
  • setNoData
    no data value. The byte[] can be created from an array of Strings by using the RasterIOOptions#creat
  • contains
  • createNoData
    Create a noData array from the given strings. Each string will be interpreted as the given type.
  • getLoadingPolicy
  • getNoDataValue
    Returns the no data value. A no data value should be added to the RasterIOOptions by using RasterIOO
  • getRasterGeoReference
  • getNoDataValue,
  • getRasterGeoReference,
  • hasRasterGeoReference,
  • readWorldFile,
  • setRasterGeoReference

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ImageIO (javax.imageio)
  • Notification (javax.management)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now