pc module¶
leafmap.pc
¶
A module for Microsoft Planetary Computer (PC).
get_bands(collection, item=None)
¶
Get the bands of an item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
str
|
The collection the item is in. |
required |
item
|
str
|
The item to get the bands of. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List[str]
|
A list of bands. |
get_first_item(collection, return_id=False)
¶
Get the first item in a collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
str
|
The collection to get the first item from. |
required |
return_id
|
bool
|
If True, return the item's ID instead of the item itself. |
False
|
Returns:
| Type | Description |
|---|---|
Union[str, Item]
|
pystac.Item: The first item in the collection. |
get_pc_collection_list()
¶
Get a list of collections in the Microsoft Planetary Computer catalog.
Returns:
| Name | Type | Description |
|---|---|---|
list |
List[str]
|
A list of collections. |
get_pc_collections(verbose=False)
¶
Get a list of all collections in the Microsoft Planetary Computer catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
If True, print the collections to the console. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, str]
|
A dictionary with collections IDs as keys and cllection titles as value. |
get_pc_inventory(refresh=False, verbose=False)
¶
Get the inventory of the Microsoft Planetary Computer catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
refresh
|
bool
|
If True, refresh the inventory. |
False
|
verbose
|
bool
|
If True, print the collections to the console. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, dict[str, Union[str, list, str]]]
|
A dictionary of collections and their bands. |