Class SimpleFeatureUtil
- java.lang.Object
-
- eu.europa.ec.eurostat.jgiscotools.feature.SimpleFeatureUtil
-
public class SimpleFeatureUtil extends Object
Conversion functions from GeoTools SimpleFeatures from/to Feature- Author:
- julien Gaffuri
-
-
Constructor Summary
Constructors Constructor Description SimpleFeatureUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.geotools.data.simple.SimpleFeatureCollection
get(Collection<? extends Feature> fs, org.opengis.feature.simple.SimpleFeatureType ft)
Convert features into GeoTools SimpleFeaturestatic ArrayList<Feature>
get(org.geotools.data.simple.SimpleFeatureCollection sfs, String attId)
Convert GeoTools SimpleFeatures into featuresstatic <T extends Feature>
HashMap<String,Class<?>>getAttributeGeomTypes(Collection<T> fs)
static <T extends Feature>
HashMap<String,Class<?>>getAttributeGeomTypes(Collection<T> fs, String geomColName)
Get attribute and geometry types for a list of features.static <T extends org.locationtech.jts.geom.Geometry>
Collection<Feature>getFeaturesFromGeometries(Collection<T> geoms)
Create features from geometriesstatic <T extends Feature>
org.opengis.feature.simple.SimpleFeatureTypegetFeatureType(Collection<T> fs, String geomColName, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Get GeoTools FeatureType from features.static <T extends Feature>
org.opengis.feature.simple.SimpleFeatureTypegetFeatureType(T f, String geomColName, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Get GeoTools FeatureType from features.
-
-
-
Method Detail
-
get
public static ArrayList<Feature> get(org.geotools.data.simple.SimpleFeatureCollection sfs, String attId)
Convert GeoTools SimpleFeatures into features- Parameters:
sfs
-attId
-- Returns:
-
get
public static org.geotools.data.simple.SimpleFeatureCollection get(Collection<? extends Feature> fs, org.opengis.feature.simple.SimpleFeatureType ft)
Convert features into GeoTools SimpleFeature- Parameters:
fs
-ft
-- Returns:
-
getFeatureType
public static <T extends Feature> org.opengis.feature.simple.SimpleFeatureType getFeatureType(Collection<T> fs, String geomColName, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Get GeoTools FeatureType from features. NB: All features are assumed to have the same attributes names/types and geometry types.- Type Parameters:
T
-- Parameters:
fs
-geomColName
-crs
-- Returns:
-
getFeatureType
public static <T extends Feature> org.opengis.feature.simple.SimpleFeatureType getFeatureType(T f, String geomColName, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Get GeoTools FeatureType from features.- Type Parameters:
T
-- Parameters:
f
-geomColName
-crs
-- Returns:
-
getAttributeGeomTypes
public static <T extends Feature> HashMap<String,Class<?>> getAttributeGeomTypes(Collection<T> fs, String geomColName)
Get attribute and geometry types for a list of features.- Type Parameters:
T
-- Parameters:
fs
-- Returns:
-
getAttributeGeomTypes
public static <T extends Feature> HashMap<String,Class<?>> getAttributeGeomTypes(Collection<T> fs)
- Type Parameters:
T
-- Parameters:
fs
-- Returns:
-
getFeaturesFromGeometries
public static <T extends org.locationtech.jts.geom.Geometry> Collection<Feature> getFeaturesFromGeometries(Collection<T> geoms)
Create features from geometries- Type Parameters:
T
-- Parameters:
geoms
-- Returns:
-
-