Skip to content

Allow booleanWithin to support MultiLineString and MultiPolygon #2975

@blchelle

Description

@blchelle

Currently both MultiLineString and MultiPolygon are unsupported feature types for the booleanWithin function. However, I it should be possible to do some level of comparison for both of them.

For MultiLineString:

  • Cannot be within Point, MultiPoint.
  • Can be within LineString, MultiLineString. Here is an example of a MultiLineString being within a LineString.
    • For this I imagine a function isMultiLineOnLine which essentially just flattens the MultiLine into an array of Lines and then calls isLineOnLine for all of these lines and returns true if and only if all the flattened lines are on the comparison line.
  • Can be within Polygon, MultiPolygon
    • For this I imagine a function isMultiLineInPoly which essentially just flattens the MultiLine into an array of Lines and then calls isLineInPoly for all of these lines and returns true if and only if all the flattened lines are in the comparison polygon.

For MultiPolygon

  • Cannot be within Point, MultPoint
  • Cannot be within LineString, MultiLineString
  • Can be within Polygon, MultiPolygon. Here is an example of a MultiPolygon being within a Polygon
    • For this I imagine a function isMultiPolyInPoly which essentially just flattens the MultiPolygon into an array of Polygons and then calls isPolyInPoly for all of these polygons and returns true if and only if all the flattened polygons are in the comparison polygon.

I am happy to implement this, I just wanted to check with the core maintainers to see if they agree with this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions