forked from locationtech/jts
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Martin Davis <mtnclimb@gmail.com> Move to src dir Signed-off-by: Martin Davis <mtnclimb@gmail.com> More code Signed-off-by: Martin Davis <mtnclimb@gmail.com> Get it running Signed-off-by: Martin Davis <mtnclimb@gmail.com> Fix conflict Add more short-circuits Signed-off-by: Martin Davis <mtnclimb@gmail.com> Refactoring, add collinear intersection Signed-off-by: Martin Davis <mtnclimb@gmail.com> Add license, more predicates Signed-off-by: Martin Davis <mtnclimb@gmail.com> Renaming Signed-off-by: Martin Davis <mtnclimb@gmail.com> Renaming, fix L/L short-circuit Signed-off-by: Martin Davis <mtnclimb@gmail.com> WIP - more detailed intersection info Signed-off-by: Martin Davis <mtnclimb@gmail.com> Add geometry dimensionality checks Signed-off-by: Martin Davis <mtnclimb@gmail.com> Add LinearBoundary Signed-off-by: Martin Davis <mtnclimb@gmail.com> Add header, fix imports Rename IMPredicate methods Refactoring Refactoring remove dead code Refactor predicate model Refactor predicate model refactoring Add point support Simplify builder logic Fix proper intersection logic renaming code reorg Refactoring refactoring Fix order of EdgeIntersector comparison Add AreaArea crossing test Enhance PolygonNodeTopology to handle collinear Add predicates Javadoc Add node edge handling cleanup fix imports Add node evaluation Various improvements Various improvements Fix touches bug Renaming, fixes Renaming, fixes Improve tests Improve perf test Add PredicateTracer Add short-circuit Fix some bugs Renaming Refactoring refactoring Avoid check for empty element Fix area-vertex evaluation Remove unused import Renaming Renames Renames Refactor constants Renaming, refactoring refactoring refactoring rename TopologyPredicateValue renaming use constant renaming initial commit for self-noding Add RelateNG functions Refactor addAreaEdge Add AB geometry edge intersection test formatting Refactoring to simplify Remove single-call method Refactoring Renaming various improvements typo in comment various improvements refactoring Chg addEdge method sig Fix unit test Improve tracing output Finish self-intersection handling Expose constants javadoc, refactoring Switch to HPRtree Refactoring formatting Refactor predicate logic functions Improve predicate logic shortcut methods simplify code add method improve msg add tests Add relate function Various fixes change evaluation order Rework point topology evaluation refactoring refactoring javadoc, renaming remove dead code Improve relate predicate code improve internal API rename TopologyPredicate.value add perf tests refactoring Add BoundaryNodeRule support
- Loading branch information
Showing
30 changed files
with
4,071 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
modules/app/src/main/java/org/locationtech/jtstest/function/SelectionNGFunctions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2024 Martin Davis. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* and Eclipse Distribution License v. 1.0 which accompanies this distribution. | ||
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*/ | ||
|
||
package org.locationtech.jtstest.function; | ||
|
||
import org.locationtech.jts.geom.Geometry; | ||
import org.locationtech.jts.operation.relateng.RelateNG; | ||
import org.locationtech.jts.operation.relateng.TopologyPredicateFactory; | ||
|
||
public class SelectionNGFunctions | ||
{ | ||
public static Geometry intersectsNG(Geometry a, final Geometry mask) | ||
{ | ||
return SelectionFunctions.select(a, new GeometryPredicate() { | ||
public boolean isTrue(Geometry g) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.intersects(), mask, g); | ||
} | ||
}); | ||
} | ||
|
||
public static Geometry intersectsNGPrep(Geometry a, final Geometry mask) | ||
{ | ||
RelateNG relateNG = new RelateNG(mask, true); | ||
return SelectionFunctions.select(a, new GeometryPredicate() { | ||
public boolean isTrue(Geometry g) { | ||
return relateNG.evaluate(TopologyPredicateFactory.intersects(), g); | ||
} | ||
}); | ||
} | ||
|
||
public static Geometry coversNG(Geometry a, final Geometry mask) | ||
{ | ||
return SelectionFunctions.select(a, new GeometryPredicate() { | ||
public boolean isTrue(Geometry g) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.covers(), mask, g); | ||
} | ||
}); | ||
} | ||
|
||
public static Geometry coversNGPrep(Geometry a, final Geometry mask) | ||
{ | ||
RelateNG relateNG = new RelateNG(mask, true); | ||
return SelectionFunctions.select(a, new GeometryPredicate() { | ||
public boolean isTrue(Geometry g) { | ||
return relateNG.evaluate(TopologyPredicateFactory.covers(), g); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
|
53 changes: 53 additions & 0 deletions
53
modules/app/src/main/java/org/locationtech/jtstest/function/SpatialPredicateNGFunctions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2023 Martin Davis. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* and Eclipse Distribution License v. 1.0 which accompanies this distribution. | ||
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html | ||
* and the Eclipse Distribution License is available at | ||
* | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*/ | ||
package org.locationtech.jtstest.function; | ||
|
||
import org.locationtech.jts.geom.Geometry; | ||
import org.locationtech.jts.operation.relateng.RelateNG; | ||
import org.locationtech.jts.operation.relateng.TopologyPredicateFactory; | ||
|
||
public class SpatialPredicateNGFunctions { | ||
public static boolean contains(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.contains(), a, b); | ||
} | ||
public static boolean covers(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.covers(), a, b); | ||
} | ||
public static boolean coveredBy(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.coveredBy(), a, b); | ||
} | ||
public static boolean disjoint(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.disjoint(), a, b); | ||
} | ||
public static boolean equals(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.equalsTopo(), a, b); | ||
} | ||
public static boolean intersects(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.intersects(), a, b); | ||
} | ||
public static boolean overlaps(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.overlaps(), a, b); | ||
} | ||
public static boolean touches(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.touches(), a, b); | ||
} | ||
public static boolean within(Geometry a, Geometry b) { | ||
return RelateNG.evaluate(TopologyPredicateFactory.within(), a, b); | ||
} | ||
public static boolean relate(Geometry a, Geometry b, String mask) { | ||
return RelateNG.relate(a, b, mask); | ||
} | ||
public static String relateIM(Geometry a, Geometry b) { | ||
return RelateNG.relate(a, b).toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.