public class GPF extends Object
The facade for the Graph Processing Framework.
The Graph Processing Framework makes extensive use of Java Advanced Imaging (JAI).
Therefore, configuring the JAI TileCache
and
TileScheduler
will also affect the overall performance of
the Graph Processing Framework.
This class may be overridden in order to alter product creation behaviour of the static
createProduct
methods of the GPF instance.
The current instance can be set by setDefaultInstance(GPF)
.
Modifier and Type | Field and Description |
---|---|
static String |
BEEP_AFTER_PROCESSING_PROPERTY |
static String |
DISABLE_TILE_CACHE_PROPERTY |
static RenderingHints.Key |
KEY_TILE_SIZE
Key for GPF tile size
RenderingHints . |
static Map<String,Object> |
NO_PARAMS
An unmodifiable empty
Map . |
static Map<String,Product> |
NO_SOURCES
An unmodifiable empty
Map . |
static String |
SOURCE_PRODUCT_FIELD_NAME |
static String |
TARGET_PRODUCT_FIELD_NAME |
static String |
TILE_COMPUTATION_OBSERVER_PROPERTY |
static String |
USE_FILE_TILE_CACHE_PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
GPF()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Operator |
createOperator(String operatorName,
Map<String,Object> parameters,
Map<String,Product> sourceProducts,
RenderingHints renderingHints)
Creates an operator instance by using the given operator (alias) name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Map<String,Product> sourceProducts)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Map<String,Product> sourceProducts,
RenderingHints renderingHints)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Product... sourceProducts)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Product sourceProduct)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Product[] sourceProducts,
RenderingHints renderingHints)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
Product sourceProduct,
RenderingHints renderingHints)
Creates a product by using the operator specified by the given name.
|
static Product |
createProduct(String operatorName,
Map<String,Object> parameters,
RenderingHints renderingHints)
Creates a product by using the operator specified by the given name.
|
Product |
createProductNS(String operatorName,
Map<String,Object> parameters,
Map<String,Product> sourceProducts,
RenderingHints renderingHints)
Creates a product by using the operator specified by the given name.
|
static GPF |
getDefaultInstance()
Gets the default GPF instance.
|
OperatorSpiRegistry |
getOperatorSpiRegistry()
Gets the registry for operator SPIs.
|
ProductManager |
getProductManager()
Gets the context product manager which can be used to exchange product instances across operators
or allow (reading) operators to check if a given product is already opened.
|
static void |
setDefaultInstance(GPF defaultInstance)
Sets the default GPF instance.
|
void |
setOperatorSpiRegistry(OperatorSpiRegistry spiRegistry)
Sets the registry for operator SPIs.
|
void |
setProductManager(ProductManager productManager)
Sets the context product manager which can be used to exchange product instances across operators
or allow (reading) operators to check if a given product is already opened.
|
static void |
writeProduct(Product product,
File file,
String formatName,
boolean clearCacheAfterRowWrite,
boolean incremental,
ProgressMonitor pm)
Writes a product with the specified format to the given file.
|
static void |
writeProduct(Product product,
File file,
String formatName,
boolean incremental,
ProgressMonitor pm)
Writes a product with the specified format to the given file.
|
public static final String DISABLE_TILE_CACHE_PROPERTY
public static final String USE_FILE_TILE_CACHE_PROPERTY
public static final String TILE_COMPUTATION_OBSERVER_PROPERTY
public static final String BEEP_AFTER_PROCESSING_PROPERTY
public static final String SOURCE_PRODUCT_FIELD_NAME
public static final String TARGET_PRODUCT_FIELD_NAME
public static final RenderingHints.Key KEY_TILE_SIZE
RenderingHints
.
The value for this key must be an instance of Dimension
with
both width and height positive.
public static final Map<String,Object> NO_PARAMS
Map
.
Can be used for convenience as a parameter for createProduct()
if no
parameters are needed for the operator.
public static final Map<String,Product> NO_SOURCES
Map
.
Can be used for convenience as a parameter for createProduct(String, Map, Map)
if no
source products are needed for the operator.
createProduct(String, Map, Map)
public static Product createProduct(String operatorName, Map<String,Object> parameters) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, RenderingHints renderingHints) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.renderingHints
- the rendering hints may be null
.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Product sourceProduct) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProduct
- a source product.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Product sourceProduct, RenderingHints renderingHints) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProduct
- the source product.renderingHints
- the rendering hints may be null
.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Product... sourceProducts) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the source products.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Product[] sourceProducts, RenderingHints renderingHints) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the source products.renderingHints
- the rendering hints may be null
.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the map of named source products.OperatorException
- if the product could not be created.public static Product createProduct(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints) throws OperatorException
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the map of named source products.renderingHints
- the rendering hints, may be null
.OperatorException
- if the product could not be created.public Product createProductNS(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints)
createProduct()
.
By concatenating multiple calls it is possible to set up a processing graph.
All static createProduct
methods delegate to this non-static (= NS) version.
It can be overriden by clients in order to alter product creation behaviour of the static
createProduct
methods of the current GPF instance.
operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the map of named source products.renderingHints
- the rendering hints, may be null
.OperatorException
- if the product could not be created.public Operator createOperator(String operatorName, Map<String,Object> parameters, Map<String,Product> sourceProducts, RenderingHints renderingHints)
operatorName
- the name of the operator to use.parameters
- the named parameters needed by the operator.sourceProducts
- the map of named source products.renderingHints
- the rendering hints, may be null
.OperatorException
- if the product could not be created.public OperatorSpiRegistry getOperatorSpiRegistry()
public void setOperatorSpiRegistry(OperatorSpiRegistry spiRegistry)
spiRegistry
- the registry for operator SPIs.public static GPF getDefaultInstance()
public static void setDefaultInstance(GPF defaultInstance)
defaultInstance
- the GPF default instance.public static void writeProduct(Product product, File file, String formatName, boolean incremental, ProgressMonitor pm)
product
- the productfile
- the product fileformatName
- the name of a supported product format, e.g. "HDF5". If null
, the default format
"BEAM-DIMAP" will be usedincremental
- switch the product writer in incremental mode or not.pm
- a monitor to inform the user about progresspublic static void writeProduct(Product product, File file, String formatName, boolean clearCacheAfterRowWrite, boolean incremental, ProgressMonitor pm)
product
- the productfile
- the product fileformatName
- the name of a supported product format, e.g. "HDF5". If null
, the default format
"BEAM-DIMAP" will be usedclearCacheAfterRowWrite
- if true, the internal tile cache is cleared after a tile row has been written.incremental
- switch the product writer in incremental mode or not.pm
- a monitor to inform the user about progresspublic ProductManager getProductManager()
public void setProductManager(ProductManager productManager)
productManager
- The new context product manager.Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.