Skip to content

Handling of empty geometries #29

@jorisvandenbossche

Description

@jorisvandenbossche

Related to https://github.com/caspervdw/pygeos/issues/28 about missing values and the discussion in geopandas/geopandas#1062.
But even when we split missing values as a separate concept, there are still some potential pitfalls and corner cases regarding empty geometries itself (as I experienced on that geopandas PR).

Currently, there is a pygeos.Empty "singleton" defined as an empty GeometryCollection:

https://github.com/caspervdw/pygeos/blob/de5ed5c5f0a55bf471531e328d1a1b0476bcafd2/src/ufuncs.c#L1213-L1216

However, GEOS has also the notion of eg empty polygons.
See shapely/shapely#742 for some discussion in Shapely about this.

Having a more consistent empty handling as Shapely would be nice, but we might need to consider the potential consequences. Eg I remember that some file formats are strict regarding only allowing a single geometry type in a single column (eg only (multi)polygons). It might be that then an empty geometrycollection instead of empty polygon can give problems (purely hypothetical, didn't check it).

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