File: enum.py

package info (click to toggle)
python-rioxarray 0.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,572 kB
  • sloc: python: 8,937; makefile: 85
file content (49 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""Enums for rioxarray."""
from enum import Enum


class Convention(Enum):
    """
    Supported geospatial metadata conventions.

    rioxarray supports conventions for storing geospatial metadata.
    Currently supported:

    - CF: Climate and Forecasts convention using grid_mapping coordinates
    - Zarr: Zarr spatial and proj conventions for cloud-native formats

    The convention can be set globally using set_options() or per-method
    using the convention parameter.

    Examples
    --------
    Set global convention:

    >>> import rioxarray
    >>> from rioxarray.enum import Convention
    >>> rioxarray.set_options(convention=Convention.CF)

    Use specific convention for a method:

    >>> from rioxarray.enum import Convention
    >>> data.rio.write_crs("EPSG:4326", convention=Convention.CF)

    See Also
    --------
    rioxarray.set_options : Set global options including convention

    References
    ----------
    .. [1] CF Conventions: https://github.com/cf-convention/cf-conventions
    .. [2] Zarr spatial convention: https://github.com/zarr-conventions/spatial
    .. [3] Zarr geo-proj convention: https://github.com/zarr-conventions/geo-proj
    """

    #: Climate and Forecasts convention (default)
    #: https://github.com/cf-convention/cf-conventions
    CF = "CF"

    #: Zarr spatial and proj conventions
    #: https://github.com/zarr-conventions/spatial
    #: https://github.com/zarr-conventions/geo-proj
    ZARR = "ZARR"