Skip to content

Commit 8f62ff0

Browse files
Merge pull request #106 from stac-utils/docs
more docs updates
2 parents 50e3717 + 2a7da0f commit 8f62ff0

File tree

7 files changed

+75
-21
lines changed

7 files changed

+75
-21
lines changed

.readthedocs.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,5 @@ formats:
1515
- pdf
1616
- htmlzip
1717

18-
# Optionally set the version of Python and requirements required to build your docs
19-
python:
20-
version: 3.8
21-
install:
22-
- method: pip
23-
path: .
24-
- requirements: requirements-docs.txt
18+
conda:
19+
environment: docs/environment.yml

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
)
6262
}
6363

64+
nbsphinx_allow_errors = True
65+
6466
# Add any paths that contain templates here, relative to this directory.
6567
templates_path = ['_templates']
6668

docs/environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: pystac-client-docs
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.8
7+
- pip:
8+
- -r ../requirements-docs.txt
9+
- -e ../

docs/quickstart.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ to the server as strings, except for ``gsd`` which it casts to
6161
properties these will be sent as strings. Some servers may automatically
6262
cast this to the appropriate data type, others may not.
6363

64+
The query filter will also accept complete JSON as per the specification.
65+
6466
::
6567

6668
<property><operator><value>

docs/tutorials.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ STAC Metadata Visualization
1515
---------------------------
1616

1717
- :tutorial:`GitHub version <stac-metadata-viz.ipynb>`
18-
- :ref:`Docs version </tutorials/stac-metadata-viz.ipynb>`
1918

2019
This tutorial gives an introduction to using Holeviews and hvplot to visualize
2120
STAC metadata and Item geometries on a map.
@@ -24,7 +23,6 @@ CQL Filtering
2423
---------------------------
2524

2625
- :tutorial:`GitHub version <cql-filter.ipynb>`
27-
- :ref:`Docs version </tutorials/cql-filter.ipynb>`
2826

2927
This tutorial gives an introduction to using CQL-JSON filtering in searches to
3028
search by arbitrary STAC Item properties.

docs/tutorials/stac-metadata-viz.ipynb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,43 @@
233233
"source": [
234234
"plot_polygons(aoi_gdf) * items_gdf.hvplot.paths(geo=True)"
235235
]
236+
},
237+
{
238+
"cell_type": "markdown",
239+
"id": "b0604c84",
240+
"metadata": {},
241+
"source": [
242+
"## Line Plots\n",
243+
"\n",
244+
"Numeric STAC metadata can also be plotted, most often this will be plotted vs the Item `datetime`."
245+
]
246+
},
247+
{
248+
"cell_type": "code",
249+
"execution_count": null,
250+
"id": "c198e261",
251+
"metadata": {},
252+
"outputs": [],
253+
"source": [
254+
"items_df = pd.DataFrame(items_gdf)\n",
255+
"\n",
256+
"plot_fields = [\n",
257+
" 'properties.eo:cloud_cover',\n",
258+
" 'properties.view:sun_azimuth',\n",
259+
" 'properties.view:sun_elevation'\n",
260+
"]\n",
261+
"\n",
262+
"plots = None\n",
263+
"for f in plot_fields:\n",
264+
" if f in items_df:\n",
265+
" if plots is None:\n",
266+
" plots = items_df.hvplot(y=f, label=f.replace('properties.', ''),\n",
267+
" frame_height=500, frame_width=800)\n",
268+
" else:\n",
269+
" plots = plots * items_df.hvplot(y=f, label=f.replace('properties.', ''))\n",
270+
"\n",
271+
"plots.opts(ylabel='')"
272+
]
236273
}
237274
],
238275
"metadata": {

docs/usage.rst

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,29 @@ section. See the :mod:`Paging <pystac_client.paging>` docs for details on how to
172172
Query Filter
173173
------------
174174

175-
If the server supports the [query filter](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query)
176-
arbitrary Item properties can be included in the search parameters. The query parameter to :class:`ItemSearch` accepts
177-
a JSON structure as in the STAC API spec, but also accepts an abbreviated syntax. Instead of JSON, a list of strings can
178-
be provided, in which case pystac-client will convert them to the equivalent JSON structure.
175+
If the Catalog supports the `Query
176+
extension <https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query>`__,
177+
any Item property can also be included in the search. Rather than
178+
requiring the JSON syntax the Query extension uses, pystac-client can use a
179+
simpler syntax that it will translate to the JSON equivalent. Note
180+
however that when the simple syntax is used it sends all property values
181+
to the server as strings, except for ``gsd`` which it casts to
182+
``float``. This means that if there are extensions in use with numeric
183+
properties these will be sent as strings. Some servers may automatically
184+
cast this to the appropriate data type, others may not.
179185

180-
The syntax is simply:
186+
The query filter will also accept complete JSON as per the specification.
181187

182-
```
183-
<property><operator><value>
184-
e.g.,
188+
::
185189

186-
eo:cloud_cover<10
187-
view:off_nadir<50
188-
platform=landsat-8
189-
```
190+
<property><operator><value>
191+
192+
where operator is one of `>=`, `<=`, `>`, `<`, `=`
193+
194+
Examples:
195+
eo:cloud_cover<10
196+
view:off_nadir<50
197+
platform=landsat-8
198+
199+
Any number of properties can be included, and each can be included more
200+
than once to use additional operators.

0 commit comments

Comments
 (0)