|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.coverage.raster.utils.RasterFactory
public class RasterFactory
This class reads and writes raster files. The actual raster loading and writing is handled by RasterReader
and RasterWriter
implementations.
TODO use the new, not yet implemented, configuration framework to allow customization of the IO classes
Constructor Summary | |
---|---|
RasterFactory()
|
Method Summary | |
---|---|
static SimpleRaster |
createEmptyRaster(RasterDataInfo rdi,
Envelope worldEnvelope,
RasterGeoReference rasterGeoReference)
Creates a new Raster data object from the given world envelope, a raster reference and the data info object (holding information about type, size etc...). |
static SimpleRaster |
createEmptyRaster(RasterDataInfo rdi,
Envelope worldEnvelope,
RasterGeoReference rasterGeoReference,
RasterReader reader,
boolean addToCache,
RasterIOOptions options)
Creates a new Raster data object from the given world envelope, a raster reference and the data info object (holding information about type, size etc...). |
static AbstractRaster |
createRasterFromImage(RenderedImage image,
Envelope envelope,
RasterGeoReference.OriginLocation originLocation)
Creates a simple raster from a given BufferedImage and sets the geo reference to the given envelope. |
static AbstractRaster |
createRasterFromImage(RenderedImage image,
Envelope envelope,
RasterGeoReference.OriginLocation originLocation,
RasterIOOptions options)
Creates a simple raster from a given BufferedImage and sets the geo reference to the given envelope. |
static Set<String> |
getAllSupportedWritingFormats()
Find all RasterIOLoaders and retrieve all the (image) formats they support on writing. |
static BufferedImage |
imageFromRaster(AbstractRaster raster)
Creates a buffered image from a given AbstractRaster , note creating an image might result in a incorrect
view of the raster. |
static AbstractRaster |
loadRasterFromFile(File filename)
Load a raster from a file. |
static AbstractRaster |
loadRasterFromFile(File filename,
RasterIOOptions options)
Load a raster from a file. |
static AbstractRaster |
loadRasterFromStream(InputStream in,
RasterIOOptions options)
Load a raster from a stream. |
static ByteBufferRasterData |
rasterDataFromImage(BufferedImage img)
Creates a buffered image from the given raster data by calling the rasterDataFromImage(RenderedImage, RasterIOOptions, ByteBuffer) method without any options |
static ByteBufferRasterData |
rasterDataFromImage(RenderedImage img,
RasterIOOptions options)
Creates Raster data from the given RenderedImage image. |
static ByteBufferRasterData |
rasterDataFromImage(RenderedImage img,
RasterIOOptions options,
ByteBuffer byteBuffer)
Creates Raster data from the given buffered image. |
static BufferedImage |
rasterDataToImage(RasterData sourceRaster)
Convert RasterData into a BufferedImage |
static ByteBuffer |
rasterToByteBuffer(Raster imageRaster,
int x,
int y,
int width,
int height,
DataType type,
ByteBuffer byteBuffer)
Create a byte buffer from the given raster, the Bytebuffer will be filled row order, that is, pixel(0,0);(0,1) |
static void |
saveRasterToFile(AbstractRaster raster,
File filename)
Save a raster to a file. |
static void |
saveRasterToFile(AbstractRaster raster,
File filename,
RasterIOOptions options)
Save a raster to a file. |
static void |
saveRasterToStream(AbstractRaster raster,
OutputStream out,
RasterIOOptions options)
Save a raster to a stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RasterFactory()
Method Detail |
---|
public static AbstractRaster loadRasterFromFile(File filename) throws IOException
filename
- the filename of the raster
IOException
public static AbstractRaster loadRasterFromFile(File filename, RasterIOOptions options) throws IOException
filename
- the filename of the rasteroptions
-
IOException
public static AbstractRaster loadRasterFromStream(InputStream in, RasterIOOptions options) throws IOException
in
- options
- map with options for the raster writer
IOException
public static void saveRasterToFile(AbstractRaster raster, File filename) throws IOException
raster
- filename
-
IOException
public static void saveRasterToFile(AbstractRaster raster, File filename, RasterIOOptions options) throws IOException
raster
- filename
- options
- map with options for the raster writer
IOException
public static void saveRasterToStream(AbstractRaster raster, OutputStream out, RasterIOOptions options) throws IOException
raster
- out
- options
- map with options for the raster writer
IOException
public static Set<String> getAllSupportedWritingFormats()
public static AbstractRaster createRasterFromImage(RenderedImage image, Envelope envelope, RasterGeoReference.OriginLocation originLocation)
BufferedImage
and sets the geo reference to the given envelope.
image
- to get as a rasterenvelope
- of the rasteroriginLocation
- the mapped location of the world coordinate origin on the upper left raster coordinate.
public static AbstractRaster createRasterFromImage(RenderedImage image, Envelope envelope, RasterGeoReference.OriginLocation originLocation, RasterIOOptions options)
BufferedImage
and sets the geo reference to the given envelope.
image
- to get as a rasterenvelope
- of the rasteroriginLocation
- the mapped location of the world coordinate origin on the upper left raster coordinate.options
- with information about the image and resulting raster.
public static BufferedImage imageFromRaster(AbstractRaster raster)
AbstractRaster
, note creating an image might result in a incorrect
view of the raster.
raster
- to create the image from
BufferedImage
created from the given raster.public static BufferedImage rasterDataToImage(RasterData sourceRaster)
sourceRaster
- the source RasterData
public static ByteBufferRasterData rasterDataFromImage(RenderedImage img, RasterIOOptions options)
img
- options
- which can hold information about the image read, may be null
null
if the given img is null
public static ByteBufferRasterData rasterDataFromImage(RenderedImage img, RasterIOOptions options, ByteBuffer byteBuffer)
img
- options
- which can hold information about the image read, may be null
byteBuffer
- to fill
null
if the given img is null
public static ByteBuffer rasterToByteBuffer(Raster imageRaster, int x, int y, int width, int height, DataType type, ByteBuffer byteBuffer)
imageRaster
- x
- y
- width
- height
- type
- byteBuffer
-
public static ByteBufferRasterData rasterDataFromImage(BufferedImage img)
rasterDataFromImage(RenderedImage, RasterIOOptions, ByteBuffer)
method without any options.
*
img
-
null
if the given img is null
public static SimpleRaster createEmptyRaster(RasterDataInfo rdi, Envelope worldEnvelope, RasterGeoReference rasterGeoReference)
null
null will be
returned.
rdi
- worldEnvelope
- describing the raster data.rasterGeoReference
- the raster geo reference defining the resolution of the raster.
public static SimpleRaster createEmptyRaster(RasterDataInfo rdi, Envelope worldEnvelope, RasterGeoReference rasterGeoReference, RasterReader reader, boolean addToCache, RasterIOOptions options)
null
null will be
returned.
rdi
- worldEnvelope
- describing the raster data.rasterGeoReference
- the raster geo reference defining the resolution of the raster.reader
- to lazily instantiate the data from, may be null
, if the raster should not be backed by
any data.addToCache
- true if the raster data of the given raster should be added to the cache.options
- containing information about the raster caching.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |