Class FeatureGeometrySubstitutor
- java.lang.Object
-
- org.hortonmachine.gears.utils.features.FeatureGeometrySubstitutor
-
public class FeatureGeometrySubstitutor extends Object
Utility to clone features by modify only the geometry.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description FeatureGeometrySubstitutor(org.opengis.feature.simple.SimpleFeatureType oldFeatureType)FeatureGeometrySubstitutor(org.opengis.feature.simple.SimpleFeatureType oldFeatureType, Class<?> newGeometryType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opengis.feature.simple.SimpleFeatureTypegetNewFeatureType()org.opengis.feature.simple.SimpleFeaturesubstituteGeometry(org.opengis.feature.simple.SimpleFeature oldFeature, org.locationtech.jts.geom.Geometry newGeometry)org.opengis.feature.simple.SimpleFeaturesubstituteGeometry(org.opengis.feature.simple.SimpleFeature oldFeature, org.locationtech.jts.geom.Geometry newGeometry, String id)
-
-
-
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- theFeatureTypeof the existing features.- Throws:
org.geotools.util.factory.FactoryRegistryExceptionorg.geotools.feature.SchemaExceptionException
-
-
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)
-
-