Package org.locationtech.jts.jump.tools
Class AttributeMapping
- java.lang.Object
-
- org.locationtech.jts.jump.tools.AttributeMapping
-
public class AttributeMapping extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeMapping.CombinedSchema
-
Constructor Summary
Constructors Modifier Constructor Description protected
AttributeMapping()
AttributeMapping(FeatureSchema aSchema, List aAttributeNames, List aNewAttributeNames, FeatureSchema bSchema, List bAttributeNames, List bNewAttributeNames)
Constructs an AttributeMapping.AttributeMapping(FeatureSchema a, FeatureSchema b)
Constructs an AttributeMapping that will transfer all the attributes from two feature collections A and B.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeMapping.CombinedSchema
createSchema(String geometryName)
Returns a new FeatureSchema with the destination attributes of the mapping and a spatial attribute with the given nameprotected boolean
isDisjoint(Collection a, Collection b)
void
transferAttributes(Feature aFeature, Feature bFeature, Feature cFeature)
Transfers attributes (not the geometry) from two features to a third feature, using the mappings specified in the constructor.
-
-
-
Constructor Detail
-
AttributeMapping
protected AttributeMapping()
-
AttributeMapping
public AttributeMapping(FeatureSchema a, FeatureSchema b)
Constructs an AttributeMapping that will transfer all the attributes from two feature collections A and B. If A and B have attributes with the same name, they will be postfixed with _1 and _2 respectively. Case sensitive. If you only wish to map attributes for one schema, simply pass in a new FeatureSchema for the other schema.- Parameters:
a
- schema for first feature collection from which to transfer attributesb
- schema for second feature collection from which to transfer attributes
-
AttributeMapping
public AttributeMapping(FeatureSchema aSchema, List aAttributeNames, List aNewAttributeNames, FeatureSchema bSchema, List bAttributeNames, List bNewAttributeNames)
Constructs an AttributeMapping.- Parameters:
aSchema
- metadata for feature-collection AaAttributeNames
- non-spatial feature-collection-A attributes to transferaNewAttributeNames
- corresponding names in the feature collection receiving the attributesbSchema
- metadata for feature-collection BbAttributeNames
- non-spatial feature-collection-B attributes to transferbNewAttributeNames
- corresponding names in the feature collection receiving the attributes
-
-
Method Detail
-
createSchema
public AttributeMapping.CombinedSchema createSchema(String geometryName)
Returns a new FeatureSchema with the destination attributes of the mapping and a spatial attribute with the given name- Parameters:
geometryName
- name to assign to the spatial attribute
-
isDisjoint
protected boolean isDisjoint(Collection a, Collection b)
-
transferAttributes
public void transferAttributes(Feature aFeature, Feature bFeature, Feature cFeature)
Transfers attributes (not the geometry) from two features to a third feature, using the mappings specified in the constructor. The third feature's schema must be able to accomodate the attributes being transferred.- Parameters:
aFeature
- a feature from feature-collection AbFeature
- a feature from feature-collection BcFeature
- the feature to transfer the A and B attributes to
-
-