Package org.opengis.filter

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


    private PropertyIsEqualTo createGeometryFunctionFilter( String geomXPath, Object geometryClassSimpleName ) throws IllegalFilterException {
        FilterFactory factory=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        FilterFunction_geometryType geomTypeExpr=new FilterFunction_geometryType();
        List<Expression> params = new ArrayList<Expression>();
        params.add(factory.property(geomXPath));
        geomTypeExpr.setParameters(params);
       
        return factory.equals(geomTypeExpr, factory.literal(geometryClassSimpleName));
    }
   
View Full Code Here


    private PropertyIsEqualTo createGeometryFunctionFilter( String geomXPath,
            Object geometryClassSimpleName ) throws IllegalFilterException {
        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

    public void testBackendRemovedIssue() throws Exception{
      FeatureStore<SimpleFeatureType, SimpleFeature> fs = (FeatureStore<SimpleFeatureType, SimpleFeature>) store
        .getFeatureSource(featureType.getName().getLocalPart());
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Expression expr2 = factory.literal("1");
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);
        fs.removeFeatures(filter);
        list.refresh();
        for( IIssue issue : list ) {
            System.out.println(issue.getId());
View Full Code Here

        issue.setDescription(newDescription);
        ((IRemoteIssuesList)list).save(issue);
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());

        Expression expr2 = factory.literal(issue.getId());
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);

        SimpleFeature next = store.getFeatureSource(featureType.getName().getLocalPart()).getFeatures(filter).features().next();
        assertEquals(newDescription, next.getAttribute(IssuesListTestHelper.DESCRIPTION_ATTR));
    }
View Full Code Here

          newValues[7]=issue.getResolution();
          newValues[8]=viewMemento;
         
          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


    public void removeIssues( Collection< ? extends IIssue> changed ) throws IOException {
        FilterFactory factory=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());

    Expression expr1 = factory.property(getAttributeMapper().getId());
   
    Filter filter = null;
   
        for( IIssue issue : changed ) {
            String id=issue.getId();
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

                //check that property names are actually valid
                QName name = property.getName();
                PropertyName propertyName = null;
               
                if ( name.getPrefix() != null && !"".equals( name.getPrefix() )) {
                    propertyName = ff.property( name.getPrefix() + ":" + name.getLocalPart() );
                }
                else {
                    propertyName = ff.property( name.getLocalPart() );
                }
               
View Full Code Here

               
                if ( name.getPrefix() != null && !"".equals( name.getPrefix() )) {
                    propertyName = ff.property( name.getPrefix() + ":" + name.getLocalPart() );
                }
                else {
                    propertyName = ff.property( name.getLocalPart() );
                }
               
                if ( propertyName.evaluate( featureType ) == null ) {
                    String msg = "No such property: " + property.getName();
                    throw new WFSException( msg );
View Full Code Here

                    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

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.