Package org.esa.snap.core.datamodel
Class VectorDataNode
- java.lang.Object
-
- com.bc.ceres.core.ExtensibleObject
-
- org.esa.snap.core.datamodel.ProductNode
-
- org.esa.snap.core.datamodel.VectorDataNode
-
- All Implemented Interfaces:
Extensible
public class VectorDataNode extends ProductNode
A container which allows to store vector data in the BEAM product model.- Since:
- BEAM 4.7
- See Also:
Product.getVectorDataGroup()
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_NAME_DEFAULT_STYLE_CSS
static String
PROPERTY_NAME_FEATURE_COLLECTION
static String
PROPERTY_NAME_STYLE_CSS
-
Fields inherited from class org.esa.snap.core.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
-
-
Constructor Summary
Constructors Constructor Description VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection)
Constructs a new vector data node for the given feature collection.VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection, PlacemarkDescriptor placemarkDescriptor)
Constructs a new vector data node for the given feature collection and placemark descriptor.VectorDataNode(String name, org.opengis.feature.simple.SimpleFeatureType featureType)
Constructs a new vector data node for the given feature type.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.void
fireFeaturesAdded(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyvoid
fireFeaturesChanged(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyvoid
fireFeaturesRemoved(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyString
getDefaultCSS()
Deprecated.since BEAM 4.10, use getDefaultStyleCss()String
getDefaultStyleCss()
org.geotools.geometry.jts.ReferencedEnvelope
getEnvelope()
Gets the bounding box for the features in this feature collection.org.geotools.feature.DefaultFeatureCollection
getFeatureCollection()
org.opengis.feature.simple.SimpleFeatureType
getFeatureType()
PlacemarkDescriptor
getPlacemarkDescriptor()
PlacemarkGroup
getPlacemarkGroup()
long
getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated, raw storage size in bytes of this product node.String
getStyleCss()
boolean
isInternalNode()
Deprecated.Since BEAM 4.10.boolean
isPermanent()
Internal API.void
setDefaultCSS(String defaultCSS)
Deprecated.since BEAM 4.10, use setDefaultStyleCss()void
setDefaultStyleCss(String defaultStyleCss)
void
setModified(boolean modified)
Sets this node's modified flag.void
setOwner(ProductNode owner)
Called when this node is added to or removed from a product.void
setPermanent(boolean permanent)
Internal API.void
setStyleCss(String styleCss)
-
Methods inherited from class org.esa.snap.core.datamodel.ProductNode
dispose, fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, toString, updateExpression
-
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
-
-
-
Field Detail
-
PROPERTY_NAME_FEATURE_COLLECTION
public static final String PROPERTY_NAME_FEATURE_COLLECTION
- See Also:
- Constant Field Values
-
PROPERTY_NAME_STYLE_CSS
public static final String PROPERTY_NAME_STYLE_CSS
- See Also:
- Constant Field Values
-
PROPERTY_NAME_DEFAULT_STYLE_CSS
public static final String PROPERTY_NAME_DEFAULT_STYLE_CSS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VectorDataNode
public VectorDataNode(String name, org.opengis.feature.simple.SimpleFeatureType featureType)
Constructs a new vector data node for the given feature type.- Parameters:
name
- The node name.featureType
- The feature type.- Throws:
IllegalArgumentException
- if the given name is not a valid node identifier
-
VectorDataNode
public VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection)
Constructs a new vector data node for the given feature collection.- Parameters:
name
- The node name.featureCollection
- A feature collection. A copy of this collection will be used. This collection instance is not modified.- Throws:
IllegalArgumentException
- if the given name is not a valid node identifier
-
VectorDataNode
public VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection, PlacemarkDescriptor placemarkDescriptor)
Constructs a new vector data node for the given feature collection and placemark descriptor.- Parameters:
name
- The node name.featureCollection
- A feature collection. A copy of this collection will be used. This collection instance is not modified.placemarkDescriptor
- The placemark descriptor- Throws:
IllegalArgumentException
- if the given name is not a valid node identifier
-
-
Method Detail
-
setOwner
public void setOwner(ProductNode owner)
Called when this node is added to or removed from a product. Overridden in order to create placemarks for features that are still without a placemark counterpart.- Overrides:
setOwner
in classProductNode
- Parameters:
owner
- the new owner
-
getPlacemarkDescriptor
public PlacemarkDescriptor getPlacemarkDescriptor()
-
getPlacemarkGroup
public PlacemarkGroup getPlacemarkGroup()
-
setModified
public void setModified(boolean modified)
Description copied from class:ProductNode
Sets this node's modified flag.If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.
- Overrides:
setModified
in classProductNode
- Parameters:
modified
- whether or not this node is beeing marked as modified.- See Also:
Product.fireNodeChanged(org.esa.snap.core.datamodel.ProductNode, java.lang.String, java.lang.Object, java.lang.Object)
-
getFeatureType
public org.opengis.feature.simple.SimpleFeatureType getFeatureType()
- Returns:
- The feature type (= feature source schema).
-
getFeatureCollection
public org.geotools.feature.DefaultFeatureCollection getFeatureCollection()
- Returns:
- The feature collection.
-
getEnvelope
public org.geotools.geometry.jts.ReferencedEnvelope getEnvelope()
Gets the bounding box for the features in this feature collection.- Returns:
- the envelope of the geometries contained by this feature collection.
-
getRawStorageSize
public long getRawStorageSize(ProductSubsetDef subsetDef)
Description copied from class:ProductNode
Gets an estimated, raw storage size in bytes of this product node.- Specified by:
getRawStorageSize
in classProductNode
- Parameters:
subsetDef
- if notnull
the subset may limit the size returned- Returns:
- the size in bytes.
-
getDefaultStyleCss
public String getDefaultStyleCss()
-
setDefaultStyleCss
public void setDefaultStyleCss(String defaultStyleCss)
-
getStyleCss
public String getStyleCss()
-
setStyleCss
public void setStyleCss(String styleCss)
-
acceptVisitor
public void acceptVisitor(ProductVisitor visitor)
Description copied from class:ProductNode
Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.- Specified by:
acceptVisitor
in classProductNode
- Parameters:
visitor
- the visitor
-
isPermanent
public boolean isPermanent()
Internal API. Don't use.- Returns:
- If true, prevents this node from being removed.
-
setPermanent
public void setPermanent(boolean permanent)
Internal API. Don't use.- Parameters:
permanent
- If true, prevents this node from being removed.
-
isInternalNode
@Deprecated public boolean isInternalNode()
Deprecated.Since BEAM 4.10. No use.- Returns:
- true if the feature type's name starts with "org.esa.snap."
-
getDefaultCSS
@Deprecated public String getDefaultCSS()
Deprecated.since BEAM 4.10, use getDefaultStyleCss()
-
setDefaultCSS
@Deprecated public void setDefaultCSS(String defaultCSS)
Deprecated.since BEAM 4.10, use setDefaultStyleCss()
-
fireFeaturesAdded
@Deprecated public void fireFeaturesAdded(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyInforms clients which have registered aProductNodeListener
with theProduct
containing thisVectorDataNode
, that one or more OpenGISSimpleFeature
s have been added to the underlyingFeatureCollection
.The method fires a product node property change event, where the
propertyName
isPROPERTY_NAME_FEATURE_COLLECTION
, theoldValue
isnull
, and thenewValue
is the array of features added.- Parameters:
features
- The feature(s) added.
-
fireFeaturesRemoved
@Deprecated public void fireFeaturesRemoved(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyInforms clients which have registered aProductNodeListener
with theProduct
containing thisVectorDataNode
, that one or more OpenGISSimpleFeature
s have been removed from the underlyingFeatureCollection
.The method fires a product node property change event, where the
propertyName
isPROPERTY_NAME_FEATURE_COLLECTION
, theoldValue
is the array of features removed, and thenewValue
isnull
.- Parameters:
features
- The feature(s) removed.
-
fireFeaturesChanged
public void fireFeaturesChanged(org.opengis.feature.simple.SimpleFeature... features)
Deprecated.since 6.0, method is public by accident, should only be used internallyInforms clients which have registered aProductNodeListener
with theProduct
containing thisVectorDataNode
, that one or more OpenGISSimpleFeature
s from from the underlyingFeatureCollection
have been changed.The method fires a product node property change event, where the
propertyName
isPROPERTY_NAME_FEATURE_COLLECTION
, and botholdValue
andnewValue
are the same array of features changed.- Parameters:
features
- The feature(s) changed.
-
-