ChipClassificationGeoJSONStore#

class ChipClassificationGeoJSONStore[source]#

Bases: LabelStore

Storage for chip classification predictions.

Attributes

bbox

Bounding box applied to the source.

crs_transformer

Associated CRSTransformer.

__init__(uri: str, class_config: ClassConfig, crs_transformer: CRSTransformer, bbox: Optional[Box] = None)[source]#

Constructor.

Parameters
  • uri (str) – uri of GeoJSON file containing labels

  • class_config (ClassConfig) – ClassConfig

  • crs_transformer (CRSTransformer) – CRSTransformer to convert from map coords in label in GeoJSON file to pixel coords.

  • bbox (Optional[Box], optional) – User-specified crop of the extent. If provided, only labels falling inside it are returned by ChipClassificationGeoJSONStore.get_labels(). Must be provided if the corresponding RasterSource has bbox != extent.

Methods

__init__(uri, class_config, crs_transformer)

Constructor.

get_labels()

Loads Labels from this label store.

save(labels)

Save labels to URI if writable.

set_bbox(bbox)

Set self.extent to the given value.

__init__(uri: str, class_config: ClassConfig, crs_transformer: CRSTransformer, bbox: Optional[Box] = None)[source]#

Constructor.

Parameters
  • uri (str) – uri of GeoJSON file containing labels

  • class_config (ClassConfig) – ClassConfig

  • crs_transformer (CRSTransformer) – CRSTransformer to convert from map coords in label in GeoJSON file to pixel coords.

  • bbox (Optional[Box], optional) – User-specified crop of the extent. If provided, only labels falling inside it are returned by ChipClassificationGeoJSONStore.get_labels(). Must be provided if the corresponding RasterSource has bbox != extent.

get_labels() ChipClassificationLabels[source]#

Loads Labels from this label store.

Return type

ChipClassificationLabels

save(labels: ChipClassificationLabels) None[source]#

Save labels to URI if writable.

Note that if the grid is inferred from polygons, only the grid will be written, not the original polygons.

Parameters

labels (ChipClassificationLabels) –

Return type

None

set_bbox(bbox: Box) None[source]#

Set self.extent to the given value.

Note

This method is idempotent.

Parameters
  • extent (Box) – User-specified extent in pixel coordinates.

  • bbox (Box) –

Return type

None

property bbox: Box#

Bounding box applied to the source.

property crs_transformer: CRSTransformer#

Associated CRSTransformer.