Package org.esa.snap.core.util
Class FeatureUtils
- java.lang.Object
- 
- org.esa.snap.core.util.FeatureUtils
 
- 
 public class FeatureUtils extends Object Unstable API. Use at own risk.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceFeatureUtils.FeatureCrsProvider
 - 
Constructor SummaryConstructors Constructor Description FeatureUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static org.geotools.feature.DefaultFeatureCollectionclipCollection(org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> sourceCollection, org.opengis.referencing.crs.CoordinateReferenceSystem defaultSourceCrs, org.locationtech.jts.geom.Geometry clipGeometry, org.opengis.referencing.crs.CoordinateReferenceSystem clipCrs, String targetID, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs, ProgressMonitor pm)Clips the givensourceCollectionagainst theclipGeometryand reprojects the clipped features to the targetCrs.static org.geotools.feature.DefaultFeatureCollectionclipFeatureCollectionToProductBounds(org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection, Product product, FeatureUtils.FeatureCrsProvider crsProvider, ProgressMonitor pm)static org.geotools.feature.DefaultFeatureCollectioncreateFeatureCollection(URL url, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs, org.locationtech.jts.geom.Geometry clipGeometry)static StringcreateFeatureId(int base)static StringcreateFeatureTypeName(String defaultGeometry)static org.locationtech.jts.geom.GeometrycreateGeoBoundaryPolygon(Product product)static org.geotools.data.FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>getFeatureSource(URL url)static org.geotools.geometry.jts.GeometryCoordinateSequenceTransformergetTransform(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCrs, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs)static org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>loadFeatureCollectionFromShapefile(File shapefile)static org.geotools.feature.DefaultFeatureCollectionloadShapefileForProduct(File file, Product product, FeatureUtils.FeatureCrsProvider crsProvider, ProgressMonitor pm)
 
- 
- 
- 
Method Detail- 
createFeatureCollectionpublic static org.geotools.feature.DefaultFeatureCollection createFeatureCollection(URL url, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs, org.locationtech.jts.geom.Geometry clipGeometry) throws IOException - Throws:
- IOException
 
 - 
getFeatureSourcepublic static org.geotools.data.FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(URL url) throws IOException - Throws:
- IOException
 
 - 
loadShapefileForProductpublic static org.geotools.feature.DefaultFeatureCollection loadShapefileForProduct(File file, Product product, FeatureUtils.FeatureCrsProvider crsProvider, ProgressMonitor pm) throws IOException - Throws:
- IOException
 
 - 
clipFeatureCollectionToProductBoundspublic static org.geotools.feature.DefaultFeatureCollection clipFeatureCollectionToProductBounds(org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection, Product product, FeatureUtils.FeatureCrsProvider crsProvider, ProgressMonitor pm)
 - 
loadFeatureCollectionFromShapefilepublic static org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> loadFeatureCollectionFromShapefile(File shapefile) throws IOException - Throws:
- IOException
 
 - 
createFeatureIdpublic static String createFeatureId(int base) 
 - 
clipCollectionpublic static org.geotools.feature.DefaultFeatureCollection clipCollection(org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> sourceCollection, org.opengis.referencing.crs.CoordinateReferenceSystem defaultSourceCrs, org.locationtech.jts.geom.Geometry clipGeometry, org.opengis.referencing.crs.CoordinateReferenceSystem clipCrs, String targetID, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs, ProgressMonitor pm)Clips the givensourceCollectionagainst theclipGeometryand reprojects the clipped features to the targetCrs.- Parameters:
- sourceCollection- the feature collection to be clipped and reprojected. If it does not have an associated CRS, the one specified by- defaultSourceCrsis used.
- defaultSourceCrs- if- sourceCollectiondoes not have an associated CRS, this one is used.
- clipGeometry- the geometry used for clipping
- clipCrs- the CRS of the- clipGeometry
- targetID- the ID of the resulting- FeatureCollection. If- nullthe ID of the sourceCollection is used.
- targetCrs- the CRS the- FeatureCollectionis reprojected to. If- nullno reprojection is applied.
- Returns:
- the clipped and possibly reprojected FeatureCollection
- Throws:
- IllegalStateException- if the- sourceCollectionhas no associated CRS and- defaultSourceCrsis- null
 
 - 
getTransformpublic static org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer getTransform(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCrs, org.opengis.referencing.crs.CoordinateReferenceSystem targetCrs)
 - 
createGeoBoundaryPolygonpublic static org.locationtech.jts.geom.Geometry createGeoBoundaryPolygon(Product product) 
 
- 
 
-