Search in sources :

Example 1 with DefaultEngineeringCRS

use of org.geotools.referencing.crs.DefaultEngineeringCRS in project GeoGig by boundlessgeo.

the class BoundsFilteringDiffConsumer method createProjectedFilter.

private ReferencedEnvelope createProjectedFilter(ObjectId metadataId) {
    final ReferencedEnvelope boundsFilter = this.boundsFilter;
    RevFeatureType featureType = ftypeSource.getFeatureType(metadataId);
    CoordinateReferenceSystem nativeCrs = featureType.type().getCoordinateReferenceSystem();
    if (null == nativeCrs || nativeCrs instanceof DefaultEngineeringCRS) {
        return boundsFilter;
    }
    ReferencedEnvelope transformedFilter;
    try {
        transformedFilter = boundsFilter.transform(nativeCrs, true);
    } catch (TransformException | FactoryException e) {
        throw Throwables.propagate(e);
    }
    return transformedFilter;
}
Also used : ReferencedEnvelope(org.geotools.geometry.jts.ReferencedEnvelope) FactoryException(org.opengis.referencing.FactoryException) TransformException(org.opengis.referencing.operation.TransformException) CoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem) RevFeatureType(org.locationtech.geogig.api.RevFeatureType) DefaultEngineeringCRS(org.geotools.referencing.crs.DefaultEngineeringCRS)

Aggregations

ReferencedEnvelope (org.geotools.geometry.jts.ReferencedEnvelope)1 DefaultEngineeringCRS (org.geotools.referencing.crs.DefaultEngineeringCRS)1 RevFeatureType (org.locationtech.geogig.api.RevFeatureType)1 FactoryException (org.opengis.referencing.FactoryException)1 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)1 TransformException (org.opengis.referencing.operation.TransformException)1