File tree Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,7 @@ def from_dict(
715
715
716
716
if assets is not None :
717
717
for asset_key , asset_dict in assets .items ():
718
- collection .add_asset (asset_key , Asset (asset_dict ))
718
+ collection .add_asset (asset_key , Asset . from_dict (asset_dict ))
719
719
720
720
return collection
721
721
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " Collection" ,
3
+ "id" : " area-1-1" ,
4
+ "stac_version" : " 1.0.0-rc.4" ,
5
+ "description" : " test collection country-1" ,
6
+ "links" : [
7
+ {
8
+ "rel" : " root" ,
9
+ "href" : " ./multi-extent.json" ,
10
+ "type" : " application/json"
11
+ },
12
+ {
13
+ "rel" : " item" ,
14
+ "href" : " ./area-1-1-imagery/area-1-1-imagery.json" ,
15
+ "type" : " application/json"
16
+ },
17
+ {
18
+ "rel" : " item" ,
19
+ "href" : " ./area-1-1-labels/area-1-1-labels.json" ,
20
+ "type" : " application/json"
21
+ },
22
+ {
23
+ "rel" : " parent" ,
24
+ "href" : " ../catalog.json" ,
25
+ "type" : " application/json"
26
+ }
27
+ ],
28
+ "stac_extensions" : [],
29
+ "extent" : {
30
+ "spatial" : {
31
+ "bbox" : [
32
+ [
33
+ -2.5048828125 ,
34
+ 3.8916575492899987 ,
35
+ -1.9610595703125 ,
36
+ 4.275202171119132
37
+ ]
38
+ ]
39
+ },
40
+ "temporal" : {
41
+ "interval" : [
42
+ [
43
+ " 2019-10-04T18:55:37Z" ,
44
+ null
45
+ ]
46
+ ]
47
+ }
48
+ },
49
+ "license" : " proprietary" ,
50
+ "assets" : {
51
+ "thumbnail" : {
52
+ "title" : " thumbnail" ,
53
+ "href" : " http://example.com/thumbnail.png" ,
54
+ "media_type" : " image/png"
55
+ }
56
+ }
57
+ }
Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ def test_collection_with_href_caches_by_href(self) -> None:
175
175
# cached only by HREF
176
176
self .assertEqual (len (cache .id_keys_to_objects ), 0 )
177
177
178
+ def test_assets (self ) -> None :
179
+ path = TestCases .get_path ("data-files/collections/with-assets.json" )
180
+ with open (path ) as f :
181
+ data = json .load (f )
182
+ collection = pystac .read_dict (data )
183
+ collection .validate ()
184
+
178
185
179
186
class ExtentTest (unittest .TestCase ):
180
187
def test_spatial_allows_single_bbox (self ) -> None :
You can’t perform that action at this time.
0 commit comments