Implements the MGRS Extension.

class pystac.extensions.mgrs.MgrsExtension(item: Item)[source]#

A concrete implementation of MgrsExtension on an Item 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 MgrsExtension.ext() on an Item 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.

  • 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.


pystac.ExtensionTypeError – If an invalid object type is passed.

classmethod get_schema_uri() str[source]#

Gets the schema URI associated with this extension.

property grid_square: str | None#

Get or sets the latitude band of the datasource.

item: Item#

The Item being extended.

property latitude_band: str | None#

Get or sets the latitude band of the datasource.

name: Literal['mgrs'] = 'mgrs'#
properties: dict[str, Any]#

The Item properties, including extension properties.

property utm_zone: int | None#

Get or sets the latitude band of the datasource.

class pystac.extensions.mgrs.MgrsExtensionHooks[source]#
prev_extension_ids: set[str] = {}#
schema_uri: str = ''#
stac_object_types = {Feature}#
pystac.extensions.mgrs.validated_grid_square(v: str) str[source]#
pystac.extensions.mgrs.validated_latitude_band(v: str) str[source]#
pystac.extensions.mgrs.validated_utm_zone(v: int | None) int | None[source]#