Class FilterUtilities


  • public class FilterUtilities
    extends Object
    Helper class for simple filter constructions.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • FilterUtilities

        public FilterUtilities()
    • Method Detail

      • getBboxFilter

        public static org.opengis.filter.Filter getBboxFilter​(String attribute,
                                                              org.opengis.geometry.BoundingBox bbox)
                                                       throws org.geotools.filter.text.cql2.CQLException
        Create a bounding box filter from a bounding box.
        Parameters:
        attribute - the geometry attribute or null in the case of default "the_geom".
        bbox - the BoundingBox.
        Returns:
        the filter.
        Throws:
        org.geotools.filter.text.cql2.CQLException
      • getBboxFilter

        public static org.opengis.filter.Filter getBboxFilter​(String attribute,
                                                              double west,
                                                              double east,
                                                              double south,
                                                              double north)
                                                       throws org.geotools.filter.text.cql2.CQLException
        Create a bounding box filter from the bounds coordinates.
        Parameters:
        attribute - the geometry attribute or null in the case of default "the_geom".
        west - western bound coordinate.
        east - eastern bound coordinate.
        south - southern bound coordinate.
        north - northern bound coordinate.
        Returns:
        the filter.
        Throws:
        org.geotools.filter.text.cql2.CQLException
      • getCQLFilter

        public static org.opengis.filter.Filter getCQLFilter​(String expression)
                                                      throws org.geotools.filter.text.cql2.CQLException
        Throws:
        org.geotools.filter.text.cql2.CQLException
      • getIntersectsGeometryFilter

        public static org.opengis.filter.Filter getIntersectsGeometryFilter​(String geomName,
                                                                            org.locationtech.jts.geom.Geometry geometry)
                                                                     throws org.geotools.filter.text.cql2.CQLException
        Creates an intersect filter.
        Parameters:
        geomName - the name of the geom field to filter.
        geometry - the geometry to use as filtering geom.
        Returns:
        the filter.
        Throws:
        org.geotools.filter.text.cql2.CQLException