Example #1
0
 def create_year_catalogs(self, year_list, ds_name):
     for year in year_list:
         year_catalog = Catalog({
             "id":
             year,
             "stac_version":
             "0.7.0",
             "description":
             "Data acquired during the year {}".format(year)
         })
         cat = Catalog.open(os.path.join(self.root, ds_name,
                                         'catalog.json'))
         cat.add_catalog(year_catalog)
         cat.save()
Example #2
0
 def test_init(self):
     with open(os.path.join(testpath, 'catalog/catalog.json')) as f:
         data = json.loads(f.read())
     cat = Catalog(data)
     assert (cat.id == 'stac')
Example #3
0
 def create_datasource_catalog(self, ds_name):
     cat = Catalog.open(os.path.join(self.root, 'catalog.json'))
     ds_cat = Catalog(datasource_catalogs[ds_name])
     cat.add_catalog(ds_cat)
     cat.save()
Example #4
0
 def create_root_catalog(self):
     cat = Catalog(cat_json, root=self.root)
     cat.save_as(os.path.join(self.root, 'catalog.json'))