pc module¶
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. |
Source code in leafmap/pc.py
51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
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 |
---|---|
pystac.Item: The first item in the collection. |
Source code in leafmap/pc.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
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. |
Source code in leafmap/pc.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
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. |
Source code in leafmap/pc.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
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. |
Source code in leafmap/pc.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|