Class FeatureExtender


  • public class FeatureExtender
    extends Object
    Utility to add attributes to existing features.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • FeatureExtender

        public FeatureExtender​(org.opengis.feature.simple.SimpleFeatureType oldFeatureType,
                               String[] fieldArray,
                               Class<?>[] classesArray)
                        throws org.geotools.util.factory.FactoryRegistryException,
                               org.geotools.feature.SchemaException
        Parameters:
        oldFeatureType - the FeatureType of the existing features.
        fieldArray - the list of the names of new fields.
        classesArray - the list of classes of the new fields.
        Throws:
        org.geotools.util.factory.FactoryRegistryException
        org.geotools.feature.SchemaException
    • Method Detail

      • getNewFeatureType

        public org.opengis.feature.simple.SimpleFeatureType getNewFeatureType()
      • extendFeature

        public org.opengis.feature.simple.SimpleFeature extendFeature​(org.opengis.feature.simple.SimpleFeature oldFeature,
                                                                      Object[] additionalAttributes)
        Parameters:
        oldFeature - the feature from which to clone the existing attributes from.
        additionalAttributes - the array of attributes to add.
        Returns:
        the new created feature, as merged from the old feature plus the new attributes.