Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Literal


        assertEquals(200, icon.getIconWidth());
        assertEquals(100, icon.getIconHeight());
    }

    public void testSizeFromSLD() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70");
        Icon icon = (Icon) factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 200);
        assertNotNull(icon);
        assertEquals(200, icon.getIconWidth());
        assertEquals(200, icon.getIconHeight());
    }
View Full Code Here


        assertEquals(200, icon.getIconWidth());
        assertEquals(200, icon.getIconHeight());
    }
   
    public void testSizeFromSLDAndChart() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=200x100");
        Icon icon = (Icon) factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 600);
        assertNotNull(icon);
        assertEquals(600, icon.getIconWidth());
        assertEquals(300, icon.getIconHeight());
    }
View Full Code Here

        assertEquals(600, icon.getIconWidth());
        assertEquals(300, icon.getIconHeight());
    }
   
    public void testSizeFromSLDAndChartVertical() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=100x300");
        Icon icon = (Icon) factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 600);
        assertNotNull(icon);
        assertEquals(200, icon.getIconWidth());
        assertEquals(600, icon.getIconHeight());
    }
View Full Code Here

        namespaces.declarePrefix("geo", GEONS);
        namespaces.declarePrefix("xlink", XLINK.NAMESPACE);

        final FilterFactory2 ff = new FilterFactoryImplNamespaceAware(namespaces);
        final PropertyName propertyName = ff.property(queryProperty);
        final Literal literal = ff.literal(queryLiteral);

        final Filter filter = ff.equals(propertyName, literal);

        FeatureCollection<FeatureType, Feature> features = (FeatureCollection<FeatureType, Feature>) fSource
                .getFeatures(filter);
View Full Code Here

        Expression cat = ExpressionExtractor.catenateExpressions(Arrays.asList(l));
        assertEquals(l, cat);
    }
   
    public void testCatenateTwo() {
        Literal l = ff.literal("http://test?param=");
        PropertyName pn = ff.property("intAttribute");
        Expression cat = ExpressionExtractor.catenateExpressions(Arrays.asList(l, pn));
        assertTrue(cat instanceof Function);
        Function f = (Function) cat;
        assertEquals("Concatenate", f.getName());
View Full Code Here

        assertEquals("Concatenate", f.getName());
        assertEquals(l, f.getParameters().get(0));
        assertEquals(pn, f.getParameters().get(1));
    }
    public void testCatenateThree() {
        Literal l1 = ff.literal("http://test?param=");
        PropertyName pn = ff.property("intAttribute");
        Literal l2 = ff.literal("&param2=foo");
        Expression cat = ExpressionExtractor.catenateExpressions(Arrays.asList(l1, pn, l2));
        assertTrue(cat instanceof Function);
        Function f = (Function) cat;
        assertEquals("Concatenate", f.getName());
        assertEquals(l1, f.getParameters().get(0));
View Full Code Here

        assertTrue(equal.getExpression2() instanceof Literal);

        PropertyName name = (PropertyName) equal.getExpression1();
        assertEquals("testString", name.getPropertyName());

        Literal literal = (Literal) equal.getExpression2();
        assertEquals("2", literal.toString());
    }
View Full Code Here

       String name = propName.getPropertyName();
       assertEquals("the_geom", name);
      
       //Asserting the Geometry
       assertNotNull(filter.getExpression2());
       Literal geom = (Literal) filter.getExpression2();
       assertEquals("POINT (-74.817265 40.5296504)", geom.toString());
      
       //Asserting the Distance
       assertTrue(filter.getDistance() > 0 );
       Double dist = filter.getDistance();
       assertEquals(200.0, dist);
View Full Code Here

        return factory.literal(value);
    }

    public Element encode(Object object, Document document, Element value)
        throws Exception {
        Literal literal = (Literal) object;

        Object unconvertedValue = literal.getValue();
        if (unconvertedValue != null) {
            // use converter api to sreialize
            String textValue = Converters.convert(unconvertedValue, String.class);
            value.appendChild(document.createTextNode(textValue));
        }
View Full Code Here

*/
public class LiteralTypeBindingTest extends FilterTestSupport {
    public void testParse() throws Exception {
        FilterMockData.literal(document, document);

        Literal literal = (Literal) parse();
        assertNotNull(literal);
        assertEquals("foo", literal.getValue());
    }
View Full Code Here

TOP

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

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.