diff --git a/.readthedocs.yml b/.readthedocs.yml index 0a9fe2d4..841124e8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -15,10 +15,5 @@ formats: - pdf - htmlzip -# Optionally set the version of Python and requirements required to build your docs -python: - version: 3.8 - install: - - method: pip - path: . - - requirements: requirements-docs.txt \ No newline at end of file +conda: + environment: docs/environment.yml \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 712f032f..5e803552 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,6 +61,8 @@ ) } +nbsphinx_allow_errors = True + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/environment.yml b/docs/environment.yml new file mode 100644 index 00000000..20d8d096 --- /dev/null +++ b/docs/environment.yml @@ -0,0 +1,9 @@ +name: pystac-client-docs +channels: + - conda-forge + - defaults +dependencies: + - python=3.8 + - pip: + - -r ../requirements-docs.txt + - -e ../ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 9b5232ba..7b575d0b 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -61,6 +61,8 @@ to the server as strings, except for ``gsd`` which it casts to properties these will be sent as strings. Some servers may automatically cast this to the appropriate data type, others may not. +The query filter will also accept complete JSON as per the specification. + :: diff --git a/docs/tutorials.rst b/docs/tutorials.rst index 82e40d34..f84a7e0a 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -15,7 +15,6 @@ STAC Metadata Visualization --------------------------- - :tutorial:`GitHub version ` -- :ref:`Docs version ` This tutorial gives an introduction to using Holeviews and hvplot to visualize STAC metadata and Item geometries on a map. @@ -24,7 +23,6 @@ CQL Filtering --------------------------- - :tutorial:`GitHub version ` -- :ref:`Docs version ` This tutorial gives an introduction to using CQL-JSON filtering in searches to search by arbitrary STAC Item properties. \ No newline at end of file diff --git a/docs/tutorials/stac-metadata-viz.ipynb b/docs/tutorials/stac-metadata-viz.ipynb index f9144113..f1d9b889 100644 --- a/docs/tutorials/stac-metadata-viz.ipynb +++ b/docs/tutorials/stac-metadata-viz.ipynb @@ -233,6 +233,43 @@ "source": [ "plot_polygons(aoi_gdf) * items_gdf.hvplot.paths(geo=True)" ] + }, + { + "cell_type": "markdown", + "id": "b0604c84", + "metadata": {}, + "source": [ + "## Line Plots\n", + "\n", + "Numeric STAC metadata can also be plotted, most often this will be plotted vs the Item `datetime`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c198e261", + "metadata": {}, + "outputs": [], + "source": [ + "items_df = pd.DataFrame(items_gdf)\n", + "\n", + "plot_fields = [\n", + " 'properties.eo:cloud_cover',\n", + " 'properties.view:sun_azimuth',\n", + " 'properties.view:sun_elevation'\n", + "]\n", + "\n", + "plots = None\n", + "for f in plot_fields:\n", + " if f in items_df:\n", + " if plots is None:\n", + " plots = items_df.hvplot(y=f, label=f.replace('properties.', ''),\n", + " frame_height=500, frame_width=800)\n", + " else:\n", + " plots = plots * items_df.hvplot(y=f, label=f.replace('properties.', ''))\n", + "\n", + "plots.opts(ylabel='')" + ] } ], "metadata": { diff --git a/docs/usage.rst b/docs/usage.rst index 3a9a767b..220fed74 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -172,18 +172,29 @@ section. See the :mod:`Paging ` docs for details on how to Query Filter ------------ -If the server supports the [query filter](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query) -arbitrary Item properties can be included in the search parameters. The query parameter to :class:`ItemSearch` accepts -a JSON structure as in the STAC API spec, but also accepts an abbreviated syntax. Instead of JSON, a list of strings can -be provided, in which case pystac-client will convert them to the equivalent JSON structure. +If the Catalog supports the `Query +extension `__, +any Item property can also be included in the search. Rather than +requiring the JSON syntax the Query extension uses, pystac-client can use a +simpler syntax that it will translate to the JSON equivalent. Note +however that when the simple syntax is used it sends all property values +to the server as strings, except for ``gsd`` which it casts to +``float``. This means that if there are extensions in use with numeric +properties these will be sent as strings. Some servers may automatically +cast this to the appropriate data type, others may not. -The syntax is simply: +The query filter will also accept complete JSON as per the specification. -``` - -e.g., +:: -eo:cloud_cover<10 -view:off_nadir<50 -platform=landsat-8 -``` + + + where operator is one of `>=`, `<=`, `>`, `<`, `=` + + Examples: + eo:cloud_cover<10 + view:off_nadir<50 + platform=landsat-8 + +Any number of properties can be included, and each can be included more +than once to use additional operators.