Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Function


                List parameters = offsetFunction.getParameters();
                parameters.set(1, ff.literal(xOffset));
                parameters.set(2, ff.literal(yOffset));
            }
        } else {
            Function function = ff.function("offset", ff.property("the_geom"), ff.literal(xOffset), ff.literal(yOffset));
            symbolizer.setGeometry(function);
        }
    }
View Full Code Here


    }

    private org.opengis.filter.Filter createGeometryTypeFilter( String geomName, String type )
            throws IllegalFilterException {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Function function = ff.function("geometryType", ff.property(geomName));
        return ff.equal(function, ff.literal(type)); //$NON-NLS-1$
    }
View Full Code Here

                //write them now that functions are sorted by name
                it = sortedFunctions.iterator();

                while (it.hasNext()) {
                    Function fe = (Function) it.next();

                    //TODO: as of now the geoapi Function interface
                    // does not allow use to report back properly the number of
                    // parameters, so we check for instances of FunctionExpression
                    // for now
                    if (fe instanceof FunctionExpression) {
                        String funName = fe.getName();
                        int funNArgs = ((FunctionExpression) fe).getArgCount();

                        AttributesImpl atts = new AttributesImpl();
                        atts.addAttribute("", "nArgs", "nArgs", "", funNArgs + "");
View Full Code Here

                    //write them now that functions are sorted by name
                    itr = sortedFunctions.iterator();

                    while (itr.hasNext()) {
                        Function fe = (Function) itr.next();
                        String name = fe.getName();
                        int nargs = 0;
                        if(fe instanceof FunctionExpression)
                            nargs = ((FunctionExpression) fe).getArgCount();

                        element("ogc:FunctionName", name,
View Full Code Here

        GeometryFactory gf = new GeometryFactory();
        LineString ls = gf.createLineString(new Coordinate[] {new Coordinate(10, 15), new Coordinate(20, 25)});
        ls.setUserData(CRS.decode("urn:x-ogc:def:crs:EPSG:6.11.2:4326"));
       
        // make sure a class cast does not occur, see: http://jira.codehaus.org/browse/GEOS-1860
        Function function = ff.function("geometryType", ff.property("geom"));
        PropertyIsEqualTo original = ff.equals(ff.literal("Point"), function);
        Filter clone = (Filter) original.accept(reprojector, null);
        assertNotSame(original, clone);
        assertEquals(original, clone);
View Full Code Here

        assertNotSame(original, clone);
        assertEquals(original, clone);
    }
   
    public void testIntersectsWithFunction() throws Exception {
        Function function = new GeometryFunction();
       
        // see if coordinates gets flipped, urn forces lat/lon interpretation
        Intersects original = ff.intersects(ff.property("geom"), function);
        Filter clone = (Filter) original.accept(reprojector, null);
        assertNotSame(original, clone);
View Full Code Here

        assertTrue(20 == clonedLs.getCoordinateN(1).y);
        assertEquals(CRS.decode("EPSG:4326"), clonedLs.getUserData());
    }
   
    public void testPropertyEqualWithFunction() throws Exception {
        Function function = new GeometryFunction();
       
        // see if coordinates gets flipped, urn forces lat/lon interpretation
        PropertyIsEqualTo original = ff.equals(ff.property("geom"), function);
        PropertyIsEqualTo clone = (PropertyIsEqualTo) original.accept(reprojector, null);
        assertNotSame(original, clone);
View Full Code Here

                                            final String styleKey,
                                            final String styleProperty,
                                            final Class<? extends Geometry>... geomClass) {
        if (symb != null) {
            Expression geomProperty = this.sldStyleBuilder.attributeExpression(this.geometryProperty);
            final Function geometryTypeFunction = this.sldStyleBuilder.getFilterFactory().function("geometryType", geomProperty);
            final ArrayList<Filter> geomOptions = Lists.newArrayListWithExpectedSize(geomClass.length);
            for (Class<? extends Geometry> requiredType : geomClass) {
                Expression expr = this.sldStyleBuilder.literalExpression(requiredType.getSimpleName());
                geomOptions.add(this.sldStyleBuilder.getFilterFactory().equals(geometryTypeFunction, expr));
            }
View Full Code Here

        // create the mapping definition
        List attMappings = new LinkedList();

        NamespaceSupport namespaces = new NamespaceSupport();

        Function aoiExpr = ff.function("buffer", ff.property("location"), ff.literal(10));

        attMappings.add(new AttributeMapping(null, aoiExpr, XPath.steps(targetFeature,
                "areaOfInfluence", namespaces)));

        Function strConcat = ff.function("strConcat", ff.property("anzlic_no"), ff
                .property("project_no"));

        attMappings.add(new AttributeMapping(null, strConcat, XPath.steps(targetFeature,
                "concatenated", namespaces)));
View Full Code Here

        assertNotNull(unrolledExpressions);
        assertEquals(1, unrolledExpressions.size());

        unmappedExpr = (Expression) unrolledExpressions.get(0);
        assertTrue(unmappedExpr instanceof Function);
        Function fe = (Function) unmappedExpr;
        assertEquals("buffer", fe.getName());

        Expression arg0 = (Expression) fe.getParameters().get(0);
        assertTrue(arg0 instanceof PropertyName);
        assertEquals("location", ((PropertyName) arg0).getPropertyName());
    }
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.