Skip to content

Commit daadf9b

Browse files
committed
feat: item
1 parent 70c35bc commit daadf9b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/pystac/item.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def get_assets(
142142
)
143143

144144
def make_asset_hrefs_relative(self) -> None:
145-
if self_href := self.get_self_href():
146-
for asset in self.assets.values():
147-
pass
145+
if self.get_self_href():
146+
# TODO actually implement
147+
pass
148148
else:
149149
raise ValueError(
150150
"Cannot make asset hrefs relative, item does not have a self href"
@@ -170,6 +170,8 @@ def get_collection(self) -> Collection | None:
170170
# TODO can we just make get_target just take a STACObject?
171171
stac_object = collection_link.get_target(self.get_self_href(), self.reader)
172172
if isinstance(stac_object, Collection):
173+
if root := self.get_root():
174+
stac_object.set_root(root)
173175
self._collection = stac_object
174176
return stac_object
175177
else:
@@ -195,6 +197,7 @@ def collection_id(self) -> str | None:
195197

196198
def set_collection(self, collection: Collection | str | None) -> None:
197199
self._collection = collection
200+
self.remove_links("collection")
198201

199202
@override
200203
def to_dict(

0 commit comments

Comments
 (0)