-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Fanevanjanahary/stac_api_list
add list of populate stac api
- Loading branch information
Showing
6 changed files
with
104 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CATALOGS = [ | ||
{ | ||
"id": "07e3e9dd-cbad-4cf6-8336-424b88abf8f3", | ||
"name": "Microsoft Planetary Computer STAC API", | ||
"url": "https://planetarycomputer.microsoft.com/api/stac/v1", | ||
"selected": True, | ||
}, | ||
{ | ||
"id": "d74817bf-da1f-44d7-a464-b87d4009c8a3", | ||
"name": "Earth Search", | ||
"url": "https://earth-search.aws.element84.com/v0", | ||
"selected": False, | ||
}, | ||
{ | ||
"id": "aff201e0-58aa-483d-9e87-090c8baecd3c", | ||
"name": "Digital Earth Africa", | ||
"url": "https://explorer.digitalearth.africa/stac/", | ||
"selected": False, | ||
}, | ||
{ | ||
"id": "98c95473-9f32-4947-83b2-acc8bbf71f36", | ||
"name": "Radiant MLHub", | ||
"url": "https://api.radiant.earth/mlhub/v1/", | ||
"selected": False, | ||
}, | ||
{ | ||
"id": "17a79ce2-9a61-457d-926f-03d37c0606b6", | ||
"name": "NASA CMR STAC", | ||
"url": "https://cmr.earthdata.nasa.gov/stac", | ||
"selected": False, | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Plugin utilities | ||
""" | ||
import uuid | ||
|
||
from .conf import ( | ||
ConnectionSettings, | ||
settings_manager | ||
) | ||
|
||
from .definitions.catalog import CATALOGS | ||
|
||
|
||
def config_defaults_catalogs(): | ||
""" Initialize the plugin connections settings with the default | ||
catalogs and set the current connection active. | ||
""" | ||
|
||
for catalog in CATALOGS: | ||
connection_id = uuid.UUID(catalog['id']) | ||
if not settings_manager.is_connection( | ||
connection_id | ||
): | ||
connection_settings = ConnectionSettings( | ||
id=connection_id, | ||
name=catalog['name'], | ||
url=catalog['url'], | ||
page_size=5, | ||
auth_config=None, | ||
) | ||
settings_manager.save_connection_settings(connection_settings) | ||
|
||
if catalog['selected']: | ||
settings_manager.set_current_connection(connection_id) | ||
|
||
settings_manager.set_value("default_catalogs_set", True) |