Class FeatureSchema
- java.lang.Object
-
- org.locationtech.jts.jump.feature.FeatureSchema
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
AttributeMapping.CombinedSchema
public class FeatureSchema extends Object implements Cloneable, Serializable
Metadata for a FeatureCollection: attribute names and types.- See Also:
FeatureCollection
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FeatureSchema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(String attributeName, AttributeType attributeType)
Adds an attribute with the given case-sensitive name.Object
clone()
boolean
equals(Object other)
Returns whether the two FeatureSchemas have the same attribute names with the same types and in the same order.boolean
equals(Object other, boolean orderMatters)
Returns whether the two FeatureSchemas have the same attribute names with the same types and (optionally) in the same order.int
getAttributeCount()
Returns the total number of spatial and non-spatial attributes in this FeatureSchema.int
getAttributeIndex(String attributeName)
Returns the zero-based index of the attribute with the given name (case-sensitive)String
getAttributeName(int attributeIndex)
Returns the (case-sensitive) name of the attribute at the given zero-based index.AttributeType
getAttributeType(int attributeIndex)
Returns whether the attribute at the given zero-based index is a string, integer, double, etc.AttributeType
getAttributeType(String attributeName)
Returns whether the attribute with the given name (case-sensitive) is a string, integer, double, etc.CoordinateSystem
getCoordinateSystem()
int
getGeometryIndex()
Returns the attribute index of the Geometry, or -1 if there is no Geometry attributeboolean
hasAttribute(String attributeName)
Returns whether this FeatureSchema has an attribute with this nameFeatureSchema
setCoordinateSystem(CoordinateSystem coordinateSystem)
Sets the CoordinateSystem associated with this FeatureSchema, but does not perform any reprojection.
-
-
-
Method Detail
-
getAttributeIndex
public int getAttributeIndex(String attributeName)
Returns the zero-based index of the attribute with the given name (case-sensitive)- Throws:
IllegalArgumentException
- if attributeName is unrecognized
-
hasAttribute
public boolean hasAttribute(String attributeName)
Returns whether this FeatureSchema has an attribute with this name- Parameters:
attributeName
- the name to look up- Returns:
- whether this FeatureSchema has an attribute with this name
-
getGeometryIndex
public int getGeometryIndex()
Returns the attribute index of the Geometry, or -1 if there is no Geometry attribute
-
getAttributeName
public String getAttributeName(int attributeIndex)
Returns the (case-sensitive) name of the attribute at the given zero-based index.
-
getAttributeType
public AttributeType getAttributeType(int attributeIndex)
Returns whether the attribute at the given zero-based index is a string, integer, double, etc.
-
getAttributeType
public AttributeType getAttributeType(String attributeName)
Returns whether the attribute with the given name (case-sensitive) is a string, integer, double, etc.
-
getAttributeCount
public int getAttributeCount()
Returns the total number of spatial and non-spatial attributes in this FeatureSchema. There are 0 or 1 spatial attributes and 0 or more non-spatial attributes.
-
addAttribute
public void addAttribute(String attributeName, AttributeType attributeType)
Adds an attribute with the given case-sensitive name.- Throws:
AssertionFailedException
- if a second Geometry is being added
-
equals
public boolean equals(Object other)
Returns whether the two FeatureSchemas have the same attribute names with the same types and in the same order.
-
equals
public boolean equals(Object other, boolean orderMatters)
Returns whether the two FeatureSchemas have the same attribute names with the same types and (optionally) in the same order.
-
setCoordinateSystem
public FeatureSchema setCoordinateSystem(CoordinateSystem coordinateSystem)
Sets the CoordinateSystem associated with this FeatureSchema, but does not perform any reprojection.- Returns:
- this FeatureSchema
-
getCoordinateSystem
public CoordinateSystem getCoordinateSystem()
- See Also:
setCoordinateSystem(CoordinateSystem)
-
-