scverse / scverse/spatialdata

Aggregation and multipolygons

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

method: aggregation 🔢
Dominant language
Python
Stars
394
Forks
95
Avg merge
4d 3h
Merged PRs (30d)
7

Description

We need to handle how multipolygons interact with the aggergation functions. In particular:

  • having multipolygons in by and values. Notice that a Shapes GeoDataFrame could contain some rows that are Polygon and other that are Multipolygons, as discussed here: https://github.com/scverse/spatialdata/issues/214
  • sjoin() could return Polygons, but also Multipolygons; this happens when a polygon is intersecting the same shape in multiple parts that are disjoints. Notice that when the same polygon intersects multiple polygons, this does not return a Multipolygon, but multiple rows (that can be polygons or multipolygons), this case is discussed here: https://github.com/scverse/spatialdata/issues/211

We need to add tests for the above cases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the aggregation functions and the sjoin() entry point, then review how Polygon and Multipolygon rows are handled in by, values, and spatial-join results. Add tests covering mixed Polygon/Multipolygon inputs and disjoint intersections, including the cases described in issues 211 and 214; done means these cases are handled and the tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.