Esempio n. 1
0
File: eo.py Progetto: tschaub/pystac
    def from_dict(d):
        """Constructs an EOAsset from a dict.

        Returns:
            EOAsset: The EOAsset deserialized from the JSON dict.
        """
        asset = Asset.from_dict(d)
        return EOAsset.from_asset(asset)
Esempio n. 2
0
    def add_labels(self, href, title=None, media_type=None, properties=None):
        """Adds a label asset to this LabelItem.

        Args:
            href (str): Link to the asset object. Relative and absolute links are both allowed.
            title (str): Optional displayed title for clients and users.
            media_type (str): Optional description of the media type. Registered Media Types
               are preferred. See :class:`~pystac.MediaType` for common media types.
            properties (dict): Optional, additional properties for this asset. This is used by
                extensions as a way to serialize and deserialize properties on asset
                object JSON.
        """

        self.item.add_asset(
            "labels", Asset(href=href, title=title, media_type=media_type, properties=properties))