Map hints) throws IOException{
if (!canEncode(element, value, hints)) {
return;
}
DistanceBufferOperator distanceFilter = (DistanceBufferOperator) value;
AttributesImpl ai = new AttributesImpl();
String name = attrs[0].getName();
String uri = getNamespace().toString();
if (Filters.getExpressionType( distanceFilter.getExpression1() ) == ExpressionType.LITERAL_GEOMETRY) {
Geometry geometry = distanceFilter.getExpression1().evaluate(null,Geometry.class);
if( geometry.getUserData() != null ){
// code assume user data is an srsName see GEOT-693
String srsName = String.valueOf( geometry.getUserData() );
ai.addAttribute(uri, name, null, "string", srsName);
}
} else {
Geometry geometry = distanceFilter.getExpression2().evaluate(null,Geometry.class);
if( geometry.getUserData() != null ){
// code assume user data is an srsName see GEOT-693
String srsName = String.valueOf( geometry.getUserData() );
ai.addAttribute(uri, name, null, "string", srsName);
}
}
output.startElement(element.getNamespace(), element.getName(), null);
output.characters("" + distanceFilter.getDistance());
output.endElement(element.getNamespace(), element.getName());
}