Skip to content

Commit

Permalink
Merge pull request deegree#1664 from lat-lon/fix/isGeomTypeOptionalGe…
Browse files Browse the repository at this point in the history
…ometries-XPLANBOX-2615

Return false is geometry property does not exists (3.6)
  • Loading branch information
stephanr authored Mar 27, 2024
2 parents 6390ff6 + 9fa02f4 commit c8e7d52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
throws FilterEvaluationException {
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);

if (vals.length == 0) {
return new TypedObjectNode[] { new PrimitiveValue(Boolean.toString(false)) };
}
if (vals.length != 1) {
throw new FilterEvaluationException(
"The " + NAME + " function's first argument must evaluate" + " to exactly one value.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
throws FilterEvaluationException {
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);

if (vals.length == 0) {
return new TypedObjectNode[] { new PrimitiveValue(Boolean.toString(false)) };
}
if (vals.length != 1) {
throw new FilterEvaluationException(
"The " + NAME + " function's first argument must evaluate" + " to exactly one value.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
throws FilterEvaluationException {
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);

if (vals.length == 0) {
return new TypedObjectNode[] { new PrimitiveValue(Boolean.toString(false)) };
}
if (vals.length != 1) {
throw new FilterEvaluationException(
"The " + NAME + " function's first argument must evaluate" + " to exactly one value.");
Expand Down

0 comments on commit c8e7d52

Please sign in to comment.