return name;
}
;
};
filter.accept(new AbstractFilterVisitor(visitor), null);
//2. ensure any spatial predicate is made against a property
// that is actually spatial
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 feataure type to make sure its
// a geometric type
AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
if ( !( att instanceof GeometryDescriptor ) ) {
throw new WFSException(request, "Property " + name
+ " is not geometric in feature type " + meta.prefixedName(),
"InvalidParameterValue");
}
}
return filter;
}
};
filter.accept(fvisitor, null);
//3. ensure that any bounds specified as part of the query
// are valid with respect to the srs defined on the query
if ( wfs.isCiteCompliant() ) {
if ( query.getSrsName() != null ) {
final Query fquery = query;
fvisitor = new AbstractFilterVisitor() {
public Object visit(BBOX filter, Object data) {
if ( filter.getSRS() != null &&
!fquery.getSrsName().toString().equals( filter.getSRS() ) ) {
//back project bounding box into geographic coordinates