Class FeatureUtil
java.lang.Object
com.vividsolutions.jump.feature.FeatureUtil
Useful utility functions for working with Features.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCompares two Features for order based on their feature ID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareAllNonSpatialAttributesNull(Feature feature) Returns whether all attributes are null (other than the Geometry attribute, which is not checked)static voidcopyAttributes(Feature a, Feature b) Although Feature implements Cloneable, this method is useful when the two Features are implemented with different classes.static intnextID()Increments and returns the feature-ID counterstatic FeaturetoFeature(org.locationtech.jts.geom.Geometry g, FeatureSchema schema) Creates a new Feature from the given Geometry, with nominal values for the attributes.static List<org.locationtech.jts.geom.Geometry> toGeometries(Collection<Feature> features) Returns the n Geometries extracted from the given n Features
-
Constructor Details
-
FeatureUtil
public FeatureUtil()
-
-
Method Details
-
toFeature
Creates a new Feature from the given Geometry, with nominal values for the attributes. The schema must have a attribute of type AttributeType.GEOMETRY.- Parameters:
g- the Geometry to convertschema- metadata for the Feature to create- Returns:
- a new Feature containing the Geometry and default values for the attributes
-
toGeometries
Returns the n Geometries extracted from the given n Features -
nextID
public static int nextID()Increments and returns the feature-ID counter- See Also:
-
copyAttributes
-
areAllNonSpatialAttributesNull
Returns whether all attributes are null (other than the Geometry attribute, which is not checked)
-