pystac.summaries#
- class pystac.summaries.Summaries(summaries: dict[str, Any], maxcount: int = 25)[source]
-
- get_range(prop: str) RangeSummary[Any] | None[source]
- maxcount: int
- ranges: dict[str, RangeSummary[Any]]
- class pystac.summaries.Summarizer(fields: str | dict[str, SummaryStrategy] | None = None)[source]#
The Summarizer computes summaries from values, following the definition of fields to summarize.
The fields to summarize can be provided as a JSON file or as a dictionary of field names and SummaryStrategys. If nothing is provided, a default JSON file will be used.
Only fields that are in the Item properties can be summarized. Thus, it is not possible to summarize the top-level fields such as id or assets.
For more information about the structure of the fields JSON file, see: https://github.com/stac-utils/stac-fields
The default JSON file used is a snapshot of the following file at the time of the pystac release: https://cdn.jsdelivr.net/npm/@radiantearth/stac-fields/fields-normalized.json
- Parameters:
fields – A string containing the path to the JSON file with field descriptions. Alternatively, a dict with the field names as keys and SummaryStrategys as values. If nothing is passed, a default file with field descriptions will be used.
- summarize(source: Collection | Iterable[Item]) Summaries[source]#
Creates summaries from items
- summaryfields: dict[str, SummaryStrategy]#