Skip to content

Commit 5670075

Browse files
committed
small cleanup: no random renaming of geometry column
1 parent 8b6a79f commit 5670075

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

openeo/extra/stac_job_db.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ def series_from(item):
6464

6565

6666
# Convert geojson geom into shapely.Geometry
67-
6867
item_dict["properties"]["geometry"] = shape(item_dict["geometry"])
69-
item_dict["properties"]["name"] = item_id
68+
#item_dict["properties"]["name"] = item_id
7069
return pd.Series(item_dict["properties"], name=item_id)
7170

7271
@staticmethod
73-
def item_from(series, geometry_name="geometry"):
72+
def item_from(series: pd.Series, geometry_name="geometry"):
7473
"""
7574
Convert a pandas.Series to a STAC Item.
7675
@@ -98,8 +97,7 @@ def item_from(series, geometry_name="geometry"):
9897
del series_dict[geometry_name]
9998

10099
# from_dict handles associating any Links and Assets with the Item
101-
item_dict['id'] = series['name']
102-
del series_dict['name']
100+
item_dict['id'] = series.name
103101
item = pystac.Item.from_dict(item_dict)
104102
item.bbox = series[geometry_name].bounds
105103
return item
@@ -134,7 +132,7 @@ def get_by_status(self, statuses: List[str], max=None) -> pd.DataFrame:
134132
gdf = gpd.GeoDataFrame(series, crs=crs)
135133
# TODO how to know the proper name of the geometry column?
136134
# this only matters for the udp based version probably
137-
gdf.rename_geometry("polygon", inplace=True)
135+
#gdf.rename_geometry("polygon", inplace=True)
138136
return gdf
139137

140138

0 commit comments

Comments
 (0)