From dbc537d6e7d9f9bdf87df389b4abf2195409f9a7 Mon Sep 17 00:00:00 2001 From: Martin Davis Date: Fri, 11 Oct 2024 12:24:05 -0700 Subject: [PATCH] Fix equalsTopo predicate for empty --- .../jts/operation/relateng/RelatePredicate.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relateng/RelatePredicate.java b/modules/core/src/main/java/org/locationtech/jts/operation/relateng/RelatePredicate.java index 87d9f51b53..7802be5a9b 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relateng/RelatePredicate.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relateng/RelatePredicate.java @@ -482,11 +482,20 @@ public static TopologyPredicate equalsTopo() { @Override public void init(int dimA, int dimB) { super.init(dimA, dimB); - require(dimA == dimB); + //-- don't require equal dims, because EMPTY = EMPTY for all dims } + @Override + public boolean requireInteraction() { + //-- allow EMPTY = EMPTY + return false; + }; + @Override public void init(Envelope envA, Envelope envB) { + //-- handle EMPTY = EMPTY cases + setValueIf(true, envA.isNull() && envB.isNull()); + require(envA.equals(envB)); }