Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Function


        assertEquals("desc1", ((Literal) right).getValue());
    }

    @Test
    public void testFunction() throws Exception {
        Function fe = ff.function("strIndexOf",
                ff.property("/measurement/determinand_description"), ff
                        .literal("determinand_description_1"));

        List unrolledExpressions = (List) fe.accept(visitor, null);

        Expression unmapped = (Expression) unrolledExpressions.get(0);
        assertTrue(unmapped instanceof Function);
        List params = ((Function) unmapped).getParameters();
        assertEquals(2, params.size());
View Full Code Here


        Expression left = newFilter.getExpression1();
        Expression right = newFilter.getExpression2();

        assertSame(right, literalGeom);
        assertTrue(left instanceof Function);
        Function fe = (Function) left;
        assertEquals("buffer", fe.getName());

        Expression arg0 = (Expression) fe.getParameters().get(0);
        assertTrue(arg0 instanceof PropertyName);
        assertEquals("location", ((PropertyName) arg0).getPropertyName());
    }
View Full Code Here

    }

    static Filter lookupExtendedOperator(Name opName, List<Expression> expressions,
        org.opengis.filter.FilterFactory factory) {
        FunctionFinder finder = new FunctionFinder(null);
        Function f = finder.findFunction(opName.getLocalPart(), expressions);
        return factory.equal(f, factory.literal(true), true);
    }
View Full Code Here

            "<fes:Function xmlns:fes='" + FES.NAMESPACE + "' name='abs'>" +
            "   <fes:Literal>12</fes:Literal> " +
            "</fes:Function>";
        buildDocument(xml);

        Function f = (Function) parse();
        assertNotNull(f);
        assertEquals("abs", f.getName());
        assertEquals(1, f.getParameters().size());
        assertTrue(f.getParameters().get(0) instanceof Literal);
    }
View Full Code Here

    }

    @Test
    public void testAttributeBasedRecode() {
        // this is a case showing that recode/categorize is not always the most compact solution...
        Function width = ff.function("recode", ff.property("type"), ff.literal("local-road"),
                ff.literal(2), ff.literal("secondary"), ff.literal(3), ff.literal("highway"),
                ff.literal(6));
        Function color = ff.function("recode", ff.property("type"), ff.literal("local-road"),
                ff.literal("#009933"), ff.literal("secondary"), ff.literal("#0055CC2"),
                ff.literal("highway"), ff.literal("#FF0000"));
        Style style = new LineSymbolizerBuilder().stroke().color(color).width(width).buildStyle();
        // print(style);
View Full Code Here

        xlink = (XlinkPropertyNameType) query.getXlinkPropertyName().get(1);
        assertEquals("gt:propertyC/gt:propertyD", xlink.getValue());
        assertEquals("1", xlink.getTraverseXlinkDepth());
        assertNull(xlink.getTraverseXlinkExpiry());

        Function function;
        function = (Function) query.getFunction().get(0);
        assertNotNull(function);
        assertEquals("max", function.getName());

        function = (Function) query.getFunction().get(1);
        assertNotNull(function);
        assertEquals("min", function.getName());

        assertTrue(query.getFilter() instanceof Id);
        assertEquals(1, query.getSortBy().size());
        assertTrue(query.getSortBy().get(0) instanceof SortBy);
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private QueryType buildTestQuery() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

        final Function function1 = ff.function("MAX", new Expression[] { ff.literal(1),
                ff.literal(2) });
        final Function function2 = ff.function("MIN", new Expression[] { ff.literal(1),
                ff.literal(2) });

        final XlinkPropertyNameType xlinkPropertyName1 = factory.createXlinkPropertyNameType();
        xlinkPropertyName1.setTraverseXlinkExpiry(BigInteger.valueOf(10));
        xlinkPropertyName1.setTraverseXlinkDepth("*");
 
View Full Code Here

                ff.greaterOrEqual(ff.property("pop"), ff.literal("100000")), 16);
    }

    @Test
    public void testCagetorizeBasedPoint() {
        Function size = ff.function("categorize", ff.property("pop"), ff.literal(8),
                ff.literal(50000), ff.literal(12), ff.literal(100000), ff.literal(16));
        Style style = new GraphicBuilder().size(size).mark().name("circle").fill()
                .color(new Color(0, 51, 204)).buildStyle();
        // print(style);
View Full Code Here

        assertEquals("xmml:Borehole", targetXPath.toString());

        Expression idExpression = attMapping.getIdentifierExpression();
        assertNotNull(idExpression);
        assertTrue(idExpression instanceof Function);
        Function idFunction = (Function) idExpression;
        assertEquals("strConcat", idFunction.getName());
        assertTrue(idFunction.getParameters().get(0) instanceof Literal);
        assertTrue(idFunction.getParameters().get(1) instanceof PropertyName);

        assertEquals(Expression.NIL, attMapping.getSourceExpression());
    }
View Full Code Here

    }
   
    public void testPropertyFucntion() {
        PointSymbolizer ps = sb.createPointSymbolizer();
        ps.setGeometry(ff.function("offset", ff.property("the_geom"), ff.property("offx"), ff.property("offy")));
        Function func = ff.function("property", ff.function("env", ff.literal("pname")));
        PropertyIsEqualTo filter = ff.equals(func, ff.literal("test"));
        Rule r = sb.createRule(ps);
        r.setFilter(filter);
       
        try  {
View Full Code Here

TOP

Related Classes of org.opengis.filter.expression.Function

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.