Skip to content

Commit 3875c45

Browse files
committed
README updates
1 parent a969cf9 commit 3875c45

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,38 @@ $ stac-client search --url https://earth-search.aws.element84.com/v0 -c sentinel
3030
1999 items matched
3131
```
3232

33+
The `--matched` switch performs a search with limit=0 so does not get any Items, but gets the total number of
34+
matches which will be output to the screen.
35+
3336
The environment variable `STAC_URL` can be set instead of having to explicitly set the Catalog URL with every call:
3437

3538
```
3639
$ export STAC_URL=https://earth-search.aws.element84.com/v0
37-
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31
40+
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 --matched
3841
48 items matched
3942
```
4043

41-
The CLI performs a search with limit=0 so does not get any Items, it only gets the count. To fetch the items use one or both of the `--stdout` or `--save` switches.
42-
43-
Specifying `--stdout` will fetch all items, paginating if necessary. If `max_items` is provided it will stop paging once that many items has been retrieved. It then prints all items to stdout as an ItemCollection. This can be useful to pipe output to another process such as [stac-terminal](https://github.com/stac-utils/stac-terminal), [geojsonio-cli](https://github.com/mapbox/geojsonio-cli), or [jq](https://stedolan.github.io/jq/).
44+
Without the `--matched` switch, all items will be fetched, paginating if necessary. If `max_items` is provided
45+
it will stop paging once that many items has been retrieved. It then prints all items to stdout as an ItemCollection.
46+
This can be useful to pipe output to another process such as [stac-terminal](https://github.com/stac-utils/stac-terminal),
47+
[geojsonio-cli](https://github.com/mapbox/geojsonio-cli), or [jq](https://stedolan.github.io/jq/).
4448

4549
```
46-
$ stac-client search --stdout -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 | stacterm cal --label platform
50+
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 | stacterm cal --label platform
4751
```
4852

4953
![](docs/source/images/stacterm-cal.png)
5054

51-
The `--save` switch will save all fetched items (as with `--stdout`) to a file.
55+
If the `--save` switch is provided instead, the results will not be output to stdout, but instead will be saved to
56+
the specified file.
5257

5358
```
5459
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 --save items.json
5560
```
5661

57-
If the Catalog supports the [Query extension](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query), any Item property can also be included in the search. Rather than requiring the JSON syntax the Query extension uses, pystac-client uses a simpler syntax that it will translate to the JSON equivalent.
62+
If the Catalog supports the [Query extension](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query),
63+
any Item property can also be included in the search. Rather than requiring the JSON syntax the Query extension uses,
64+
pystac-client uses a simpler syntax that it will translate to the JSON equivalent.
5865

5966
```
6067
<property><operator><value>
@@ -71,7 +78,7 @@ view:sun_elevation<20
7178
Any number of properties can be included, and each can be included more than once to use additional operators.
7279

7380
```
74-
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 -q "eo:cloud_cover<10"
81+
$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 -q "eo:cloud_cover<10" --matched
7582
10 items matched
7683
```
7784

0 commit comments

Comments
 (0)