Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/pystac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,30 @@
import pystac.extensions.hooks
import pystac.extensions.classification
import pystac.extensions.datacube
import pystac.extensions.earthquake
import pystac.extensions.eo
import pystac.extensions.file
import pystac.extensions.grid
import pystac.extensions.insar
import pystac.extensions.item_assets

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import pystac.extensions.label
import pystac.extensions.mgrs
import pystac.extensions.mlm
import pystac.extensions.order
import pystac.extensions.pointcloud
import pystac.extensions.processing
import pystac.extensions.product
import pystac.extensions.projection
import pystac.extensions.raster
import pystac.extensions.sar
import pystac.extensions.sat
import pystac.extensions.scientific
import pystac.extensions.sentinel1
import pystac.extensions.sentinel2
import pystac.extensions.sentinel3
import pystac.extensions.storage
import pystac.extensions.table
import pystac.extensions.timestamps
Expand All @@ -120,19 +128,27 @@
[
pystac.extensions.classification.CLASSIFICATION_EXTENSION_HOOKS,
pystac.extensions.datacube.DATACUBE_EXTENSION_HOOKS,
pystac.extensions.earthquake.EARTHQUAKE_EXTENSION_HOOKS,
pystac.extensions.eo.EO_EXTENSION_HOOKS,
pystac.extensions.file.FILE_EXTENSION_HOOKS,
pystac.extensions.grid.GRID_EXTENSION_HOOKS,
pystac.extensions.insar.INSAR_EXTENSION_HOOKS,
pystac.extensions.item_assets.ITEM_ASSETS_EXTENSION_HOOKS,
pystac.extensions.label.LABEL_EXTENSION_HOOKS,
pystac.extensions.mgrs.MGRS_EXTENSION_HOOKS,
pystac.extensions.mlm.MLM_EXTENSION_HOOKS,
pystac.extensions.order.ORDER_EXTENSION_HOOKS,
pystac.extensions.pointcloud.POINTCLOUD_EXTENSION_HOOKS,
pystac.extensions.processing.PROCESSING_EXTENSION_HOOKS,
pystac.extensions.product.PRODUCT_EXTENSION_HOOKS,
pystac.extensions.projection.PROJECTION_EXTENSION_HOOKS,
pystac.extensions.raster.RASTER_EXTENSION_HOOKS,
pystac.extensions.sar.SAR_EXTENSION_HOOKS,
pystac.extensions.sat.SAT_EXTENSION_HOOKS,
pystac.extensions.scientific.SCIENTIFIC_EXTENSION_HOOKS,
pystac.extensions.sentinel1.SENTINEL1_EXTENSION_HOOKS,
pystac.extensions.sentinel2.SENTINEL2_EXTENSION_HOOKS,
pystac.extensions.sentinel3.SENTINEL3_EXTENSION_HOOKS,
pystac.extensions.storage.STORAGE_EXTENSION_HOOKS,
pystac.extensions.table.TABLE_EXTENSION_HOOKS,
pystac.extensions.timestamps.TIMESTAMPS_EXTENSION_HOOKS,
Expand Down
104 changes: 104 additions & 0 deletions core/pystac/extensions/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,31 @@
)
from pystac.extensions.classification import ClassificationExtension
from pystac.extensions.datacube import DatacubeExtension
from pystac.extensions.earthquake import EarthquakeExtension
from pystac.extensions.eo import EOExtension
from pystac.extensions.file import FileExtension
from pystac.extensions.grid import GridExtension
from pystac.extensions.insar import InsarExtension
from pystac.extensions.item_assets import ItemAssetsExtension
from pystac.extensions.mgrs import MgrsExtension
from pystac.extensions.mlm import (
AssetDetailedMLMExtension,
AssetGeneralMLMExtension,
MLMExtension,
)
from pystac.extensions.order import OrderExtension
from pystac.extensions.pointcloud import PointcloudExtension
from pystac.extensions.processing import ProcessingExtension
from pystac.extensions.product import ProductExtension
from pystac.extensions.projection import ProjectionExtension
from pystac.extensions.raster import RasterExtension
from pystac.extensions.render import Render, RenderExtension
from pystac.extensions.sar import SarExtension
from pystac.extensions.sat import SatExtension
from pystac.extensions.scientific import ScientificExtension
from pystac.extensions.sentinel1 import Sentinel1Extension
from pystac.extensions.sentinel2 import Sentinel2Extension
from pystac.extensions.sentinel3 import Sentinel3Extension
from pystac.extensions.storage import StorageExtension
from pystac.extensions.table import TableExtension
from pystac.extensions.timestamps import TimestampsExtension
Expand All @@ -48,16 +56,24 @@
EXTENSION_NAMES = Literal[
"classification",
"cube",
"eq",
"eo",
"file",
"grid",
"insar",
"item_assets",
"mgrs",
"mlm",
"order",
"pc",
"processing",
"product",
"proj",
"raster",
"render",
"s1",
"s2",
"s3",
"sar",
"sat",
"sci",
Expand All @@ -72,16 +88,24 @@
EXTENSION_NAME_MAPPING: dict[EXTENSION_NAMES, Any] = {
ClassificationExtension.name: ClassificationExtension,
DatacubeExtension.name: DatacubeExtension,
EarthquakeExtension.name: EarthquakeExtension,
EOExtension.name: EOExtension,
FileExtension.name: FileExtension,
GridExtension.name: GridExtension,
InsarExtension.name: InsarExtension,
ItemAssetsExtension.name: ItemAssetsExtension,
MgrsExtension.name: MgrsExtension,
MLMExtension.name: MLMExtension,
OrderExtension.name: OrderExtension,
PointcloudExtension.name: PointcloudExtension,
ProcessingExtension.name: ProcessingExtension,
ProductExtension.name: ProductExtension,
ProjectionExtension.name: ProjectionExtension,
RasterExtension.name: RasterExtension,
RenderExtension.name: RenderExtension,
Sentinel1Extension.name: Sentinel1Extension,
Sentinel2Extension.name: Sentinel2Extension,
Sentinel3Extension.name: Sentinel3Extension,
SarExtension.name: SarExtension,
SatExtension.name: SatExtension,
ScientificExtension.name: ScientificExtension,
Expand Down Expand Up @@ -156,6 +180,14 @@ class CollectionExt(CatalogExt):
def cube(self) -> DatacubeExtension[Collection]:
return DatacubeExtension.ext(self.stac_object)

@property
def order(self) -> OrderExtension[Collection]:
return OrderExtension.ext(self.stac_object)

@property
def product(self) -> ProductExtension[Collection]:
return ProductExtension.ext(self.stac_object)

@property
def item_assets(self) -> dict[str, ItemAssetDefinition]:
return ItemAssetsExtension.ext(self.stac_object).item_assets
Expand Down Expand Up @@ -228,6 +260,10 @@ def classification(self) -> ClassificationExtension[Item]:
def cube(self) -> DatacubeExtension[Item]:
return DatacubeExtension.ext(self.stac_object)

@property
def eq(self) -> EarthquakeExtension[Item]:
return EarthquakeExtension.ext(self.stac_object)

@property
def eo(self) -> EOExtension[Item]:
return EOExtension.ext(self.stac_object)
Expand All @@ -236,6 +272,10 @@ def eo(self) -> EOExtension[Item]:
def grid(self) -> GridExtension:
return GridExtension.ext(self.stac_object)

@property
def insar(self) -> InsarExtension[Item]:
return InsarExtension.ext(self.stac_object)

@property
def mgrs(self) -> MgrsExtension:
return MgrsExtension.ext(self.stac_object)
Expand All @@ -244,10 +284,22 @@ def mgrs(self) -> MgrsExtension:
def mlm(self) -> MLMExtension[Item]:
return MLMExtension.ext(self.stac_object)

@property
def order(self) -> OrderExtension[Item]:
return OrderExtension.ext(self.stac_object)

@property
def pc(self) -> PointcloudExtension[Item]:
return PointcloudExtension.ext(self.stac_object)

@property
def processing(self) -> ProcessingExtension[Item]:
return ProcessingExtension.ext(self.stac_object)

@property
def product(self) -> ProductExtension[Item]:
return ProductExtension.ext(self.stac_object)

@property
def proj(self) -> ProjectionExtension[Item]:
return ProjectionExtension.ext(self.stac_object)
Expand All @@ -256,6 +308,18 @@ def proj(self) -> ProjectionExtension[Item]:
def render(self) -> RenderExtension[Item]:
return RenderExtension.ext(self.stac_object)

@property
def s1(self) -> Sentinel1Extension[Item]:
return Sentinel1Extension.ext(self.stac_object)

@property
def s2(self) -> Sentinel2Extension[Item]:
return Sentinel2Extension.ext(self.stac_object)

@property
def s3(self) -> Sentinel3Extension[Item]:
return Sentinel3Extension.ext(self.stac_object)

@property
def sar(self) -> SarExtension[Item]:
return SarExtension.ext(self.stac_object)
Expand Down Expand Up @@ -355,14 +419,34 @@ def classification(self) -> ClassificationExtension[U]:
def cube(self) -> DatacubeExtension[U]:
return DatacubeExtension.ext(self.stac_object)

@property
def eq(self) -> EarthquakeExtension[U]:
return EarthquakeExtension.ext(self.stac_object)

@property
def eo(self) -> EOExtension[U]:
return EOExtension.ext(self.stac_object)

@property
def insar(self) -> InsarExtension[U]:
return InsarExtension.ext(self.stac_object)

@property
def pc(self) -> PointcloudExtension[U]:
return PointcloudExtension.ext(self.stac_object)

@property
def order(self) -> OrderExtension[U]:
return OrderExtension.ext(self.stac_object)

@property
def processing(self) -> ProcessingExtension[U]:
return ProcessingExtension.ext(self.stac_object)

@property
def product(self) -> ProductExtension[U]:
return ProductExtension.ext(self.stac_object)

@property
def proj(self) -> ProjectionExtension[U]:
return ProjectionExtension.ext(self.stac_object)
Expand All @@ -371,6 +455,10 @@ def proj(self) -> ProjectionExtension[U]:
def raster(self) -> RasterExtension[U]:
return RasterExtension.ext(self.stac_object)

@property
def s3(self) -> Sentinel3Extension[U]:
return Sentinel3Extension.ext(self.stac_object)

@property
def sar(self) -> SarExtension[U]:
return SarExtension.ext(self.stac_object)
Expand Down Expand Up @@ -436,6 +524,22 @@ class ItemAssetExt(_AssetExt[ItemAssetDefinition]):
def mlm(self) -> MLMExtension[ItemAssetDefinition]:
return MLMExtension.ext(self.stac_object)

@property
def order(self) -> OrderExtension[ItemAssetDefinition]:
return OrderExtension.ext(self.stac_object)

@property
def processing(self) -> ProcessingExtension[ItemAssetDefinition]:
return ProcessingExtension.ext(self.stac_object)

@property
def product(self) -> ProductExtension[ItemAssetDefinition]:
return ProductExtension.ext(self.stac_object)

@property
def s3(self) -> Sentinel3Extension[ItemAssetDefinition]:
return Sentinel3Extension.ext(self.stac_object)

@property
def storage(self) -> StorageExtension[ItemAssetDefinition]:
return StorageExtension.ext(self.stac_object)
Expand Down
8 changes: 8 additions & 0 deletions docs/api/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,29 @@ pystac.extensions

classification.ClassificationExtension
datacube.DatacubeExtension
earthquake.EarthquakeExtension
eo.EOExtension
file.FileExtension
grid.GridExtension
insar.InsarExtension
item_assets.ItemAssetsExtension
mgrs.MgrsExtension
mlm.MLMExtension
mlm.AssetGeneralMLMExtension
mlm.AssetDetailedMLMExtension
order.OrderExtension
pointcloud.PointcloudExtension
processing.ProcessingExtension
product.ProductExtension
projection.ProjectionExtension
raster.RasterExtension
render.RenderExtension
sar.SarExtension
sat.SatExtension
scientific.ScientificExtension
sentinel1.Sentinel1Extension
sentinel2.Sentinel2Extension
sentinel3.Sentinel3Extension
storage.StorageExtension
table.TableExtension
timestamps.TimestampsExtension
Expand Down
6 changes: 6 additions & 0 deletions docs/api/extensions/earthquake.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.earthquake
============================

.. automodule:: pystac.extensions.earthquake
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/insar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.insar
=======================

.. automodule:: pystac.extensions.insar
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/order.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.order
=======================

.. automodule:: pystac.extensions.order
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/processing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.processing
============================

.. automodule:: pystac.extensions.processing
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/product.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.product
=========================

.. automodule:: pystac.extensions.product
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/sentinel1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.sentinel1
===========================

.. automodule:: pystac.extensions.sentinel1
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions docs/api/extensions/sentinel2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pystac.extensions.sentinel2
===========================

.. automodule:: pystac.extensions.sentinel2
:members:
:undoc-members:
19 changes: 19 additions & 0 deletions docs/api/extensions/sentinel3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pystac.extensions.sentinel3
===========================

.. currentmodule:: pystac.extensions.sentinel3

.. py:class:: SRALGSD

Type alias for Sentinel-3 SRAL GSD mappings with keys ``"along-track"``
and ``"across-track"``.

.. py:class:: SLSTRGSD

Type alias for Sentinel-3 SLSTR GSD mappings with keys ``"S1-S6"`` and
``"S7-S9 and F1-F2"``.

.. automodule:: pystac.extensions.sentinel3
:members:
:undoc-members:
:exclude-members: SRALGSD, SLSTRGSD
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,7 @@
("py:class", "HREF"), # this one partially works
("py:class", "jsonschema.validators.Draft7Validator"),
]

nitpick_ignore_regex = [
("py:class", r"pystac\.extensions\.[^.]+\.T"),
]
Loading