wcs.model¶
Classes holding information about coverages on a WCS server.
Attributes¶
Type for axis interval bounds. |
Exceptions¶
An exception thrown by this library. |
Classes¶
Holds basic coverage information extracted from the WCS GetCapabilities |
|
Holds full coverage information extracted from the WCS DescribeCoverage. |
|
An axis with a name, low/upper bounds, a CRS, uom, resolution, coefficients. |
|
The bounding box of a coverage, containing low/high limits of all its axes. |
|
Represents the range type of a coverage, indicating the structure of the data. |
|
A field (also known as band, or channel) in a coverage range type ( |
|
Represents a null value with an optional reason. |
|
Utility class for handling CRS. |
Module Contents¶
- class BasicCoverage(name, subtype=None, bbox=None, lon_lat=None, size_bytes=None, additional_params=None)[source]¶
Holds basic coverage information extracted from the WCS GetCapabilities document, notably the WGS bounding box if provided.
- Parameters:
name (str) – the coverage name.
subtype (str) – coverage subtype, e.g. ‘ReferenceableGridCoverage’
bbox (BoundingBox) – bounding box in native CRS
lon_lat (tuple[Axis, Axis]) – a tuple of longitude / latitude axes respresenting the WGS84 bounding box of the coverage
size_bytes (int) – coverage size in bytes; None if not reported by the server
additional_params (dict[str, str]) – additional key/value parameters
- additional_params = None[source]¶
A dictionary of additional key/value parameters if reported by the server
- class FullCoverage(name, bbox, grid_bbox, range_type, metadata=None)[source]¶
Holds full coverage information extracted from the WCS DescribeCoverage.
- Parameters:
name (str) – the coverage name.
bbox (BoundingBox) – bounding box in native CRS
grid_bbox (BoundingBox) – grid bounding box
range_type (RangeType) – coverage range type
metadata (dict)
- class Axis[source]¶
An axis with a name, low/upper bounds, a CRS, uom, resolution, coefficients.
A subset of the coefficients (axis coordinates) can be retrieved with the [] operator, e.g. for an irregular temporal axis: axis[“2024-01-01” : “2024-01-31”]. See
__getitem__()
for more details.- Parameters:
name – Name of the axis.
low – Lower bound of the axis.
high – Upper bound of the axis.
crs – Coordinate Reference System, e.g., “EPSG:4326”.
uom – Unit of measure, e.g., “degree”.
resolution – Axis resolution, for regular axes.
coefficients – Axis coefficients for irregular axes.
- is_temporal()[source]¶
Returns: True if this axis is a temporal axis (e.g. ansi), False otherwise.
- Return type:
- is_spatial()[source]¶
Returns: True if this axis is a spatial axis (e.g. Lat, Lon, E, N), False otherwise.
- Return type:
- is_irregular()[source]¶
Returns: True if this axis is an irregular axis, False otherwise.
- Return type:
- class BoundingBox(axes, crs)[source]¶
The bounding box of a coverage, containing low/high limits of all its axes.
The axes can be accessed through the
axes
attribute, or through the subscript operator, e.g.bbox[1] # get the second axis bbox['Lat'] # get the axis with name Lat
- Parameters:
- class RangeType(fields)[source]¶
Represents the range type of a coverage, indicating the structure of the data.
The range type consists of a list of field types (
Field
). The fields can be accessed through thefields
attribute, or through the subscript operator, e.g.range_type[1] # get the second field range_type['blue'] # get the field with name blue
- Parameters:
fields – A list of
Field
objects describing the fields (also known as bands or channels) of a coverage.
- class Field[source]¶
A field (also known as band, or channel) in a coverage range type (
RangeType
)It can be either a quantity or a category. It includes information about the field’s name, definition, label, description, codespace (only Category), unit of measure (only Quantity), and any nil values.
- Parameters:
name – The name of the field. This can be used to subset bands in WCS GetCoverage requests or WCPS queries.
is_quantity – Indicates whether this field is a Quantity (
True
) or a Category (False
). Defaults toTrue
.definition – A URI that can be resolved to the complete human-readable definition of the property that is represented by the data component.
label – Short human-readable information about the data component.
description – A human-readable description of the data.
codespace – A URL to an external dictionary, taxonomy, or ontology representing the code space. This attribute is only set for category data, i.e., when
is_quantity
isFalse
.uom – The unit of measure for this data.
nil_values – A list of nil values associated with this field.
- definition: str = None[source]¶
A URI that can be resolved to the complete human readable definition of the property that is represented by the data component.
- codespace: str = None[source]¶
URL to an external dictionary, taxonomy or ontology representing the code space. Only set for category data, i.e.
is_quantity
is False.
- class NilValue[source]¶
Represents a null value with an optional reason.
- Parameters:
nil_value – The null value itself, represented as a string.
reason – An optional explanation for why the value is null. This is useful for providing context or documentation about the null value.
- class Crs[source]¶
Utility class for handling CRS.
- static to_short_notation(url)[source]¶
Parse CRS identifiers in this notation.