pystac.extensions.mgrs#
Implements the MGRS Extension.
- class pystac.extensions.mgrs.MgrsExtension(item: Item)[source]#
A concrete implementation of
MgrsExtension
on anItem
that extends the properties of the Item to include properties defined in the MGRS Extension.This class should generally not be instantiated directly. Instead, call
ext()
on anItem
to extend it.>>> item: pystac.Item = ... >>> proj_ext = MgrsExtension.ext(item)
- apply(latitude_band: str, grid_square: str, utm_zone: int | None = None) None [source]#
Applies MGRS extension properties to the extended Item.
- Parameters:
latitude_band – REQUIRED. The latitude band of the Item’s centroid.
grid_square – REQUIRED. MGRS grid square of the Item’s centroid.
utm_zone – The UTM Zone of the Item centroid.
- classmethod ext(obj: Item, add_if_missing: bool = False) MgrsExtension [source]#
Extends the given STAC Object with properties from the MGRS Extension.
This extension can be applied to instances of
Item
.- Raises:
pystac.ExtensionTypeError – If an invalid object type is passed.