Skip to content

chore(geopandas): Add more edge cases to the test_match_geopandas_series.py suite #2392

@petern48

Description

@petern48

test_match_geopandas_series.py is where we compare that our results match the results of geopandas. We reuse the same lists of geometries (e.g self.linestrings, self.geoms, etc) in nearly every test. I wrote these cases very early and failed to consider various edge cases. In this issue, I'd like to add some test cases to these lists (e.g self.linestrings). I wouldn't be surprised if we fail some of these.

Here are the edge cases I think we should add. I think each of these should be their own PR, since it's possible that they cause test failures and require us to modify the implementation of existing sedona geopandas functions.

  • empty geometries (e.g POINT EMPTY)
  • non-valid polygons (e.g POLYGON((0 0, 0 1, 2 1, 2 2, 1 2, 1 0, 0 0)), see here to learn about validity)
  • GeometryCollections cases (apparently, there's only one case at the moment...)
    • geom with only empty geometries
    • geom collection w/ only a single geom (e.g is_closed only applies to linestrings, should it return true for this GeomCol (< a single closed linestring >)?
  • Z and M dimensions for everything
  • Other geometry types that Sedona doesn't support (e.g LinearRing, box)

Here's an example of the current cases (and hence where we would need to add more cases).

self.points = [Point(x, x + 1) for x in range(3)]
self.multipoints = [MultiPoint([(x, x + 1), (x + 2, x + 3)]) for x in range(3)]
self.linestrings = [LineString([(x, x + 1), (x + 2, x + 3)]) for x in range(3)]
self.linearrings = [
LinearRing([(x, x), (x + 1, x), (x + 1, x + 1), (x, x + 1), (x, x)])
for x in range(3)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions