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.rst
+61-26Lines changed: 61 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,13 @@ Provider
88
88
:members:
89
89
:undoc-members:
90
90
91
+
Summaries
92
+
~~~~~~~~~
93
+
94
+
.. autoclass:: pystac.Summaries
95
+
:members:
96
+
:undoc-members:
97
+
91
98
Item Spec
92
99
---------
93
100
@@ -186,46 +193,74 @@ ExtensionTypeError
186
193
Extensions
187
194
----------
188
195
189
-
**TEMPORARILY REMOVED**
190
-
.. .. autoclass:: pystac.extensions.Extensions
191
-
.. :members:
192
-
.. :undoc-members:
193
-
194
-
ExtensionIndex
195
-
~~~~~~~~~~~~~~
196
+
Base Classes
197
+
------------
196
198
197
-
**TEMPORARILY REMOVED**
199
+
Abstract base classes that should be inherited to implement specific extensions.
198
200
199
-
.. An ExtensionIndex is accessed through the :attr:`STACObject.ext <pystac.STACObject.ext>` property and is the primary way to access information and functionality around STAC extensions.
These classes are representations of the `EO Extension Spec <https://github.com/radiantearth/stac-spec/tree/v1.0.0-beta.2/extensions/eo>`_.
These classes are representations of the `EO Extension Spec <https://github.com/radiantearth/stac-spec/tree/v1.0.0-beta.2/extensions/eo>`_.
Extensions to the core STAC specification provide additional JSON fields that can be
316
+
used to better describe the data. Most tend to be about describing a particular
317
+
domain or type of data, but some imply functionality.
320
318
321
-
# All of the below are equivalent:
322
-
item.ext['eo'].bands
323
-
item.ext[pystac.Extensions.EO].bands
324
-
item.ext.eo.bands
319
+
This library makes an effort to support all extensions that are part of the
320
+
`stac-extensions GitHub org
321
+
<https://stac-extensions.github.io/#extensions-in-stac-extensions-organization>`__, and
322
+
we are committed to supporting all STAC Extensions at the "Candidate" maturity level or
323
+
above (see the `Extension Maturity
324
+
<https://stac-extensions.github.io/#extension-maturity>`__ documentation for details).
325
325
326
-
Notice the ``eo`` property on ``ext`` - this utilizes the `__getattr__ <https://docs.python.org/3/reference/datamodel.html#object.__getattr__>`_ method to delegate the property name to the ``__getitem__`` method, so we can access any registered extension as if it were a property on ``ext``.
326
+
Accessing Extension Functionality
327
+
---------------------------------
327
328
328
-
Extensions wrap the objects they extend. Extensions hold
329
-
no values of their own, but instead use Python `properties <https://docs.python.org/3/library/functions.html#property>`_
330
-
to directly modify the values of the objects they wrap.
329
+
Extension functionality is encapsulated in classes that are specific to the STAC
330
+
Extension (e.g. Electro-Optical, Projection, etc.) and STAC Object
331
+
(:class:`~pystac.Collection`, :class:`pystac.Item`, or :class:`pystac.Asset`). All
332
+
classes that extend these objects inherit from
333
+
:class:`pystac.extensions.base.PropertiesExtension`, and you can use the
334
+
``ext`` method on these classes to extend an object.
331
335
332
-
Any object that is returned by extension methods therefore also wrap components of the STAC objects.
333
-
For instance, the ``LabelClasses`` holds a reference to the original ``Item``'s ``label:classes`` property, so that
334
-
modifying the ``LabelClasses``
335
-
properties through the setters will modify the item properties directly. For example:
336
+
For instance, to extend an item with the :stac-ext:`Electro-Optical Extension <eo>`
337
+
you would use :meth:`EOExtension.ext <pystac.extensions.eo.EOExtension.ext>` as
0 commit comments