Skip to content

BUG: passing geometries of wrong type to constructive functions gives segfault #74

@jorisvandenbossche

Description

@jorisvandenbossche

At least noticed this with pygeos.multipolygons when passing points or polygons:

In [2]: a = pygeos.points(np.arange(10), np.arange(10)) 

In [3]: a
Out[3]: 
array([<pygeos.Geometry POINT (0 0)>, <pygeos.Geometry POINT (1 1)>,
       <pygeos.Geometry POINT (2 2)>, <pygeos.Geometry POINT (3 3)>,
       <pygeos.Geometry POINT (4 4)>, <pygeos.Geometry POINT (5 5)>,
       <pygeos.Geometry POINT (6 6)>, <pygeos.Geometry POINT (7 7)>,
       <pygeos.Geometry POINT (8 8)>, <pygeos.Geometry POINT (9 9)>],
      dtype=object)

In [4]: pygeos.points(a) 
...
TypeError: ufunc 'points' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

In [5]: pygeos.multipolygons(a) 
Out[5]: Segmentation fault (core dumped)

Passing those to pygeos.multipoints correctly creates a MultiPoint geometry.

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