add( GEO_ORIGIN_LOCATION, otherOptions.getRasterOriginLocation().name() );
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 ); } }