Class FeatureGeometrySubstitutor


  • public class FeatureGeometrySubstitutor
    extends Object
    Utility to clone features by modify only the geometry.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • FeatureGeometrySubstitutor

        public FeatureGeometrySubstitutor​(org.opengis.feature.simple.SimpleFeatureType oldFeatureType)
                                   throws Exception
        Throws:
        Exception
      • FeatureGeometrySubstitutor

        public FeatureGeometrySubstitutor​(org.opengis.feature.simple.SimpleFeatureType oldFeatureType,
                                          Class<?> newGeometryType)
                                   throws Exception
        Parameters:
        oldFeatureType - the FeatureType of the existing features.
        Throws:
        org.geotools.util.factory.FactoryRegistryException
        org.geotools.feature.SchemaException
        Exception
    • Method Detail

      • getNewFeatureType

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

        public org.opengis.feature.simple.SimpleFeature substituteGeometry​(org.opengis.feature.simple.SimpleFeature oldFeature,
                                                                           org.locationtech.jts.geom.Geometry newGeometry)
        Parameters:
        oldFeature - the feature from which to clone the existing attributes from.
        newGeometry - new geometry to insert.
        Returns:
        the new created feature, as merged from the old feature plus the new attributes.
      • substituteGeometry

        public org.opengis.feature.simple.SimpleFeature substituteGeometry​(org.opengis.feature.simple.SimpleFeature oldFeature,
                                                                           org.locationtech.jts.geom.Geometry newGeometry,
                                                                           String id)