Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support STAC 1.0 - part 0 #96

Merged
merged 14 commits into from
Jun 25, 2021
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
hooks:
- id: isort

- repo: https://github.com/prettier/prettier
rev: 2.0.5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.1
hooks:
- id: prettier
64 changes: 16 additions & 48 deletions examples/my-s2-l2a-cogs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200814_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.755863403460744,
34.79870551983084, -3.7056906919566326, 35.755863403460744,
-2.7110273448887328
],
"geometry": {
Expand Down Expand Up @@ -209,9 +207,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200809_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.76700629249285,
34.79870551983084, -3.7056906919566326, 35.76700629249285,
-2.7110017811328926
],
"geometry": {
Expand Down Expand Up @@ -411,9 +407,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200806_0_L2A",
"bbox": [
35.361851558698646,
-3.704366288842677,
35.78841174435426,
35.361851558698646, -3.704366288842677, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -613,9 +607,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200804_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.757300644517535,
34.79870551983084, -3.7056906919566326, 35.757300644517535,
-2.7110240533940337
],
"geometry": {
Expand Down Expand Up @@ -815,9 +807,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200801_0_L2A",
"bbox": [
35.354473584331565,
-3.704386009664254,
35.78841174435426,
35.354473584331565, -3.704386009664254, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -1018,9 +1008,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200730_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.7687137359457,
34.79870551983084, -3.7056906919566326, 35.7687137359457,
-2.7109978548485385
],
"geometry": {
Expand Down Expand Up @@ -1220,9 +1208,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200727_0_L2A",
"bbox": [
35.364731107030785,
-3.704358575275874,
35.78841174435426,
35.364731107030785, -3.704358575275874, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -1421,9 +1407,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200725_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.759906699226775,
34.79870551983084, -3.7056906919566326, 35.759906699226775,
-2.7110180807693265
],
"geometry": {
Expand Down Expand Up @@ -1623,9 +1607,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200722_0_L2A",
"bbox": [
35.356453603399366,
-3.704380723262607,
35.78841174435426,
35.356453603399366, -3.704380723262607, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -1823,9 +1805,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200720_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.77185877492271,
34.79870551983084, -3.7056906919566326, 35.77185877492271,
-2.710990616463335
],
"geometry": {
Expand Down Expand Up @@ -2023,9 +2003,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200717_0_L2A",
"bbox": [
35.36833009312432,
-3.704348921313967,
35.78841174435426,
35.36833009312432, -3.704348921313967, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -2223,9 +2201,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200715_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.762423439929975,
34.79870551983084, -3.7056906919566326, 35.762423439929975,
-2.7110123074852157
],
"geometry": {
Expand Down Expand Up @@ -2423,9 +2399,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200712_0_L2A",
"bbox": [
35.36185349129008,
-3.7043662836689135,
35.78841174435426,
35.36185349129008, -3.7043662836689135, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -2626,9 +2600,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200710_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.77024131589214,
34.79870551983084, -3.7056906919566326, 35.77024131589214,
-2.7109943401109917
],
"geometry": {
Expand Down Expand Up @@ -2829,9 +2801,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200707_0_L2A",
"bbox": [
35.363651831328085,
-3.704361467477506,
35.78841174435426,
35.363651831328085, -3.704361467477506, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -3028,9 +2998,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200702_0_L2A",
"bbox": [
35.356093300381986,
-3.704381685556869,
35.78841174435426,
35.356093300381986, -3.704381685556869, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down
4 changes: 3 additions & 1 deletion intake_stac/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ def _get_driver(self, asset):

if entry_type in ['', 'null', None]:

suffix = os.path.splitext(asset.media_type)[-1]
suffix = '.tif'
if asset.media_type:
suffix = os.path.splitext(asset.media_type)[-1]
if suffix in ['.nc', '.h5', '.hdf']:
asset.media_type = 'application/netcdf'
warnings.warn(
Expand Down
72 changes: 18 additions & 54 deletions intake_stac/tests/data/1.0.0beta2/earthsearch/single-file-stac.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200814_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.755863403460744,
34.79870551983084, -3.7056906919566326, 35.755863403460744,
-2.7110273448887328
],
"geometry": {
Expand Down Expand Up @@ -213,9 +211,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200811_0_L2A",
"bbox": [
35.3528545470006,
-3.704390328989478,
35.78841174435426,
35.3528545470006, -3.704390328989478, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -420,9 +416,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200809_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.76700629249285,
34.79870551983084, -3.7056906919566326, 35.76700629249285,
-2.7110017811328926
],
"geometry": {
Expand Down Expand Up @@ -622,9 +616,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200806_0_L2A",
"bbox": [
35.361851558698646,
-3.704366288842677,
35.78841174435426,
35.361851558698646, -3.704366288842677, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -824,9 +816,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200804_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.757300644517535,
34.79870551983084, -3.7056906919566326, 35.757300644517535,
-2.7110240533940337
],
"geometry": {
Expand Down Expand Up @@ -1026,9 +1016,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200801_0_L2A",
"bbox": [
35.354473584331565,
-3.704386009664254,
35.78841174435426,
35.354473584331565, -3.704386009664254, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -1229,9 +1217,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200730_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.7687137359457,
34.79870551983084, -3.7056906919566326, 35.7687137359457,
-2.7109978548485385
],
"geometry": {
Expand Down Expand Up @@ -1431,9 +1417,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200727_0_L2A",
"bbox": [
35.364731107030785,
-3.704358575275874,
35.78841174435426,
35.364731107030785, -3.704358575275874, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -1638,9 +1622,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200725_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.759906699226775,
34.79870551983084, -3.7056906919566326, 35.759906699226775,
-2.7110180807693265
],
"geometry": {
Expand Down Expand Up @@ -1840,9 +1822,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200722_0_L2A",
"bbox": [
35.356453603399366,
-3.704380723262607,
35.78841174435426,
35.356453603399366, -3.704380723262607, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -2048,9 +2028,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200720_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.77185877492271,
34.79870551983084, -3.7056906919566326, 35.77185877492271,
-2.710990616463335
],
"geometry": {
Expand Down Expand Up @@ -2256,9 +2234,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200717_0_L2A",
"bbox": [
35.36833009312432,
-3.704348921313967,
35.78841174435426,
35.36833009312432, -3.704348921313967, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -2470,9 +2446,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200715_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.762423439929975,
34.79870551983084, -3.7056906919566326, 35.762423439929975,
-2.7110123074852157
],
"geometry": {
Expand Down Expand Up @@ -2678,9 +2652,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200712_0_L2A",
"bbox": [
35.36185349129008,
-3.7043662836689135,
35.78841174435426,
35.36185349129008, -3.7043662836689135, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -2881,9 +2853,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200710_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.77024131589214,
34.79870551983084, -3.7056906919566326, 35.77024131589214,
-2.7109943401109917
],
"geometry": {
Expand Down Expand Up @@ -3084,9 +3054,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2B_36MYB_20200707_0_L2A",
"bbox": [
35.363651831328085,
-3.704361467477506,
35.78841174435426,
35.363651831328085, -3.704361467477506, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down Expand Up @@ -3291,9 +3259,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200705_0_L2A",
"bbox": [
34.79870551983084,
-3.7056906919566326,
35.762781954089746,
34.79870551983084, -3.7056906919566326, 35.762781954089746,
-2.7110114846428153
],
"geometry": {
Expand Down Expand Up @@ -3497,9 +3463,7 @@
"stac_extensions": ["eo", "view", "proj"],
"id": "S2A_36MYB_20200702_0_L2A",
"bbox": [
35.356093300381986,
-3.704381685556869,
35.78841174435426,
35.356093300381986, -3.704381685556869, 35.78841174435426,
-2.7109586089556537
],
"geometry": {
Expand Down
Loading