001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2006-2012 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.filter;
033    
034    import org.opengis.feature.type.Name;
035    import org.opengis.filter.expression.Expression;
036    import org.opengis.filter.expression.PropertyName;
037    import org.opengis.filter.spatial.BBOX;
038    import org.opengis.filter.spatial.Beyond;
039    import org.opengis.filter.spatial.Contains;
040    import org.opengis.filter.spatial.Crosses;
041    import org.opengis.filter.spatial.DWithin;
042    import org.opengis.filter.spatial.Disjoint;
043    import org.opengis.filter.spatial.Equals;
044    import org.opengis.filter.spatial.Intersects;
045    import org.opengis.filter.spatial.Overlaps;
046    import org.opengis.filter.spatial.Touches;
047    import org.opengis.filter.spatial.Within;
048    import org.opengis.geometry.BoundingBox;
049    
050    
051    /**
052     * Allows creation of additional Filter constructs.
053     * <p>
054     * Why do we need this? Because not all implementations are going
055     * to be using geoapi Geometry. This allows the creation of complient
056     * filters with SFSQL Geometry constructs. Consider this a bridge to
057     * existing projects allowing GeoAPI to be used.
058     * </p>
059     * @version <A HREF="http://www.opengis.org/docs/02-059.pdf">Implementation specification 1.1</A>
060     * @author Jody Garnett, Refractions Research Inc.
061     * @since GeoAPI 2.1
062     */
063    public interface FilterFactory2 extends FilterFactory {
064    ////////////////////////////////////////////////////////////////////////////////
065    //
066    //  FILTERS
067    //
068    ////////////////////////////////////////////////////////////////////////////////
069    
070        /** Retrieves the value of a {@linkplain org.opengis.feature.Feature feature}'s property. */
071        PropertyName property(Name name);
072    
073        /**
074         * Character string comparison operator with pattern matching and specified wildcards.
075         *      
076         * @param expr
077         * @param pattern
078         * @param wildcard
079         * @param singleChar
080         * @param escape
081         * @param matchCase
082         * @return
083         */
084        PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase);
085        
086    ////////////////////////////////////////////////////////////////////////////////
087    //
088    //  SPATIAL FILTERS
089    //
090    ////////////////////////////////////////////////////////////////////////////////
091    
092        /** Checks if the geometry expression overlaps the specified bounding box. */
093        BBOX        bbox( Expression geometry, double minx, double miny, double maxx, double maxy, String srs);
094    
095        /**
096         * Checks if the bounding box of the feature's geometry overlaps the indicated bounds.
097         * <p>
098         * This method does not strictly confirm to the the Filter 1.0 specification, you may
099         * use it to check expressions other than PropertyName.
100         * </p>
101         * @param geometry Expression used to access a Geometry, in order to check for interaction with bounds
102         * @param bounds Indicates the bounds to check geometry against
103         */
104        BBOX        bbox( Expression geometry, BoundingBox bounds);
105    
106    
107        /** Check if all of a geometry is more distant than the given distance from this object's geometry. */
108        Beyond      beyond( Expression geometry1, Expression geometry2, double distance, String units);
109    
110        /** Checks if the the first geometric operand contains the second. */
111        Contains    contains(Expression geometry1, Expression geometry2);
112    
113        /** Checks if the first geometric operand crosses the second. */
114        Crosses     crosses(Expression geometry1, Expression geometry2);
115    
116        /** Checks if the first operand is disjoint from the second. */
117        Disjoint    disjoint(Expression geometry1, Expression geometry2);
118    
119        /** Checks if any part of the first geometry lies within the given distance of the second geometry. */
120        DWithin     dwithin(Expression geometry1, Expression geometry2, double distance, String units);
121    
122        /** Checks if the geometry of the two operands are equal.
123         * @todo should be equals, resolve conflict with PropertyIsEqualTo equals( Expression, Expression )
124         */
125        Equals      equal(Expression geometry1, Expression geometry2);
126    
127        /** Checks if the two geometric operands intersect. */
128        Intersects  intersects(Expression geometry1, Expression geometry2);
129    
130        /** Checks if the interior of the first geometry somewhere overlaps the interior of the second geometry. */
131        Overlaps    overlaps(Expression geometry1, Expression geometry2);
132    
133        /** Checks if the feature's geometry touches, but does not overlap with the geometry held by this object. */
134        Touches     touches(Expression propertyName1, Expression geometry2);
135    
136        /** Checks if the feature's geometry is completely contained by the specified constant geometry. */
137        Within      within(Expression geometry1, Expression geometry2);
138    }