Package org.tailormap.api.geotools
Class TransformationUtil
java.lang.Object
org.tailormap.api.geotools.TransformationUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.api.referencing.operation.MathTransformgetTransformationToApplication(@NotNull Application application, @NotNull org.geotools.api.data.SimpleFeatureSource simpleFeatureSource) Determine whether we need to transform geometries to the application CRS.static org.geotools.api.referencing.operation.MathTransformgetTransformationToDataSource(@NotNull Application application, @NotNull org.geotools.api.data.SimpleFeatureSource simpleFeatureSource) Determine whether we need to transform geometry to data source crs.
-
Method Details
-
getTransformationToApplication
public static org.geotools.api.referencing.operation.MathTransform getTransformationToApplication(@NotNull @NotNull Application application, @NotNull @NotNull org.geotools.api.data.SimpleFeatureSource simpleFeatureSource) throws org.geotools.api.referencing.FactoryException Determine whether we need to transform geometries to the application CRS. Note that this uses the "default geometry" attribute of the feature source, in cases where a feature source has multiple geometry attributes (with possibly different CRSs) or heterogenous CRSs across a single geometry attribute this may not be accurate.- Parameters:
application- the referenced applicationsimpleFeatureSource- the feature source used in the application- Returns:
nullwhen no transform is required and a valid transform otherwise- Throws:
org.geotools.api.referencing.FactoryException- when the CRS cannot be decoded
-
getTransformationToDataSource
public static org.geotools.api.referencing.operation.MathTransform getTransformationToDataSource(@NotNull @NotNull Application application, @NotNull @NotNull org.geotools.api.data.SimpleFeatureSource simpleFeatureSource) throws org.geotools.api.referencing.FactoryException Determine whether we need to transform geometry to data source crs. Note that this uses the "default geometry" attribute of the feature source, in cases where a feature source has multiple geometry attributes (with possibly different CRSs) or heterogenous CRSs across a single geometry attribute this may not be accurate.- Parameters:
application- the referenced applicationsimpleFeatureSource- the feature source used in the application- Returns:
nullwhen no transform is required and a valid transform otherwise- Throws:
org.geotools.api.referencing.FactoryException- when the CRS cannot be decoded
-