Skip to content

Default axis of union_all #194

@jorisvandenbossche

Description

@jorisvandenbossche

Currently the union_all function has a default to union over axis 0:

def union_all(geometries, axis=0, **kwargs):
"""Returns the union of multiple geometries.
Parameters
----------
geometries : array_like
axis : int
Axis along which the operation is performed. The default (zero)
performs the operation over the first dimension of the input array.
axis may be negative, in which case it counts from the last to the
first axis.

I was wondering if axis=None wouldn't be a better default (in which case it always gives a single geometry by default, regardless of the shape of the array), since that is also the default of numpy reductions (eg sum). Or did we have a specific reason to have the axis=0 deviation?

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