Skip to content

Handle GEOS errors on geometry constructors #306

@caspervdw

Description

@caspervdw

Box fails if the second or third coordinates are NaN.

Steps to reproduce:

In [1]: import pygeos
In [5]: pygeos.box(1, 1, 2, float("nan"))                                                                                                                          
Out[5]: <pygeos.Geometry POLYGON ((2 1, 2 nan, 1 nan, 1 1, 2 1))>
In [6]: pygeos.box(float("nan"), 1, 2, 2)                                                                                                                          
Out[6]: <pygeos.Geometry POLYGON ((2 1, 2 2, nan 2, nan 1, 2 1))>
In [7]: pygeos.box(1, float("nan"), 2, 2)                                                                                                                          
Segmentation fault (core dumped)
In [2]: pygeos.box(1, 1, float("nan"), 2)                                                                                                                          
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions