Skip to content

booleanContains does not align with DE9-IM behaviour for Polygons containing MultiPoints #3025

@smallsaucepan

Description

@smallsaucepan

When determining if a polygon contains a multipoint only one point of the multipoint needs to intersect with the interior of the polygon. The other points can be located on the boundary of the polygon.

The current implementation of booleanContains insists every point of the multipoint intersects with the interior of the polygon, which is incorrect.

Example:

{
  "type": "Polygon",
  "coordinates": [
    [
      [0, 0],
      [1, 0],
      [1, 1],
      [0, 1],
      [0, 0]
    ]
  ]
}
{
  "type": "MultiPoint",
  "coordinates": [
    [0.5, 0.5],
    [1, 1]
  ]
}
Image

Currently returns false, even though the conditions are met by the interior of the polygon being intersected by at least one point of the multipoint's interior. References https://en.wikipedia.org/wiki/DE-9IM:

$$\begin{bmatrix} T & * & * \\\ * & * & * \\\ F & F & * \end{bmatrix}$$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions