Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.PropertyName


                        return compare;
                    }
                   
                    @SuppressWarnings("unchecked")
                    protected int compare( SimpleFeature feature1, SimpleFeature feature2, SortBy order){
                        PropertyName name = order.getPropertyName();
                        Comparable value1 = (Comparable) name.evaluate( feature1 );
                        Comparable value2 = (Comparable) name.evaluate( feature2 );

                        if(value1 == value2) {
                            return 0;
                        }
                        if( order.getSortOrder() == SortOrder.ASCENDING ){
View Full Code Here


        List<String> originalNames = new ArrayList<String>();
        for (String name : names) {
            Expression ex = expressions.get(name);
            if (ex instanceof PropertyName) {
                // rename or pass through
                PropertyName pn = (PropertyName) ex;
                originalNames.add(pn.getPropertyName());
            } else {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE, "The attribute {0} has a general transformation "
                            + "{1}, can't associate it with an original attribute name ",
                            new Object[] { name, ex });
View Full Code Here

        List<SortBy> transformed = new ArrayList<SortBy>();
        for (SortBy sort : original) {
            if (sort == SortBy.NATURAL_ORDER || sort == SortBy.REVERSE_ORDER) {
                transformed.add(sort);
            }
            PropertyName pname = sort.getPropertyName();
            Expression ex = expressions.get(pname.getPropertyName());
            if (ex == null) {
                throw new IllegalArgumentException("Attribute " + pname
                        + " is not part of the output schema");
            } else if (ex instanceof PropertyName) {
                PropertyName pn = (PropertyName) ex;
                transformed.add(FF.sort(pn.getPropertyName(), sort.getSortOrder()));
            } else if (ex instanceof Literal) {
                // fine, we can continue, constants do not affect sorting
            } else {
                // ok, this one cannot be sent down, so we need to do sorting on our own anyways
                return null;
View Full Code Here

     * @return The inverse of this definition, or null if not invertible or if the inversion
     *         logic for the specified case is missing
     */
    public List<Definition> inverse() {
        if(expression instanceof PropertyName) {
            PropertyName pn = (PropertyName) expression;
            return Arrays.asList(new Definition(pn.getPropertyName(), FF.property(name)));
        }
       
        // add a Point(x,y) function and then have it be split into x,y here (two definitions)
       
        // TODO: look into algebraic inversion (e.g y = x + 3 -> x = y  - 3) and into creating a concept
View Full Code Here

            // in case no evaluation succeeds
            Class computedBinding = Object.class;

            // see if we are just passing a property trough
            if (expression instanceof PropertyName) {
                PropertyName pn = (PropertyName) expression;
                AttributeDescriptor descriptor = originalSchema.getDescriptor(pn.getPropertyName());

                if (descriptor == null) {
                    throw new IllegalArgumentException(
                            "Original feature type does not have a property named " + name);
                } else {
View Full Code Here

     */
    public void testBetween() throws IllegalFilterException {
        // Set up the integer
        Literal lower = fac.literal(1001);
        Literal upper = fac.literal(1003);
        PropertyName pint = fac.property("testInteger");
        PropertyName plong = fac.property("testLong");
        PropertyName pfloat = fac.property("testFloat");

        assertAttributeName(fac.between(lower, lower, upper), new String[0]);
        assertAttributeName(fac.between(pint, lower, upper), "testInteger");
        assertAttributeName(fac.between(pint, pint, pint), "testInteger");

View Full Code Here

        coords[0] = new Coordinate(1, 2);
        coords[1] = new Coordinate(3, 4);
        coords[2] = new Coordinate(5, 6);

        // Test Equals
        PropertyName att = fac.property("testGeometry");
        GeometryFactory gf = new GeometryFactory(new PrecisionModel());
        Literal geom = fac.literal(gf.createLineString(coords));
       
        Equals filter = fac.equal(att, geom);
        assertAttributeName(filter, "testGeometry");
View Full Code Here

     *
     * @throws IllegalFilterException If the constructed filter is not valid.
     */
    public void testLogic() throws IllegalFilterException {
       
        PropertyName testAttribute = fac.property("testString");

        // Set up true sub filter
        PropertyIsEqualTo filterTrue = fac.equals(testAttribute, fac.literal("test string data"));

        // Set up false sub filter
View Full Code Here

        //this stuff could update the tests that'd be great - ch.
        //org.geotools.map.Map map = new DefaultMap();
        //The following is complex, and should be built from
        //an SLD document and not by hand

        PropertyName symbExpr = filterFactory.property("symbol");
        Mark textMark = new MarkImpl("square");

        GraphicImpl graphic = new GraphicImpl();
        graphic.addSymbol(textMark);
View Full Code Here

        assertEquals("Jenks", qInt.getName());
    }

    public void testSetParameters() throws Exception {
        Literal classes = ff.literal(3);
        PropertyName expr = ff.property("foo");
        JenksNaturalBreaksFunction func = (JenksNaturalBreaksFunction) ff.function("Jenks", expr,
                classes);
        assertEquals(3, func.getClasses());
        classes = ff.literal(12);
        func = (JenksNaturalBreaksFunction) ff.function("Jenks", expr, classes);
View Full Code Here

TOP

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

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.