* @param params
* @return
*/
public static Expression getSpatialExpression(int operator, Expression geom1, Object geom2, String params) {
ExpressionOperator anOperator = geom1.getOperator(operator);
FunctionExpression expression = new FunctionExpression();
expression.setBaseExpression(geom1);
expression.addChild(Expression.from(geom1, geom1));
expression.addChild(Expression.from(geom2, geom1));
//Bug 5885276, the empty string either like " " or "" needs to be substituted
//by null prior to passing to Geometry call.
if (params==null || params.trim().equals("")){
expression.addChild(Expression.from(null, geom1));
}else{
expression.addChild(Expression.from(params, geom1));
}
expression.setOperator(anOperator);
Expression finalExpression = expression.equal("TRUE");
return finalExpression;
}