public static <T extends Geometry> GeometryExpression<T> asGeometry(Expression<T> expr) {
        Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
        if (underlyingMixin instanceof PathImpl) {
            return new GeometryPath<T>((PathImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof OperationImpl) {
            return new GeometryOperation<T>((OperationImpl<T>) underlyingMixin);
        } else {
            return new GeometryExpression<T>(underlyingMixin) {

                private static final long serialVersionUID = -6714044005570420009L;

                @Override
                public <R, C> R accept(Visitor<R, C> v, C context) {
                    return this.mixin.accept(v, context);
                }

            };
        }
    }
Create a new GeometryExpression

@param expr Expression of type Geometry
@return new GeometryExpression
querydsl-spatial/src/main/java/com/querydsl/spatial/GeometryExpressions.java