Package org.opengis.filter

Examples of org.opengis.filter.PropertyIsEqualTo


    }
   
    private void createGeometrySLD( Color colour, String geomXPath, SLDContentManager sldContentManager ) throws IllegalFilterException {
        // create Point rule.
        Rule rule=sldContentManager.getDefaultRule();
        PropertyIsEqualTo filter = createGeometryFunctionFilter(geomXPath, Point.class.getSimpleName());
        rule.setFilter(filter);
        rule.symbolizers().add(createPointSymbolizer(colour));
        sldContentManager.getDefaultFeatureTypeStyle().rules().add(rule);

        // create MultiPoint rule
View Full Code Here


        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        FilterFunction_geometryType geomTypeExpr = new FilterFunction_geometryType();
        List<Expression> params = Arrays.asList(new Expression[]{factory.property(geomXPath)});
        geomTypeExpr.setParameters(params);

        PropertyIsEqualTo filter = factory.equals(geomTypeExpr, factory
                .literal(geometryClassSimpleName));
        return filter;
    }
View Full Code Here

    private void createGeometrySLD( Color colour, Color colour2, String geomXPath, Style style,
            int size ) throws IllegalFilterException {
        // create Point rule
        Rule rule = getDefaultRule(style);
        PropertyIsEqualTo filter = createGeometryFunctionFilter(geomXPath, Point.class
                .getSimpleName());
        rule.setFilter(filter);
        Symbolizer[] pointSymbolizers = new Symbolizer[]{createPointSymbolizer(colour, size)};
        rule.setSymbolizers(pointSymbolizers);
        getDefaultFeatureTypeStyle(style).addRule(rule);
View Full Code Here

         
          FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools
        .getDefaultHints());
    Expression expr1 = factory.property(getAttributeMapper().getId());
    Expression expr2 = factory.literal(issue.getId());
    PropertyIsEqualTo filter = factory.equals(expr1, expr2);
    getFeatureStore().modifyFeatures(attributeType, newValues, filter);
  }
View Full Code Here

    Filter filter = null;
   
        for( IIssue issue : changed ) {
            String id=issue.getId();
            Expression expr2 = factory.literal(id);
            PropertyIsEqualTo tmp = factory.equals(expr1, expr2);
           
            if( filter==null )
                filter=tmp;
            else
                filter=factory.or(filter, tmp);
View Full Code Here

    @Test
    public void testIsValid() throws Exception {
        FilterFactory fac=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
       
        String attributeName = "string";
        PropertyIsEqualTo filter = fac.equals(fac.property(attributeName), fac.literal("Value"));
       
        SimpleFeatureTypeBuilder builder=new SimpleFeatureTypeBuilder();
        builder.setName("test");
        builder.restriction(filter).add(attributeName, String.class);
       
View Full Code Here

        request = (GetMapRequest) reader.read(request, parseKvp(kvp), kvp);

        assertNotNull(request.getCQLFilter());
        assertEquals(1, request.getCQLFilter().size());

        PropertyIsEqualTo filter = (PropertyIsEqualTo) request.getCQLFilter().get(0);
    }
View Full Code Here

        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);

        // try the opposite, literal and function
        original = ff.equals(function, ff.literal("Point"));
        clone = (Filter) original.accept(reprojector, null);
        assertNotSame(original, clone);
        assertEquals(original, clone);
    }
View Full Code Here

   
    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);
        assertEquals(clone.getExpression1(), original.getExpression1());
        LineString clonedLs = (LineString) clone.getExpression2().evaluate(null);
        assertTrue(15 == clonedLs.getCoordinateN(0).x);
        assertTrue(10 == clonedLs.getCoordinateN(0).y);
        assertTrue(25 == clonedLs.getCoordinateN(1).x);
        assertTrue(20 == clonedLs.getCoordinateN(1).y);
        assertEquals(CRS.decode("EPSG:4326"), clonedLs.getUserData());
View Full Code Here

            if (!(rule.getSymbolizers()[0] instanceof TextSymbolizer)) {
                assertTrue(rule.getFilter() instanceof And);
                And andFilter = (And) rule.getFilter();
                assertEquals(2, andFilter.getChildren().size());

                PropertyIsEqualTo filter = (PropertyIsEqualTo) andFilter.getChildren().get(0);
                PropertyName propertyName = (PropertyName) filter.getExpression1();
                assertEquals("_gx_style", propertyName.getPropertyName());
                Literal valueExpression = (Literal) filter.getExpression2();
                assertEquals("1", valueExpression.getValue());

                geomSelectFunction = andFilter.getChildren().get(1);
            }
View Full Code Here

TOP

Related Classes of org.opengis.filter.PropertyIsEqualTo

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.