Skip to content

Commit

Permalink
Implement Extension: Render (#1464) (#1465)
Browse files Browse the repository at this point in the history
* Initial implementation of render extension

* Return Render objs from renders getter

* Add closing greater than symbol to Render repr

* Fix instance type check logic

* Add render extension tests

* Remove item-assets and virtual assets extensions

* Add docstrings to render extension

* Replace Landsat-8 example Item with Sentinel-2 Item

* Remove validation tests

* Remove other extensions, simplify Item

* Update render extension for v2.0.0 conformance

* Add render test episodes

* Add #1465 render extension

* Fix references to xarray in docstrings
  • Loading branch information
bmcandr authored Jan 18, 2025
1 parent e90b945 commit 312a081
Show file tree
Hide file tree
Showing 8 changed files with 1,187 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- Top-level `item_assets` dict on `Collection`s ([#1476](https://github.com/stac-utils/pystac/pull/1476))
- Render Extension ([#1465](https://github.com/stac-utils/pystac/pull/1465))

### Changed

Expand Down
11 changes: 11 additions & 0 deletions pystac/extensions/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pystac.extensions.pointcloud import PointcloudExtension
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
Expand All @@ -44,6 +45,7 @@
"pc",
"proj",
"raster",
"render",
"sar",
"sat",
"sci",
Expand All @@ -66,6 +68,7 @@
PointcloudExtension.name: PointcloudExtension,
ProjectionExtension.name: ProjectionExtension,
RasterExtension.name: RasterExtension,
RenderExtension.name: RenderExtension,
SarExtension.name: SarExtension,
SatExtension.name: SatExtension,
ScientificExtension.name: ScientificExtension,
Expand Down Expand Up @@ -118,6 +121,10 @@ def cube(self) -> DatacubeExtension[Collection]:
def item_assets(self) -> dict[str, ItemAssetDefinition]:
return ItemAssetsExtension.ext(self.stac_object).item_assets

@property
def render(self) -> dict[str, Render]:
return RenderExtension.ext(self.stac_object).renders

@property
def sci(self) -> ScientificExtension[Collection]:
return ScientificExtension.ext(self.stac_object)
Expand Down Expand Up @@ -172,6 +179,10 @@ def pc(self) -> PointcloudExtension[Item]:
def proj(self) -> ProjectionExtension[Item]:
return ProjectionExtension.ext(self.stac_object)

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

@property
def sar(self) -> SarExtension[Item]:
return SarExtension.ext(self.stac_object)
Expand Down
Loading

0 comments on commit 312a081

Please sign in to comment.