File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -82,14 +82,13 @@ def get_href(self):
82
82
else :
83
83
href = self .target
84
84
85
- if href and self .owner is not None :
86
- rel_links = HIERARCHICAL_LINKS + pystac .STAC_EXTENSIONS .get_extended_object_links (self .owner )
85
+ if href and is_absolute_href (href ) and self .owner and self .owner .get_root ():
86
+ root = self .owner .get_root ()
87
+ rel_links = HIERARCHICAL_LINKS + \
88
+ pystac .STAC_EXTENSIONS .get_extended_object_links (self .owner )
87
89
# if a hierarchical link with an owner and root, and relative catalog
88
- if self .rel in rel_links :
89
- root = self .owner .get_root ()
90
- if root is not None and root .catalog_type in ['RELATIVE_PUBLISHED' , 'SELF_CONTAINED' ]:
91
- if href and is_absolute_href (href ):
92
- href = make_relative_href (href , self .owner .get_self_href ())
90
+ if root .is_relative () and self .rel in rel_links :
91
+ href = make_relative_href (href , self .owner .get_self_href ())
93
92
94
93
return href
95
94
You can’t perform that action at this time.
0 commit comments