Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RelateNG algorithm for DE-9IM relationship evaluation #1052

Merged
merged 8 commits into from
May 16, 2024

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented May 13, 2024

This PR contains the new RelateNG algorithm for evaluating the DE-9IM matrix and topological predicates for geometry pairs.

The RelateNG algorithm has the following capabilities:

  • Efficient short-circuited evaluation of topological predicates (including matching custom DE-9IM matrix patterns)
  • Optimized repeated evaluation of predicates against a single geometry via cached spatial indexes (AKA "prepared mode")
  • Robust computation (only point-local topology is computed, so invalid geometry topology does not cause failures)
  • GeometryCollection inputs containing mixed types and overlapping polygons are supported, using union semantics.
  • Zero-length LineStrings are treated as being topologically identical to Points.
  • Support for BoundaryNodeRules.

Initially this is provided as a user-callable option. A subsequent version will use this algorithm for Geometry methods. It will also replace the PreparedGeometry implementation (with the API preserved for some number of versions).

This algorithm fixes the issues summarized in libgeos/geos#1060.

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

Fix SegmentString method usage

Align with master

Align with master

Add headers

Change classes to package-private

Javadoc

Improve TopologyPredicate API

Refactor predicate API

Refactor Predicate API

Remove return value, rename

javadoc

Remove TopologyPredicateValue

Refactor predicates

renaming

Add more functions

Add RelateNG unit test base class

Javadoc

Refactoring, add GC handling

various improvements

Imrove GC point locating

Add simple relate test

renaming, testing

renaming

Improve node location computation

Minor changes

Introduce node sections to pass intersections

refactoring

Refactoring

remove dead code

refactoring

TopologyBuilder refactoring

Refactor topology logic

simplify topology building logic

reafactoring

fix unit test

Javadoc, refactoring

refactor

refactoring, modularization

Add equalsTopo function

Add polygon id

Add tests

doc

refactoring

Fix adjacent function

Refactor out MaskPredicate

Refactoring

Fix RelateMaskPredicate logic

cleanup

Fix Relate mask predicate

Improve node evaluation logic

Add constants for relate patterns

Fix adjacent test

Improve RelateNG functions

Improve AdjacentPolygons perf test

Renaming

Modularize NodeSections

minor code cleanup

Javadoc

Regularize code

Add tests

Simplify intersection handling

remove unused method

disambiguate method

Add node section inversion

Improve NodeSection sorting

refactoring, code cleanup

Improve unit test

Add PolygonNodeInverter unit test

Generalize node conversion algorithm

Fix headers

Add PolygonNodeConverter unit test

rename collect method

javadoc

Add NG functions

code cleanup

Javadoc

Javadoc

Code cleanup

remove dead code

Handle point location on GC adjacent edges

Renaming

Change to using MCIndexSegmentSetMutualIntersector

Fix bug in AdjacentEdgeLocator

Switch to using isOnSegment

Minor code improvements

Add unit test

Change to package visible

Fix how nodes are located on boundaries

Javadoc

Javadoc

Add fix for overlapping GCs with hole

Fix polygon touching interior endpoint

Add area-line at point interaction update

Javadoc, arg order

Code cleanup, naming, refactoring

Refactor

Refactor DimensionLocation.EXTERIOR

Implement prepared RelatePointLocator

Change to using pattern from mask

Change to pattern from mask

Improve performance tests

Improve point testing performance

Javadoc

Update copyright

Add XML GC tests

Add package Javadoc

Update package Javadoc

Rename RelateNG method

Add RelatePatternPredicate short-circuit

remove debug lines

change method visibility

Refactor RelateNG API

Refactor API

Move LinearBoundary into RelatePointLocator

Refactor Locator

Improve GC scanning

Code cleanup, refactoring

Javadoc

Change API

Refactor IM pattern API

javadoc, method renaming

Javadoc

Refactoring

renaming

Renaming

change visibility to package

Renaming

Javadoc

Javavdoc

Add Relate issue tests

Add unit tests

Improve Tracer API

Cache geometry empty status

Add potential optimization

Add unit tests for zero-len line

Remove bad test

Javadoc

Javadoc

Fix handling of repeated points

Javadoc

Add optimization to skip disjoint geoms in point tests

Fix EdgeSegmentIntersector deduplication

Javadoc, refactoring

Add unit test

Add zero-length line test

Javadoc

Javadoc

Javadoc
@dr-jts dr-jts changed the title RelateNG algorithm for DE-9IM topology evaluation RelateNG algorithm for DE-9IM relationship evaluation May 16, 2024
@dr-jts dr-jts merged commit 773ee33 into locationtech:master May 16, 2024
2 checks passed
@dr-jts dr-jts deleted the relateng branch May 16, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant