@Override public boolean canWrite( AbstractRaster raster, RasterIOOptions options ) { // only return true if the raster has one band. return raster != null && raster.getRasterDataInfo() != null && raster.getRasterDataInfo().bands == 1; }
@Override public boolean canWrite( AbstractRaster raster, RasterIOOptions options ) { // only return true if the raster has one band. return raster != null && raster.getRasterDataInfo() != null && raster.getRasterDataInfo().bands == 1; }
/** * @param info * @param files * @param rasters * @param options */ public DiskBasedTileContainer( QTreeInfo info, List<File> files, List<AbstractRaster> rasters, RasterIOOptions options ) { qtree = new QTree<File>( createEnvelope( info.envelope ), info.numberOfObjects ); envelope = info.envelope; AbstractRaster raster = rasters.iterator().next(); rasterDataInfo = raster.getRasterDataInfo(); rasterGeoReference = info.rasterGeoReference; resolutionInfo = raster.getResolutionInfo(); this.options = options; Iterator<File> iter = files.iterator(); for ( AbstractRaster r : rasters ) { File f = iter.next(); qtree.insert( createEnvelope( r.getEnvelope() ), f ); cache.put( f, new SoftReference<AbstractRaster>( r ) ); } initialized = true; }
RasterDataInfo rasterDataInfo = raster.getRasterDataInfo(); DataType dataType = rasterDataInfo.getDataType(); byte[] noData = null;
/** * Create a RasterDataUtility object, where channels are mapped according to the RasterStyle options * * @param raster * @param style */ public RasterDataUtility( AbstractRaster raster, RasterChannelSelection style ) { this( raster.getAsSimpleRaster().getRasterData() ); if ( style != null ) { style.evaluate( raster.getRasterDataInfo().bandInfo ); if ( style.getMode() == ChannelSelectionMode.RGB || style.getMode() == ChannelSelectionMode.GRAY ) { channelMappings = true; indexes = style.evaluate( raster.getRasterDataInfo().bandInfo ); } } }
/** * Read a texture from a file and load it using the raster api. * * @param raster * the raster api raster. * */ public RasterAPITextureTileProvider( AbstractRaster raster ) { fac = new GeometryFactory(); this.raster = raster; BandType[] bandInfo = this.raster.getRasterDataInfo().bandInfo; hasAlpha = bandInfo.length == 4; for ( int i = 0; !hasAlpha && i < bandInfo.length; ++i ) { if ( bandInfo[i] == BandType.ALPHA ) { this.hasAlpha = true; } } // GriddedBlobTileContainer.create( file, options ) this.res = raster.getRasterReference().getResolutionX(); }
int rows = (int) Math.ceil( (double) height / tileHeight ); GridWriter gridWriter = new GridWriter( columns, rows, renv, geoRef, tmpGridFile, raster.getRasterDataInfo() ); FilteredResultWiter resultWriter = new FilteredResultWiter( gridWriter );
/** * Adds a new tile to the container. * * @param raster * new tile */ public void addTile( AbstractRaster raster ) { if ( raster != null ) { if ( this.rdi == null ) { this.rdi = raster.getRasterDataInfo(); } if ( this.resolutionInfo == null ) { this.resolutionInfo = raster.getResolutionInfo(); } index.insert( createEnvelope( raster.getEnvelope() ), raster ); } }
raster.getRasterDataInfo() );
private void handleStyling( RasterStyling styling, AbstractRaster raster ) { BufferedImage img = null; if ( styling.channelSelection != null ) { // Compute channel selection indexes on current raster styling.channelSelection.evaluate( raster.getRasterDataInfo().bandInfo ); } // TODO maybe reorder this a bit if ( styling.shaded != null ) { raster = performHillShading( raster, styling ); } if ( styling.channelSelection != null ) { raster = evaluateChannelSelections( styling.channelSelection, raster ); } if ( styling.contrastEnhancement != null ) { raster = performContrastEnhancement( raster, styling.contrastEnhancement ); } if ( styling.opacity != 1 ) { LOG.trace( "Using opacity: {}", styling.opacity ); graphics.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, (float) styling.opacity ) ); } img = handleFunctions( styling, raster ); LOG.trace( "Rendering raster..." ); if ( img != null ) { render( img, raster.getEnvelope() ); } else { render( raster ); } LOG.trace( "Done rendering raster." ); handleOutline( styling, raster ); }
throw new NullPointerException( "Could not create a range set, because the given raster is null" ); RasterDataInfo rasterDataInfo = raster.getRasterDataInfo(); if ( rasterDataInfo == null ) { LOG.warn( "No raster data information available, so no automated Rangesets will be available." );
RasterDataInfo inf = raster.getRasterDataInfo(); long filesize = ( (long) rows ) * columns * ( tileHeight * tileWidth * inf.dataSize * inf.bands ); this.setTileHeight( rasterReference.getEnvelope( new RasterRect( 0, 0, tileWidth, tileHeight ), null ).getSpan1() );
/** * Adds a new tile to the container. * * @param raster * new tile */ public synchronized void addTile( AbstractRaster raster ) { if ( raster != null ) { if ( this.envelope == null ) { this.envelope = raster.getEnvelope(); } else { this.envelope = this.envelope.merge( raster.getEnvelope() ); } if ( this.rasterReference == null ) { this.rasterReference = raster.getRasterReference(); } else { this.rasterReference = RasterGeoReference.merger( this.rasterReference, raster.getRasterReference() ); } if ( this.rdi == null ) { this.rdi = raster.getRasterDataInfo(); } if ( this.resolutionInfo == null ) { this.resolutionInfo = raster.getResolutionInfo(); } tiles.add( raster ); } }
if ( LOG.isDebugEnabled() ) { LOG.debug( "Adding raster intersection:{}, rasterInfo:{}, rasterref: {} ", new Object[] { subsetEnv, r.getRasterDataInfo(), r.getRasterReference() } );
private TextureTile getTextureTile( double minX, double minY, double maxX, double maxY ) { if ( raster.getRasterDataInfo().getDataType() != DataType.BYTE ) { LOG.warn( "Raster type is not byte, textures can currently only be bytes." ); return null;