public class ProductSubsetDef extends Object
ProductSubsetDef
class describes a subset or portion of a remote sensing data product.
Subsets can be spatial or spectral or both. A spatial subset is given through a rectangular region in pixels. The spectral subset as a list of band (or channel) names.
Constructor and Description |
---|
ProductSubsetDef()
Constructs a new and empty subset info.
|
ProductSubsetDef(String subsetName)
Constructs a new and empty subset info.
|
Modifier and Type | Method and Description |
---|---|
void |
addNodeName(String name)
Adds a new product node name to this subset.
|
void |
addNodeNames(String[] names)
Adds the given product node names to this subset.
|
boolean |
containsNodeName(String name)
Checks whether or not a node name is already contained in this subset.
|
String[] |
getNodeNames()
Gets the names of all product nodes contained in this subset.
|
Rectangle |
getRegion()
Gets the spatial subset as a rectangular region.
|
Dimension |
getSceneRasterSize(int maxWidth,
int maxHeight)
Gets the required size for a raster required to hold all pixels for the spatial subset for the given maximum
raster width and height.
|
int |
getSubSamplingX()
Gets the sub-sampling in X-direction (horizontal).
|
int |
getSubSamplingY()
Gets the sub-sampling in Y-direction (vertical).
|
String |
getSubsetName() |
boolean |
getTreatVirtualBandsAsRealBands() |
boolean |
isEntireProductSelected()
Checks whether or not this subset definition select the entire product.
|
boolean |
isIgnoreMetadata()
Gets the ignore metadata information
|
boolean |
isNodeAccepted(String name)
Checks whether or not a node (a band, a tie-point grid or metadata element) with the given name will be part of
the product subset.
|
boolean |
removeNodeName(String name)
Removes a band from the spectral subset.
|
void |
setIgnoreMetadata(boolean ignoreMetadata)
Sets the ignore metadata information
|
void |
setNodeNames(String[] names)
Sets the names of all product nodes contained in this subset.
|
void |
setRegion(int x,
int y,
int w,
int h)
Sets the spatial subset as a rectangular region.
|
void |
setRegion(Rectangle region)
Sets the spatial subset as a rectangular region.
|
void |
setSubSampling(int subSamplingX,
int subSamplingY)
Gets the sub-sampling in X- and Y-direction (vertical and horizontal).
|
void |
setSubsetName(String subsetName) |
void |
setTreatVirtualBandsAsRealBands(boolean flag) |
public ProductSubsetDef()
public ProductSubsetDef(String subsetName)
subsetName
- The name of the subset to be created.public String getSubsetName()
public void setSubsetName(String subsetName)
public void setTreatVirtualBandsAsRealBands(boolean flag)
public boolean getTreatVirtualBandsAsRealBands()
public String[] getNodeNames()
null
means all nodes
are selected.null
if the no node subset is givenpublic void setNodeNames(String[] names)
null
means all nodes are
selected.names
- the band names, can be null
in order to reset the node subsetpublic void addNodeName(String name)
name
- the node's name, must not be empty or null
public void addNodeNames(String[] names)
names
- the nodename's to be addedpublic boolean removeNodeName(String name)
false
.name
- the band's nametrue
for success, false
otherwisepublic boolean containsNodeName(String name)
name
- the node namepublic boolean isNodeAccepted(String name)
name
- the node namepublic Rectangle getRegion()
null
if no spatial region was definedpublic void setRegion(Rectangle region)
region
- the spatial subset as a rectangular region, null
if no spatial region shall be
definedpublic void setRegion(int x, int y, int w, int h)
x
- the X-offset in pixelsy
- the Y-offset in pixelsw
- the width of the subset in pixelsh
- the height of the subset in pixelspublic void setSubSampling(int subSamplingX, int subSamplingY)
subSamplingX
- sub-sampling in X-direction, must always be greater than zerosubSamplingY
- sub-sampling in Y-direction, must always be greater than zeropublic int getSubSamplingX()
public int getSubSamplingY()
public Dimension getSceneRasterSize(int maxWidth, int maxHeight)
maxWidth
- the maximum raster widthmaxHeight
- the maximum raster heightnull
public void setIgnoreMetadata(boolean ignoreMetadata)
ignoreMetadata
- if true
, metadata may be ignored during write or read a product.public boolean isIgnoreMetadata()
public boolean isEntireProductSelected()
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.