@@ -10,52 +10,6 @@ use stac_duckdb::Client;
1010use std:: str:: FromStr ;
1111use tokio:: runtime:: Builder ;
1212
13- /// Searches a STAC API server.
14- ///
15- /// Args:
16- /// href (str): The STAC API to search.
17- /// intersects (str | dict[str, Any] | GeoInterface | None): Searches items
18- /// by performing intersection between their geometry and provided GeoJSON
19- /// geometry.
20- /// ids (list[str] | None): Array of Item ids to return.
21- /// collections (list[str] | None): Array of one or more Collection IDs that
22- /// each matching Item must be in.
23- /// max_items (int | None): The maximum number of items to iterate through.
24- /// limit (int | None): The page size returned from the server. Use
25- /// `max_items` to actually limit the number of items returned from this
26- /// function.
27- /// bbox (list[float] | None): Requested bounding box.
28- /// datetime (str | None): Single date+time, or a range (‘/’ separator),
29- /// formatted to RFC 3339, section 5.6. Use double dots .. for open
30- /// date ranges.
31- /// include (list[str]] | None): fields to include in the response (see [the
32- /// extension
33- /// docs](https://github.com/stac-api-extensions/fields?tab=readme-ov-file#includeexclude-semantics))
34- /// for more on the semantics).
35- /// exclude (list[str]] | None): fields to exclude from the response (see [the
36- /// extension
37- /// docs](https://github.com/stac-api-extensions/fields?tab=readme-ov-file#includeexclude-semantics))
38- /// for more on the semantics).
39- /// sortby (list[str] | None): Fields by which to sort results (use `-field` to sort descending).
40- /// filter (str | dict[str, Any] | none): CQL2 filter expression. Strings
41- /// will be interpreted as cql2-text, dictionaries as cql2-json.
42- /// query (dict[str, Any] | None): Additional filtering based on properties.
43- /// It is recommended to use filter instead, if possible.
44- /// use_duckdb (bool | None): Query with DuckDB. If None and the href has a
45- /// 'parquet' or 'geoparquet' extension, will be set to True. Defaults
46- /// to None.
47- ///
48- /// Returns:
49- /// list[dict[str, Any]]: A list of the returned STAC items.
50- ///
51- /// Examples:
52- /// >>> items = stacrs.search(
53- /// ... "https://landsatlook.usgs.gov/stac-server",
54- /// ... collections=["landsat-c2l2-sr"],
55- /// ... intersects={"type": "Point", "coordinates": [-105.119, 40.173]},
56- /// ... sortby="-properties.datetime",
57- /// ... max_items=1,
58- /// ... )
5913#[ pyfunction]
6014#[ pyo3( signature = ( href, * , intersects=None , ids=None , collections=None , max_items=None , limit=None , bbox=None , datetime=None , include=None , exclude=None , sortby=None , filter=None , query=None , use_duckdb=None ) ) ]
6115pub fn search < ' py > (
@@ -96,57 +50,6 @@ pub fn search<'py>(
9650 . and_then ( |v| v. extract ( ) )
9751}
9852
99- /// Searches a STAC API server and saves the result to an output file.
100- ///
101- /// Args:
102- /// outfile (str): The output href. This can be a local file path, or any
103- /// url scheme supported by [stac::object_store::write].
104- /// href (str): The STAC API to search.
105- /// intersects (str | dict[str, Any] | GeoInterface | None): Searches items
106- /// by performing intersection between their geometry and provided GeoJSON
107- /// geometry.
108- /// ids (list[str] | None): Array of Item ids to return.
109- /// collections (list[str] | None): Array of one or more Collection IDs that
110- /// each matching Item must be in.
111- /// max_items (int | None): The maximum number of items to iterate through.
112- /// limit (int | None): The page size returned from the server. Use
113- /// `max_items` to actually limit the number of items returned from this
114- /// function.
115- /// bbox (list[float] | None): Requested bounding box.
116- /// datetime (str | None): Single date+time, or a range (‘/’ separator),
117- /// formatted to RFC 3339, section 5.6. Use double dots .. for open
118- /// date ranges.
119- /// include (list[str]] | None): fields to include in the response (see [the
120- /// extension
121- /// docs](https://github.com/stac-api-extensions/fields?tab=readme-ov-file#includeexclude-semantics))
122- /// for more on the semantics).
123- /// exclude (list[str]] | None): fields to exclude from the response (see [the
124- /// extension
125- /// docs](https://github.com/stac-api-extensions/fields?tab=readme-ov-file#includeexclude-semantics))
126- /// for more on the semantics).
127- /// sortby (list[str] | None): Fields by which to sort results (use `-field` to sort descending).
128- /// filter (str | dict[str, Any] | none): CQL2 filter expression. Strings
129- /// will be interpreted as cql2-text, dictionaries as cql2-json.
130- /// query (dict[str, Any] | None): Additional filtering based on properties.
131- /// It is recommended to use filter instead, if possible.
132- /// format (str | None): The output format. If none, will be inferred from
133- /// the outfile extension, and if that fails will fall back to compact JSON.
134- /// options (list[tuple[str, str]] | None): Configuration values to pass to the object store backend.
135- /// use_duckdb (bool | None): Query with DuckDB. If None and the href has a
136- /// 'parquet' or 'geoparquet' extension, will be set to True. Defaults
137- /// to None.
138- ///
139- /// Returns:
140- /// list[dict[str, Any]]: A list of the returned STAC items.
141- ///
142- /// Examples:
143- /// >>> items = stacrs.search_to("out.parquet",
144- /// ... "https://landsatlook.usgs.gov/stac-server",
145- /// ... collections=["landsat-c2l2-sr"],
146- /// ... intersects={"type": "Point", "coordinates": [-105.119, 40.173]},
147- /// ... sortby="-properties.datetime",
148- /// ... max_items=1,
149- /// ... )
15053#[ pyfunction]
15154#[ pyo3( signature = ( outfile, href, * , intersects=None , ids=None , collections=None , max_items=None , limit=None , bbox=None , datetime=None , include=None , exclude=None , sortby=None , filter=None , query=None , format=None , options=None , use_duckdb=None ) ) ]
15255pub fn search_to (
0 commit comments