private AbstractRaster loadFromReader( JAIRasterDataReader reader, RasterIOOptions options ) {
width = reader.getColumns();
height = reader.getRows();
setID( options );
reader.close();
OriginLocation definedRasterOrigLoc = options.getRasterOriginLocation();
rasterReference = new RasterGeoReference( definedRasterOrigLoc, 1, -1, 0.5, height - 0.5 );
if ( options.hasRasterGeoReference() ) {
rasterReference = options.getRasterGeoReference();
} else {
if ( options.readWorldFile() ) {
try {
if ( file != null ) {
rasterReference = WorldFileAccess.readWorldFile( file, options );
}
} catch ( IOException e ) {
}
}
}
Envelope envelope = rasterReference.getEnvelope( width, height, null );
RasterDataInfo rdi = reader.getRasterDataInfo();
return RasterFactory.createEmptyRaster( rdi, envelope, rasterReference, this, true, options );
}