Test aggregation when shapes touch but not overlap

Open Beginner friendly
#301 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
data, testing

Research direction

Start in spatialdata/_core/operations/aggregate.py around line 427 and inspect the overlay() and sjoin() aggregation paths. Add coverage for squares that touch by a side or vertex without overlapping, verify the overlay warning is gone, and document the current sjoin() behavior through the tests.

Written by the indexing model from the issue text.

Description

method: aggregation 🔢 needs: triage priority: medium

Test the case when two squares (one in shapes and one in by) touch in a side or a vertex but not overlap.

For the overlay() case we will get the following warning:

/Users/macbook/embl/projects/basel/spatialdata/src/spatialdata/_core/operations/aggregate.py:427: UserWarning: `keep_geom_type=True` in overlay resulted in 1 dropped geometries of different geometry types than df1 has. Set `keep_geom_type=False` to retain all geometries
  overlayed = gpd.overlay(by, values, how="intersection")

The solution is to set keep_geom_type=True in overlay (currently is None, which behaves like keep_geom_type=True but gives a warning).

We need to check what currently happens in the sjoin() case.

Dominant language
Python
Stars
394
Forks
95
Avg merge
3d 9h
Merged PRs (30d)
5

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.

More from scverse/spatialdata

All issues in scverse/spatialdata

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.