rapidsai / cuspatial

CUDA-accelerated GIS and spatiotemporal algorithms
https://docs.rapids.ai/api/cuspatial/stable/
Apache License 2.0
612 stars 154 forks source link

[BUG] Point-in-polygon Primitive Should be Consistent Over Boundary Condition #744

Open isVoid opened 2 years ago

isVoid commented 2 years ago

Describe the bug Consider two axis aligned rectangle:

[(-1.0, -1.0), (0.0, -1.0), (0.0, 1.0), (-1.0, 1.0)]
[(0.0, -1.0), (1.0, -1.0), (1.0, 1.0), (0.0, 1.0)]

and a test point (0, 0).

Untitled Diagram (1)

This point is on the edge of these two rectangles. Is this point in the rectangle? The answer should only be always yes, or should be always no for both cases. Not yes for one and no for another.

Not yes for one and no for another. This is what's happening in current PIP kernel.

Steps/Code to reproduce bug See test: https://github.com/rapidsai/cuspatial/blob/930a2f33953ce1abe8f0680ebbf418675db4b362/cpp/tests/experimental/spatial/point_in_polygon_test.cu#L157

Expected behavior Result should either be b0000 or b1111. Better still, user definable on boundary conditions.

thomcom commented 1 year ago

I think that #750 fixes this.

harrism commented 1 year ago

No, the crossingsMultiply algorithm is fundamentally inconsistent. Working on it.