Skip to content

Failures with GEOS master / 3.10 #233

@jorisvandenbossche

Description

@jorisvandenbossche

I was testing with GEOS master (in light of the new OverlayNG), and next to 2 failures related to the new overlay implementation (which I am fixing in #232), there are also 2 other failures:

_______________________________________ test_points_invalid_ndim ________________________________________

    def test_points_invalid_ndim():
        with pytest.raises(pygeos.GEOSException):
>           pygeos.points([0, 1, 2, 3])
E           Failed: DID NOT RAISE <class 'pygeos.GEOSException'>

pygeos/test/test_creation.py:41: Failed
_______________________________________ test_from_wkb_empty[POLYGON EMPTY] _____________________________

wkt = 'POLYGON EMPTY'

    @pytest.mark.parametrize(
        "wkt", ("POINT EMPTY", "LINESTRING EMPTY", "POLYGON EMPTY", "GEOMETRYCOLLECTION EMPTY")
    )
    def test_from_wkb_empty(wkt):
        wkb = pygeos.to_wkb(pygeos.Geometry(wkt))
        geom = pygeos.from_wkb(wkb)
        assert pygeos.is_geometry(geom).all()
        assert pygeos.is_empty(geom).all()
>       assert pygeos.to_wkb(geom) == wkb
E       AssertionError: assert b'\x01\x03\x0...0\x00\x00\x00' == b'\x01\x03\x0...0\x00\x00\x00'
E         At index 4 diff: b'\x80' != b'\x00'
E         Use -v to get the full diff

pygeos/test/test_io.py:121: AssertionError

The first case now seems to ignore the 4th dimension, and create a POINT Z:

(Pdb) pygeos.points([0, 1, 2, 3])
<pygeos.Geometry POINT Z (0 1 2)>

In the second case, the WKB of an empty polygon differs depending on whether the empty polygon was created from WKT or WKB:

(Pdb) geom1 = pygeos.Geometry("POLYGON EMPTY")
(Pdb) geom1
<pygeos.Geometry POLYGON EMPTY>
(Pdb) pygeos.to_wkb(geom1)
b'\x01\x03\x00\x00\x00\x00\x00\x00\x00'
(Pdb) geom2 = pygeos.from_wkb(pygeos.to_wkb(geom1))
(Pdb) geom2
<pygeos.Geometry POLYGON EMPTY>
(Pdb) pygeos.to_wkb(geom2)
b'\x01\x03\x00\x00\x80\x00\x00\x00\x00'

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