Skip to content

Union_all skips NaG, while intersection_all does not #37

@caspervdw

Description

@caspervdw

Compare:

line_1 = Geometry("LINESTRING(0 0, 2 2)")
line_2 = Geometry("LINESTRING(2 2, 3 3)")
union_all([[line_1, line_2, NaG]], axis=1).tolist()
[<pygeos.Geometry MULTILINESTRING ((0 0, 2 2), (2 2, 3 3))>]
intersection_all([[line_1, line_2, NaG]], axis=1).tolist()
[<pygeos.NaG>]

This is because union_all makes use of the UnaryUnion function from GEOS, while intersection_all uses the ufunc.reduce feature.

I guess the neatest would be adding a skipna kwarg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions