|
33 | 33 | points_geopandas_to_dask_dataframe, |
34 | 34 | ) |
35 | 35 | from spatialdata.models._utils import ValidAxis_t, get_spatial_axes |
| 36 | +from spatialdata.models.models import ATTRS_KEY |
36 | 37 | from spatialdata.transformations.operations import set_transformation |
37 | 38 | from spatialdata.transformations.transformations import ( |
38 | 39 | Affine, |
@@ -712,9 +713,13 @@ def _( |
712 | 713 | points_df = p.compute().iloc[bounding_box_indices] |
713 | 714 | old_transformations = get_transformation(p, get_all=True) |
714 | 715 | assert isinstance(old_transformations, dict) |
| 716 | + feature_key = p.attrs.get(ATTRS_KEY, {}).get(PointsModel.FEATURE_KEY) |
| 717 | + |
715 | 718 | output.append( |
716 | 719 | PointsModel.parse( |
717 | | - dd.from_pandas(points_df, npartitions=1), transformations=old_transformations.copy() |
| 720 | + dd.from_pandas(points_df, npartitions=1), |
| 721 | + transformations=old_transformations.copy(), |
| 722 | + feature_key=feature_key, |
718 | 723 | ) |
719 | 724 | ) |
720 | 725 | if len(output) == 0: |
@@ -925,10 +930,11 @@ def _( |
925 | 930 | queried_points = points_gdf.loc[joined["index_right"]] |
926 | 931 | ddf = points_geopandas_to_dask_dataframe(queried_points, suppress_z_warning=True) |
927 | 932 | transformation = get_transformation(points, target_coordinate_system) |
| 933 | + feature_key = points.attrs.get(ATTRS_KEY, {}).get(PointsModel.FEATURE_KEY) |
928 | 934 | if "z" in ddf.columns: |
929 | | - ddf = PointsModel.parse(ddf, coordinates={"x": "x", "y": "y", "z": "z"}) |
| 935 | + ddf = PointsModel.parse(ddf, coordinates={"x": "x", "y": "y", "z": "z"}, feature_key=feature_key) |
930 | 936 | else: |
931 | | - ddf = PointsModel.parse(ddf, coordinates={"x": "x", "y": "y"}) |
| 937 | + ddf = PointsModel.parse(ddf, coordinates={"x": "x", "y": "y"}, feature_key=feature_key) |
932 | 938 | set_transformation(ddf, transformation, target_coordinate_system) |
933 | 939 | t = get_transformation(ddf, get_all=True) |
934 | 940 | assert isinstance(t, dict) |
|
0 commit comments