Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsNull


            Map hints) throws IOException, OperationNotSupportedException {
            if (!canEncode(element, value, hints)) {
                return;
            }

            PropertyIsNull lf = (PropertyIsNull) value;

            output.startElement(element.getNamespace(), element.getName(), null);
            elems[0].getType().encode(elems[0], lf.getExpression(), output,
                hints); // PropertyName

            //            elems[1].getType().encode(elems[1],lf.getNullCheckValue(),output,hints); // Literal
            output.endElement(element.getNamespace(), element.getName());
        }
View Full Code Here


        assertSame(literal, mathUnmapped.getExpression2());
    }

    @Test
    public void testNullFilter() throws Exception {
        PropertyIsNull nullFilter = ff.isNull(ff.property("measurement/result"));

        Filter unrolled = (Filter) nullFilter.accept(visitor, null);
        assertTrue(unrolled instanceof PropertyIsNull);
        assertNotSame(nullFilter, unrolled);

        PropertyIsNull unmapped = (PropertyIsNull) unrolled;
        Expression unmappedAtt = unmapped.getExpression();
        assertTrue(unmappedAtt instanceof PropertyName);
        assertEquals("results_value", ((PropertyName) unmappedAtt).getPropertyName());
    }
View Full Code Here

        Add expected = ff.add(ff.literal(1), ff.literal(1));
    }

    @Test
    public void and() {
        PropertyIsNull nn = ff.isNull(ff.property("bar"));
        Equals eq = ff.equal(ff.property("foo"), ff.literal("john"));
        And and = ff.and(nn, eq);
    }
View Full Code Here

        return factory.isNull((Expression) node.getChildValue(Expression.class));
    }

    public Object getProperty(Object object, QName name)
        throws Exception {
        PropertyIsNull isNull = (PropertyIsNull) object;

        if (OGC.PropertyName.equals(name) && isNull.getExpression() instanceof PropertyName) {
            return isNull.getExpression();
        }

        if (OGC.Literal.equals(name) && isNull.getExpression() instanceof Literal) {
            return isNull.getExpression();
        }

        return null;
    }
View Full Code Here

    }

    public void testParse() throws Exception {
        FilterMockData.propertyisNull(document, document);

        PropertyIsNull isNull = (PropertyIsNull) parse();

        assertNotNull(isNull.getExpression());
    }
View Full Code Here

    public PropertyIsNull buildPropertyIsNull() throws CQLException {
        try {
            org.opengis.filter.expression.Expression property = this.resultStack
                    .popExpression();

            PropertyIsNull filter = filterFactory.isNull(property);

            return filter;
        } catch (CQLException e) {
            throw new CQLException("Exception building Null Predicate", this.cqlSource);
        }
View Full Code Here

                            new Coordinate(-88.071564, 37.51099) }), new LinearRing[] {}) });
            mp.setUserData("http://www.opengis.net/gml/srs/epsg.xml#" + EPSG_CODE);

            PropertyName geometryAttributeExpression = filterFac.property(ft
                    .getGeometryDescriptor().getLocalName());
            PropertyIsNull geomNullCheck = filterFac.isNull(geometryAttributeExpression);
            Query query = new Query(typename, filterFac.not(geomNullCheck), 1,
                    Query.ALL_NAMES, null);
            SimpleFeatureIterator inStore = fs.getFeatures(query).features();

            SimpleFeature f, f2;
View Full Code Here

   
    // TODO test or ( null, and( fidFilter, null ) ) filter
    public void testStrictHintComplexFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
       
        PropertyIsNull null1=ff.isNull( ff.property("name") );
        PropertyIsNull null2=ff.isNull( ff.property("geom") );
       
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));       
        Filter filter=ff.or( null2, ff.and( null1,  ff.id( set ) ) );
       
View Full Code Here

     * Test the null operator.
     *
     * @throws IllegalFilterException If the constructed filter is not valid.
     */
    public void testNull() throws IllegalFilterException {
        PropertyIsNull filter = fac.isNull(fac.property("foo"));
        assertAttributeName( filter, new String[]{"foo"} );       
    }
View Full Code Here

    }

    public void testGetFeaturesWithIsNullFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsNull f = ff.isNull(ff.property("security_ss"));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(1, features.size());
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.PropertyIsNull

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.