Example #1
0
    def set_root(self, root: Optional["Catalog"]) -> None:
        STACObject.set_root(self, root)
        if root is not None:
            root._resolved_objects = ResolvedObjectCache.merge(
                root._resolved_objects, self._resolved_objects
            )

            # Walk through resolved object links and update the root
            for link in self.links:
                if link.rel == pystac.RelType.CHILD or link.rel == pystac.RelType.ITEM:
                    target = link.target
                    if isinstance(target, STACObject):
                        target.set_root(root)
Example #2
0
 def set_root(self, root, link_type=LinkType.ABSOLUTE):
     STACObject.set_root(self, root, link_type)
     if root is not None:
         root._resolved_objects = ResolvedObjectCache.merge(
             root._resolved_objects, self._resolved_objects)