Skip to content

Commit c8e7d52

Browse files
authored
Merge pull request #1664 from lat-lon/fix/isGeomTypeOptionalGeometries-XPLANBOX-2615
Return false is geometry property does not exists (3.6)
2 parents 6390ff6 + 9fa02f4 commit c8e7d52

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

deegree-core/deegree-core-filterfunctions/src/main/java/org/deegree/filter/function/geometry/IsCurve.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
5959
throws FilterEvaluationException {
6060
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);
6161

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

deegree-core/deegree-core-filterfunctions/src/main/java/org/deegree/filter/function/geometry/IsPoint.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
5656
throws FilterEvaluationException {
5757
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);
5858

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

deegree-core/deegree-core-filterfunctions/src/main/java/org/deegree/filter/function/geometry/IsSurface.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
5757
throws FilterEvaluationException {
5858
TypedObjectNode[] vals = getParams()[0].evaluate(obj, xpathEvaluator);
5959

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

0 commit comments

Comments
 (0)