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
A container which allows to store vector data in the BEAM product model.
- Since:
- BEAM 4.7
- See Also:
-
Field Summary
FieldsFields inherited from class org.esa.snap.core.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME -
Constructor Summary
ConstructorsConstructorDescriptionVectorDataNode(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
Modifier and TypeMethodDescriptionvoidacceptVisitor(ProductVisitor visitor) Accepts the given visitor.voidfireFeaturesAdded(org.opengis.feature.simple.SimpleFeature... features) Deprecated.since 6.0, method is public by accident, should only be used internallyvoidfireFeaturesChanged(org.opengis.feature.simple.SimpleFeature... features) Deprecated.since 6.0, method is public by accident, should only be used internallyvoidfireFeaturesRemoved(org.opengis.feature.simple.SimpleFeature... features) Deprecated.since 6.0, method is public by accident, should only be used internallyDeprecated.since BEAM 4.10, use getDefaultStyleCss()org.geotools.geometry.jts.ReferencedEnvelopeGets the bounding box for the features in this feature collection.org.geotools.feature.DefaultFeatureCollectionorg.opengis.feature.simple.SimpleFeatureTypelonggetRawStorageSize(ProductSubsetDef subsetDef) Gets an estimated, raw storage size in bytes of this product node.booleanDeprecated.Since BEAM 4.10.booleanInternal API.voidsetDefaultCSS(String defaultCSS) Deprecated.since BEAM 4.10, use setDefaultStyleCss()voidsetDefaultStyleCss(String defaultStyleCss) voidsetModified(boolean modified) Sets this node's modified flag.voidsetOwner(ProductNode owner) Called when this node is added to or removed from a product.voidsetPermanent(boolean permanent) Internal API.voidsetStyleCss(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, setNodeName, toString, updateExpressionMethods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Field Details
-
PROPERTY_NAME_FEATURE_COLLECTION
- See Also:
-
PROPERTY_NAME_STYLE_CSS
- See Also:
-
PROPERTY_NAME_DEFAULT_STYLE_CSS
- See Also:
-
-
Constructor Details
-
VectorDataNode
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 Details
-
setOwner
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:
setOwnerin classProductNode- Parameters:
owner- the new owner
-
getPlacemarkDescriptor
-
getPlacemarkGroup
-
setModified
public void setModified(boolean modified) Description copied from class:ProductNodeSets 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:
setModifiedin classProductNode- Parameters:
modified- whether or not this node is beeing marked as modified.- See Also:
-
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
Description copied from class:ProductNodeGets an estimated, raw storage size in bytes of this product node.- Specified by:
getRawStorageSizein classProductNode- Parameters:
subsetDef- if notnullthe subset may limit the size returned- Returns:
- the size in bytes.
-
getDefaultStyleCss
-
setDefaultStyleCss
-
getStyleCss
-
setStyleCss
-
acceptVisitor
Description copied from class:ProductNodeAccepts 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:
acceptVisitorin 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.Since BEAM 4.10. No use.- Returns:
- true if the feature type's name starts with "org.esa.snap."
-
getDefaultCSS
Deprecated.since BEAM 4.10, use getDefaultStyleCss() -
setDefaultCSS
Deprecated.since BEAM 4.10, use setDefaultStyleCss() -
fireFeaturesAdded
Deprecated.since 6.0, method is public by accident, should only be used internallyInforms clients which have registered aProductNodeListenerwith theProductcontaining thisVectorDataNode, that one or more OpenGISSimpleFeatures have been added to the underlyingFeatureCollection.The method fires a product node property change event, where the
propertyNameisPROPERTY_NAME_FEATURE_COLLECTION, theoldValueisnull, and thenewValueis the array of features added.- Parameters:
features- The feature(s) added.
-
fireFeaturesRemoved
Deprecated.since 6.0, method is public by accident, should only be used internallyInforms clients which have registered aProductNodeListenerwith theProductcontaining thisVectorDataNode, that one or more OpenGISSimpleFeatures have been removed from the underlyingFeatureCollection.The method fires a product node property change event, where the
propertyNameisPROPERTY_NAME_FEATURE_COLLECTION, theoldValueis the array of features removed, and thenewValueisnull.- 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 aProductNodeListenerwith theProductcontaining thisVectorDataNode, that one or more OpenGISSimpleFeatures from from the underlyingFeatureCollectionhave been changed.The method fires a product node property change event, where the
propertyNameisPROPERTY_NAME_FEATURE_COLLECTION, and botholdValueandnewValueare the same array of features changed.- Parameters:
features- The feature(s) changed.
-