Package org.vfny.geoserver.wfs.requests

Examples of org.vfny.geoserver.wfs.requests.FeatureRequest


    public void test21() throws Exception {
        String testRequest = "VERSION=1.0.0&" + "SERVICE=WFS&"
            + "REQUEST=GETFEATURE&" + "TYPENAME=rail&" + "BBOX=10,10,20,20";

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.setVersion("1.0.0");

        // make base comparison objects
        org.geotools.filter.GeometryFilter filter = factory
            .createGeometryFilter(AbstractFilter.GEOMETRY_INTERSECTS);

        //AttributeExpression leftExpression =
        //    factory.createAttributeExpression(null);
        //leftExpression.setAttributePath("@");
        // Creates coordinates for the linear ring
        Coordinate[] coords = new Coordinate[5];
        coords[0] = new Coordinate(10, 10);
        coords[1] = new Coordinate(10, 20);
        coords[2] = new Coordinate(20, 20);
        coords[3] = new Coordinate(20, 10);
        coords[4] = new Coordinate(10, 10);

        LinearRing outerShell = new LinearRing(coords, new PrecisionModel(), 0);
        Polygon polygon = new Polygon(outerShell, new PrecisionModel(), 0);
        LiteralExpression rightExpression = factory.createLiteralExpression(polygon);

        //filter.addLeftGeometry(leftExpression);
        filter.addRightGeometry(rightExpression);

        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(filter);
        baseRequest.addQuery(query);

        // run test      
        assertTrue(runKvpTest(baseRequest, testRequest, true));
    }
View Full Code Here


    public void test1() throws Exception {
        // make base comparison objects
        Query query = new Query();
        query.setTypeName("rail");

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.addQuery(query);

        // run test
        assertTrue(runXmlTest(baseRequest, "10", true));
    }
View Full Code Here

        // make base comparison objects       
        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(factory.createFidFilter("123"));

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.addQuery(query);

        // run test      
        assertTrue(runXmlTest(baseRequest, "6", true));
    }
View Full Code Here

        assertTrue(runXmlTest(baseRequest, "6", true));
    }

    public void test3() throws Exception {
        // make base comparison objects               
        FeatureRequest baseRequest = new FeatureRequest();
        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(factory.createFidFilter("123"));
        query.addPropertyName("name");
        query.addPropertyName("tracks");
        query.addPropertyName("id");
        baseRequest.addQuery(query);

        // run test
        assertTrue(runXmlTest(baseRequest, "7", true));
    }
View Full Code Here

        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(tempFilter);

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.addQuery(query);

        // run test       
        assertTrue(runXmlTest(baseRequest, "8", true));
    }
View Full Code Here

        query.setTypeName("rail");
        query.addFilter(tempFilter);
        query.addPropertyName("name");
        query.addPropertyName("tracks");

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.addQuery(query);

        // run test       
        assertTrue(runXmlTest(baseRequest, "9", true));
    }
View Full Code Here

        query.setTypeName("rail");
        query.addFilter(tempFilter.not());
        query.addPropertyName("name");
        query.addPropertyName("id");

        FeatureRequest baseRequest = new FeatureRequest();
        baseRequest.addQuery(query);
        baseRequest.setMaxFeatures(10000);

        // run test       
        assertTrue(runXmlTest(baseRequest, "11", true));
    }
View Full Code Here

        org.geotools.filter.GeometryFilter tempFilter = factory
            .createGeometryFilter(AbstractFilter.GEOMETRY_WITHIN);
        tempFilter.addLeftGeometry(tempLeftExp);
        tempFilter.addRightGeometry(tempRightExp);

        FeatureRequest baseRequest = new FeatureRequest();
        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(tempFilter);
        query.addPropertyName("name");
        query.addPropertyName("id");
        baseRequest.addQuery(query);
        query = new Query();
        query.setTypeName("roads");
        query.addFilter(tempFilter);
        query.addPropertyName("length");
        query.addPropertyName("id");
        baseRequest.addQuery(query);
        baseRequest.setMaxFeatures(10000);

        // run test       
        assertTrue(runXmlTest(baseRequest, "12", true));
    }
View Full Code Here

        org.geotools.filter.GeometryFilter tempFilter = factory
            .createGeometryFilter(AbstractFilter.GEOMETRY_WITHIN);
        tempFilter.addLeftGeometry(tempLeftExp);
        tempFilter.addRightGeometry(tempRightExp);

        FeatureRequest baseRequest = new FeatureRequest();

        FidFilter temp1 = factory.createFidFilter("123");
        temp1.addFid("124");

        FidFilter temp2 = factory.createFidFilter("1023");
        temp2.addFid("16");

        Query query = new Query();
        query.setTypeName("rail");
        query.addFilter(temp1);
        query.addPropertyName("name");
        query.addPropertyName("id");
        baseRequest.addQuery(query);
        query = new Query();
        query.setTypeName("roads");
        query.addFilter(temp2);
        query.addPropertyName("length");
        query.addPropertyName("id");
        baseRequest.addQuery(query);
        baseRequest.setMaxFeatures(10000);

        // run test       
        assertTrue(runXmlTest(baseRequest, "15", true));
    }
View Full Code Here

        tempFilter.addLeftValue(tempExp2);
        tempFilter.addRightValue(tempExp1);
        finalFilter = finalFilter.and(tempFilter);
        LOGGER.fine("filter: " + finalFilter);

        FeatureRequest baseRequest = new FeatureRequest();
        Query query = new Query();
        query.setTypeName("Person");
        query.addFilter(finalFilter);
        query.addPropertyName("Person/LastName");
        baseRequest.addQuery(query);
        baseRequest.setMaxFeatures(10000);

        // run test       
        //assertTrue(runXmlTest( baseRequest, "13", true));
    }
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wfs.requests.FeatureRequest

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.