public class FeatureSchemaTools extends ToolToMakeYourLifeEasier
| Constructor and Description |
|---|
FeatureSchemaTools() |
| Modifier and Type | Method and Description |
|---|---|
static Feature |
copyFeature(Feature feature,
FeatureSchema newSchema)
copy the input feature to a new Schema whereby the new
Feature Schema must be an extended or shortened one
|
static FeatureSchema |
copyFeatureSchema(FeatureSchema oldSchema)
Deprecated.
|
static AttributeInfo |
getAttributesInfoFor(FeatureSchema fs,
int attrIndex)
Extracts information on the attribute at the given index from the feature schema.
|
static AttributeInfo |
getAttributesInfoFor(FeatureSchema fs,
java.lang.String attrName)
Extracts information on the attribute with the given name from the feature schema.
|
static AttributeInfo[] |
getAttributesWithTypes(FeatureSchema fs,
AttributeType[] allowedTypes)
Extracts information of all attributes with one of the given types from the given FeatureSchema
|
static java.util.List |
getFieldsFromLayerWithoutGeometry(Layer lyr) |
static java.util.List |
getFieldsFromLayerWithoutGeometryAndString(Layer lyr) |
static boolean |
isAttributeTypeAllowed(AttributeType at,
AttributeType[] allowedTypes)
Checks if the given attribute type is contained in the given array of allowed attribute types.
|
public static AttributeInfo[] getAttributesWithTypes(FeatureSchema fs, AttributeType[] allowedTypes)
fs - FeatureSchema to get information fromallowedTypes - array with AttributeTypes, that specify which attribute to get information aboutpublic static AttributeInfo getAttributesInfoFor(FeatureSchema fs, int attrIndex)
fs - FeatureSchema to get information fromattrIndex - index of the attribute in the given featureSchema to get information aboutpublic static AttributeInfo getAttributesInfoFor(FeatureSchema fs, java.lang.String attrName)
fs - FeatureSchema to get information fromattrName - name of the attribute in the given featureSchema to get information aboutpublic static boolean isAttributeTypeAllowed(AttributeType at, AttributeType[] allowedTypes)
at - attribute type to be checkedallowedTypes - array of allowed attribute typesat is contained in allowedTypes, else falsepublic static FeatureSchema copyFeatureSchema(FeatureSchema oldSchema)
oldSchema - public static Feature copyFeature(Feature feature, FeatureSchema newSchema)
feature - the feature to copy fromnewSchema - the schema to copy topublic static java.util.List getFieldsFromLayerWithoutGeometryAndString(Layer lyr)
public static java.util.List getFieldsFromLayerWithoutGeometry(Layer lyr)