Skip to content

Commit 7d89adc

Browse files
author
Tom Augspurger
authored
Merge pull request #98 from fnattino/fix/application-xml
add "application/xml" to dictionary of drivers
2 parents 8daedf2 + bf30daf commit 7d89adc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

intake_stac/catalog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'image/x.geotiff': 'rasterio',
2828
'image/tiff; application=geotiff': 'rasterio',
2929
'image/tiff; application=geotiff; profile=cloud-optimized': 'rasterio', # noqa: E501
30+
'image/tiff': 'rasterio',
3031
'image/jp2': 'rasterio',
3132
'image/png': 'xarray_image',
3233
'image/jpg': 'xarray_image',
@@ -37,6 +38,7 @@
3738
'application/json': 'textfiles',
3839
'application/geo+json': 'geopandas',
3940
'application/geopackage+sqlite3': 'geopandas',
41+
'application/xml': 'textfiles',
4042
}
4143

4244

intake_stac/tests/test_catalog.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from intake.catalog.local import LocalCatalogEntry
1111

1212
from intake_stac import StacCatalog, StacCollection, StacItem, StacItemCollection
13-
from intake_stac.catalog import CombinedAssets, StacAsset
13+
from intake_stac.catalog import CombinedAssets, StacAsset, drivers
1414

1515
here = Path(__file__).parent
1616

@@ -238,6 +238,19 @@ def test_asset_unknown_type(self, pystac_item):
238238
assert d['plugin'] == ['rasterio']
239239

240240

241+
class TestDrivers:
242+
def test_drivers_include_all_pystac_media_types(self):
243+
for media_type in pystac.MediaType:
244+
assert media_type in drivers
245+
246+
def test_drivers_can_open_all_earthsearch_sentinel_s2_l2a_cogs_assets(self):
247+
test_file = os.path.join(here, 'data/1.0.0beta2/earthsearch/single-file-stac.json')
248+
catalog = intake.open_stac_item_collection(test_file)
249+
_, item = next(catalog.items())
250+
for _, asset in item.items():
251+
assert asset.metadata['type'] in drivers
252+
253+
241254
def test_cat_to_geopandas(pystac_itemcol):
242255
nfeatures = len(pystac_itemcol)
243256
geopandas = pytest.importorskip('geopandas')

0 commit comments

Comments
 (0)