Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.PropertyName


                    //2. ensure any spatial predicate is made against a property
                    // that is actually special
                    AbstractFilterVisitor fvisitor = new AbstractFilterVisitor() {
                     
                        protected Object visit( BinarySpatialOperator filter, Object data ) {
                            PropertyName name = null;
                            if ( filter.getExpression1() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression1();
                            }
                            else if ( filter.getExpression2() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression2();
                            }
                           
                            if ( name != null ) {
                                //check against fetaure type to make sure its
                                // a geometric type
                                AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
                                if ( !( att instanceof GeometryDescriptor ) ) {
                                    throw new WFSException("Property " + name + " is not geometric", "InvalidParameterValue");
                                }
                            }
                           
View Full Code Here


                Integer traverseXlinkDepth = traverseXlinkDepth( xlinkProperty.getTraverseXlinkDepth() );
               
                //set the depth and property as hints on the query
                hints.put(Hints.ASSOCIATION_TRAVERSAL_DEPTH, traverseXlinkDepth );
               
                PropertyName xlinkPropertyName = filterFactory.property( xlinkProperty.getValue() );
                hints.put(Hints.ASSOCIATION_PROPERTY, xlinkPropertyName );
               
                dataQuery.setHints( hints );
               
                //TODO: support multiple properties
View Full Code Here

        this.catalog = catalog;
    }

    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        PropertyName propertyName = (PropertyName) super.parse(instance, node, value);

        //JD: temporary hack, this should be carried out at evaluation time
        String name = propertyName.getPropertyName();

        if (name != null && name.matches("\\w+:\\w+")) {
            //namespace qualified name, ensure the prefix is valid
            String prefix = name.substring(0, name.indexOf(':'));
            String namespaceURI = namespaceSupport.getURI(prefix);
View Full Code Here

        //<xsd:element maxOccurs="unbounded" minOccurs="0" ref="ogc:PropertyName">
        //JD:difference in spec here, moved from ogc:PropertyName to string
        List propertyNames = node.getChildValues(PropertyName.class);

        for (Iterator p = propertyNames.iterator(); p.hasNext();) {
            PropertyName propertyName = (PropertyName) p.next();
            queryType.getPropertyName().add(propertyName.getPropertyName());
        }

        //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
        Filter filter = (Filter) node.getChildValue(Filter.class);
View Full Code Here

    Filter geometryFilter = null;
    Geometry geometry = queryParam.getGeometry();
    SpatialFilterType spatialFilterType = queryParam.getSpatialFilterType();
    if (geometry != null) {
      PropertyName geometryPropertyName = ff.property(geomtryField);
      if (spatialFilterType.equals(SpatialFilterType.INTERSECTS)) {
        geometryFilter = ff.intersects(ff.literal(geometry),
            geometryPropertyName);
      } else if (spatialFilterType.equals(SpatialFilterType.CONTAINS)) {
        geometryFilter = ff.contains(ff.literal(geometry),
View Full Code Here

        SpatialFilterType spatialFilterType = queryParam
            .getSpatialFilterType();

        String geomtryField = featureSource.getSchema()
            .getGeometryDescriptor().getLocalName();
        PropertyName geometryPropertyName = ff.property(geomtryField);
        if (spatialFilterType.equals(SpatialFilterType.INTERSECTS)) {
          geometryFilter = ff.intersects(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType.equals(SpatialFilterType.CONTAINS)) {
          geometryFilter = ff.contains(ff.literal(geometry),
View Full Code Here

   
    protected org.opengis.filter.Filter createFilter(FeatureSource<SimpleFeatureType, SimpleFeature> source)
    {
        String geomAttName = source.getSchema().getGeometryDescriptor()
                .getLocalName();
        PropertyName geomPropertyName = _filterFactory.property(geomAttName);

        Literal geomExpression = _filterFactory.literal(_geom);
        org.opengis.filter.Filter filter = createGeomFilter(_filterFactory,
                geomPropertyName, geomExpression);
        return filter;
View Full Code Here

                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

                    throw new IllegalArgumentException(sortAtt
                            + " sorting is not supported for featureclasses"
                            + " with no primary key");
                }
            } else {
                final PropertyName propertyName = sortAtt.getPropertyName();
                final String attName = propertyName.getPropertyName();
                final AttributeDescriptor descriptor = fullSchema.getDescriptor(attName);
                if (descriptor == null) {
                    throw new IllegalArgumentException(attName
                            + " does not exist. Can't sort by it");
                }
View Full Code Here

        // 6. MULTIPOLYGON( ((-1 -1, -1 1, 1 1, 1 -1, -1 -1)), ((-170 -80, -170 -70, -160 -70, -160
        // -80, -170 -80)) )
        // 7. POINT EMPTY
        // 8. null

        final PropertyName property = ff.property("SHAPE");
        Geometry geom;
        Filter filter;

        geom = geom("POINT(170 0)");
        filter = ff.dwithin(property, ff.literal(geom), 1d, "");
View Full Code Here

TOP

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

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.