File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -939,8 +939,8 @@ def full_copy(
939
939
return cast (Catalog , super ().full_copy (root , parent ))
940
940
941
941
@classmethod
942
- def from_file (cls , href : str ) -> "Catalog" :
943
- result = super ().from_file (href )
942
+ def from_file (cls , href : str , stac_io : Optional [ pystac . StacIO ] = None ) -> "Catalog" :
943
+ result = super ().from_file (href , stac_io )
944
944
if not isinstance (result , Catalog ):
945
945
raise pystac .STACTypeError (f"{ result } is not a { Catalog } ." )
946
946
return result
Original file line number Diff line number Diff line change @@ -749,8 +749,10 @@ def full_copy(
749
749
return cast (Collection , super ().full_copy (root , parent ))
750
750
751
751
@classmethod
752
- def from_file (cls , href : str ) -> "Collection" :
753
- result = super ().from_file (href )
752
+ def from_file (
753
+ cls , href : str , stac_io : Optional [pystac .StacIO ] = None
754
+ ) -> "Collection" :
755
+ result = super ().from_file (href , stac_io )
754
756
if not isinstance (result , Collection ):
755
757
raise pystac .STACTypeError (f"{ result } is not a { Collection } ." )
756
758
return result
Original file line number Diff line number Diff line change @@ -973,8 +973,8 @@ def full_copy(
973
973
return cast (Item , super ().full_copy (root , parent ))
974
974
975
975
@classmethod
976
- def from_file (cls , href : str ) -> "Item" :
977
- result = super ().from_file (href )
976
+ def from_file (cls , href : str , stac_io : Optional [ pystac . StacIO ] = None ) -> "Item" :
977
+ result = super ().from_file (href , stac_io )
978
978
if not isinstance (result , Item ):
979
979
raise pystac .STACTypeError (f"{ result } is not a { Item } ." )
980
980
return result
Original file line number Diff line number Diff line change @@ -453,9 +453,8 @@ def from_file(
453
453
454
454
if not is_absolute_href (href ):
455
455
href = make_absolute_href (href )
456
- d = stac_io .read_json (href )
457
456
458
- o = stac_io .stac_object_from_dict ( d , href , None )
457
+ o = stac_io .read_stac_object ( href )
459
458
460
459
# Set the self HREF, if it's not already set to something else.
461
460
if o .get_self_href () is None :
You can’t perform that action at this time.
0 commit comments