Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory.literal()


                    FeatureSource fs = remoteStore.getFeatureSource(TOPP_STATES);
                    remoteStatesAvailable = Boolean.TRUE;
                    // check a basic response can be answered correctly
                    DefaultQuery dq = new DefaultQuery(TOPP_STATES);
                    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
                    dq.setFilter(ff.greater(ff.property("PERSONS"), ff.literal(20000000)));
                    FeatureCollection fc = fs.getFeatures(dq);
                    if(fc.size() != 1) {
                        logger.log(Level.WARNING, "Remote database status invalid, there should be one and only one " +
                                "feature with more than 20M persons in topp:states");
                        remoteStatesAvailable = Boolean.FALSE;
View Full Code Here


        final FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
View Full Code Here

        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
View Full Code Here

        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
View Full Code Here

        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
        // only defaults
        assertNull(ff.function("env", ff.literal("myParam")).evaluate(null));
        assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
    }

    private void assertInvalidMandatoryParam(String expectedExceptionCode) {
        try {
View Full Code Here

        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
        // only defaults
        assertNull(ff.function("env", ff.literal("myParam")).evaluate(null));
        assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
    }

    private void assertInvalidMandatoryParam(String expectedExceptionCode) {
        try {
            response.execute(request);
View Full Code Here

        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
        // only defaults
        assertNull(ff.function("env", ff.literal("myParam")).evaluate(null));
        assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
    }

    private void assertInvalidMandatoryParam(String expectedExceptionCode) {
        try {
            response.execute(request);
View Full Code Here

        MapLayerInfo layer = request.getLayers()[0];
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), layer.getName());
        // check the filter imposed in the feature type constraint
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        assertEquals(1, layer.getLayerFeatureConstraints().length);
        assertEquals(ff.equals(ff.property("ID"), ff.literal("xyz")), layer.getLayerFeatureConstraints()[0].getFilter());
    }
   
    public void testSldLibraryFeatureTypeConstraints() throws Exception {
        // no styles, no layer, the full definition is in the sld
        HashMap kvp = new HashMap();
View Full Code Here

        MapLayerInfo layer = request.getLayers()[0];
        assertEquals(getLayerId(MockData.BASIC_POLYGONS), layer.getName());
        // check the filter imposed in the feature type constraint
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        assertEquals(1, layer.getLayerFeatureConstraints().length);
        assertEquals(ff.equals(ff.property("ID"), ff.literal("xyz")), layer.getLayerFeatureConstraints()[0].getFilter());
    }
   
    /**
     * One of the cite tests ensures that WMTVER is recognized as VERSION and the server does
     * not complain
View Full Code Here

        OGRDataStore s = new OGRDataStore(getAbsolutePath(STATE_POP), null, null, ogr);
        FeatureSource fs = s.getFeatureSource(s.getTypeNames()[0]);
       
        // equality filter
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Filter f = ff.equal(ff.property("STATE_NAME"), ff.literal("New York"), true);
        assertEquals(1, fs.getFeatures(f).size());
       
        // greater than
        f = ff.greater(ff.property("PERSONS"), ff.literal(10000000));
        assertEquals(6, fs.getFeatures(f).size());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.