Skip to content

Commit bf3377f

Browse files
Bugfixes (#393)
1 parent 0446eff commit bf3377f

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/spatialdata/_core/query/relational_query.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def _filter_table_by_elements(
102102
indices = ((table.obs[region_key] == name) & (table.obs[instance_key].isin(instances))).to_numpy()
103103
to_keep = to_keep | indices
104104
original_table = table
105+
table.obs = pd.DataFrame(table.obs)
105106
table = table[to_keep, :]
106107
if match_rows:
107108
assert instances is not None

‎src/spatialdata/_core/query/spatial_query.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ def polygon_query(
687687
"""
688688
from spatialdata._core.query.relational_query import _filter_table_by_elements
689689

690+
# adjust coordinate transformation (this implementation can be made faster)
691+
sdata = sdata.transform_to_coordinate_system(target_coordinate_system)
692+
690693
if isinstance(polygons, Polygon):
691694
polygons = [polygons]
692695

0 commit comments

Comments
 (0)