Skip to content

Implement YStripesPointInAreaLocator - #1145

Open
micycle1 wants to merge 1 commit into
locationtech:masterfrom
micycle1:ystripes
Open

Implement YStripesPointInAreaLocator#1145
micycle1 wants to merge 1 commit into
locationtech:masterfrom
micycle1:ystripes

Conversation

@micycle1

@micycle1 micycle1 commented Aug 29, 2025

Copy link
Copy Markdown
Contributor

A faster point-in-area locator.

It's packaged such that the core polygon algo (YStripesPointInPolygonLocator) is defined in its own non-public class, then the Area variant constructs PolygonLocators for each Polygon in a Geometry, indexed via an STRtree.

The name could be changed too. Of course this too is an indexed PointInAreaLocator, but that exact name is taken.

@grootstebozewolf

Copy link
Copy Markdown
Contributor

Corpus PIP gallery gate against this PR's Y-stripe algorithm (NetTopologySuite.Proofs).

What we checked

Faithful port of YStripesPointInPolygonLocator / YStripesPointInAreaLocator (DD ray-crossing + Y-stripes) run against the Qed-backed gallery in nts-oracle-gallery.md, side-by-side with NTS 2.6 IndexedPointInAreaLocator and SimplePointInAreaLocator.

Write-up + table: jts-1145-pip-lane (corpus PR #451)
Harness: dotnet run --project tests/Discussion839Mre -c Release -- --jts1145

Results (14/14)

Case Point Geometric GT YStripes
Diamond generic (0, 0.5) INTERIOR INTERIOR
Vertex graze (naive parity even) (0, 0) INTERIOR INTERIOR
Horizontal edge (naive parity odd) (−1, 1) on notch EXTERIOR EXTERIOR
Rect interior / edges INT / BOUNDARY match
Hot-pixel centre / bottom INT / BOUNDARY match
Spectre interior / reflex pocket (5, 0.5) / (3.5, 0.5) INT / EXT match
Hat interior / pocket (√3 APPROX WKT) INT / EXT match

Also bit-equal to Indexed and Simple on every row (no locator split).

Suggestion

AbstractPointInRingTest already covers comb / repeated pts / a few robust triangles. Adding the gallery WKT pins (especially diamond graze, horizontal-edge exterior, Spectre pocket) would lock both this locator and IndexedPointInAreaLocator against the classes that pure half-open ray parity gets wrong without special cases.

No objection on soundness from this corpus gate. Port risk residual: Java tip not executed under JVM here (C# line-faithful port + NTS CGAlgorithmsDD).

(Affiliation: NetTopologySuite.Proofs — formal companion, not a JTS committer review.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants