You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/api/sql/Stac.md
+150
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,156 @@ In this example, the data source will push down the temporal filter to the under
146
146
147
147
In this example, the data source will push down the spatial filter to the underlying data source.
148
148
149
+
# Python API
150
+
151
+
The Python API allows you to interact with a SpatioTemporal Asset Catalog (STAC) API using the Client class. This class provides methods to open a connection to a STAC API, retrieve collections, and search for items with various filters.
152
+
153
+
## Client Class
154
+
155
+
## Methods
156
+
157
+
### `open(url: str) -> Client`
158
+
159
+
Opens a connection to the specified STAC API URL.
160
+
161
+
**Parameters:**
162
+
163
+
-`url` (*str*): The URL of the STAC API to connect to.
Searches for items in the specified collection with optional filters.
190
+
191
+
**Parameters:**
192
+
193
+
-`ids` (*Union[str, list]*): A variable number of item IDs to filter the items.
194
+
**Example:**`"item_id1"` or `["item_id1", "item_id2"]`
195
+
-`collection_id` (*str*): The ID of the collection to search in.
196
+
**Example:**`"aster-l1t"`
197
+
-`bbox` (*Optional[list]*): A list of bounding boxes for filtering the items. Each bounding box is represented as a list of four float values: `[min_lon, min_lat, max_lon, max_lat]`.
198
+
**Example:**`[[ -180.0, -90.0, 180.0, 90.0 ]]`
199
+
-`datetime` (*Optional[Union[str, datetime.datetime, list]]*): A single datetime, RFC 3339-compliant timestamp, or a list of date-time ranges for filtering the items.
These examples demonstrate how to use the Client class to search for items in a STAC collection with various filters and return the results as either an iterator of PyStacItem objects or a Spark DataFrame.
0 commit comments