sankee


Namesankee JSON
Version 0.2.5 PyPI version JSON
download
home_pageNone
SummaryVisualize classified time series data with interactive Sankey plots in Google Earth Engine.
upload_time2024-03-13 05:05:30
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords earth-engine land-cover sankey visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sankee

[![Earth Engine Python](https://img.shields.io/badge/Earth%20Engine%20API-Python-green)](https://developers.google.com/earth-engine/tutorials/community/intro-to-python-api)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aazuspan/sankee/HEAD?filepath=docs%2Fexamples%2Fmodis_snow_and_ice.ipynb)
[![conda-forge link](https://img.shields.io/conda/vn/conda-forge/sankee)](https://anaconda.org/conda-forge/sankee)
[![conda-forge link](https://img.shields.io/pypi/v/sankee)](https://pypi.org/project/sankee)
[![Testing workflow](https://github.com/aazuspan/sankee/actions/workflows/ci.yml/badge.svg)](https://github.com/aazuspan/sankee/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/aazuspan/sankee/branch/main/graph/badge.svg?token=39REP2HZQC)](https://codecov.io/gh/aazuspan/sankee)
[![Read the Docs](https://readthedocs.org/projects/sankee/badge/?version=latest&style=flat)](https://sankee.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/sankee)](https://pepy.tech/project/sankee)

Visualize changes in classified time series data with interactive Sankey plots in Google Earth Engine

![Sankee example showing grassland expansion in the Nile Delta](docs/_static/demo.gif)

## Description

Use [Earth Engine](https://github.com/google/earthengine-api) to visualize changes in land cover, plant health, burn severity, or any other time series of classified imagery with interactive Sankey plots. Use a library of [built-in datasets](https://sankee.readthedocs.io/en/latest/sankee.html#premade-datasets) for convenience or define your own [custom datasets](https://sankee.readthedocs.io/en/latest/sankee.html#custom-datasets) for flexibility.


## Installation

### Pip

```bash
pip install sankee
```

### Conda

```bash
conda install -c conda-forge sankee
```

## Quickstart

### Premade Datasets

Visualize annual changes in land cover using [popular LULC datasets](https://sankee.readthedocs.io/en/latest/sankee.html#supported-datasets) with a couple lines of code. Just choose a dataset, an area of interest, and a list of years to generate a Sankey diagram from a premade dataset. Below, we can look at 30 years of vegetation recovery in the area devastated by the Mt. St. Helens eruption.

```python
import sankee
import ee

ee.Initialize()

sankee.datasets.LCMS_LC.sankify(
  years=[1990, 2000, 2010, 2020],
  region=ee.Geometry.Point([-122.192688, 46.25917]).buffer(2000),
  max_classes=3,
  title="Mt. St. Helens Recovery"
)
```

![Proportions of land cover over 4 periods increase from barren to grass and tree cover in a Sankey diagram](docs/_static/helens_recovery.png)

Check out the [example notebook](https://sankee.readthedocs.io/en/latest/examples/modis_snow_and_ice.html) for an interactive demo.

### Custom Datasets

Any classified images can be used by defining the dataset parameters (which pixel values correspond to which labels and colors). For example, we can look at classified [Dynamic World](https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_DYNAMICWORLD_V1) scenes just two weeks apart that show substantial snow loss on Mountain Jefferson during the 2021 Heat Dome in the Pacific Northwest.

```python
import sankee
import ee

ee.Initialize()

# Load a set of classified images
img_list = [
    ee.Image("GOOGLE/DYNAMICWORLD/V1/20210616T185919_20210616T190431_T10TEQ"),
    ee.Image("GOOGLE/DYNAMICWORLD/V1/20210706T185919_20210706T190638_T10TEQ")
]

# Which band contains the classified data?
band = "label"

# What labels correspond to which pixel values?
labels = {
    0: "Water", 1: "Trees", 2: "Grass", 3: "Flooded", 4: "Crops",
    5: "Shrub / Scrub", 6: "Build", 7: "Bare", 8: "Snow / Ice",
}

# What colors should be applied to which pixel values?
palette = {
    0: "#419BDF", 1: "#397D49", 2: "#88B053", 3: "#7A87C6", 4: "#E49635",
    5: "#DFC35A", 6: "#C4281B", 7: "#A59B8F", 8: "#B39FE1"
}

plot = sankee.sankify(
    image_list=img_list, 
    band=band, 
    labels=labels,
    palette=palette,
    region=ee.Geometry.Point([-121.80183, 44.67655]).buffer(3000), 
    max_classes=3,
    title="Mt. Jefferson Snow Loss - June 2021"
)
```

![](docs/_static/jefferson_snow.png)

### Integration with geemap

`sankee` premade datasets are usable through the [geemap](https://github.com/giswqs/geemap) interactive GUI. Check out the [documentation](https://geemap.org/notebooks/75_sankee/) and [video tutorials](https://www.youtube.com/watch?v=IZWpJYX6w8I) by [@giswqs](https://github.com/giswqs).


## Contributing

If you find bugs or have feature requests, please open an issue!

---

[Top](https://github.com/aazuspan/sankee#sankee)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sankee",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "earth-engine,land-cover,sankey,visualization",
    "author": null,
    "author_email": "Aaron Zuspan <aazuspan@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4b/26/d905378e7b554aa19276d3ee1af462498a3de661d513b0b15bfb14a57673/sankee-0.2.5.tar.gz",
    "platform": null,
    "description": "# sankee\n\n[![Earth Engine Python](https://img.shields.io/badge/Earth%20Engine%20API-Python-green)](https://developers.google.com/earth-engine/tutorials/community/intro-to-python-api)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aazuspan/sankee/HEAD?filepath=docs%2Fexamples%2Fmodis_snow_and_ice.ipynb)\n[![conda-forge link](https://img.shields.io/conda/vn/conda-forge/sankee)](https://anaconda.org/conda-forge/sankee)\n[![conda-forge link](https://img.shields.io/pypi/v/sankee)](https://pypi.org/project/sankee)\n[![Testing workflow](https://github.com/aazuspan/sankee/actions/workflows/ci.yml/badge.svg)](https://github.com/aazuspan/sankee/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/aazuspan/sankee/branch/main/graph/badge.svg?token=39REP2HZQC)](https://codecov.io/gh/aazuspan/sankee)\n[![Read the Docs](https://readthedocs.org/projects/sankee/badge/?version=latest&style=flat)](https://sankee.readthedocs.io/en/latest/?badge=latest)\n[![Downloads](https://pepy.tech/badge/sankee)](https://pepy.tech/project/sankee)\n\nVisualize changes in classified time series data with interactive Sankey plots in Google Earth Engine\n\n![Sankee example showing grassland expansion in the Nile Delta](docs/_static/demo.gif)\n\n## Description\n\nUse [Earth Engine](https://github.com/google/earthengine-api) to visualize changes in land cover, plant health, burn severity, or any other time series of classified imagery with interactive Sankey plots. Use a library of [built-in datasets](https://sankee.readthedocs.io/en/latest/sankee.html#premade-datasets) for convenience or define your own [custom datasets](https://sankee.readthedocs.io/en/latest/sankee.html#custom-datasets) for flexibility.\n\n\n## Installation\n\n### Pip\n\n```bash\npip install sankee\n```\n\n### Conda\n\n```bash\nconda install -c conda-forge sankee\n```\n\n## Quickstart\n\n### Premade Datasets\n\nVisualize annual changes in land cover using [popular LULC datasets](https://sankee.readthedocs.io/en/latest/sankee.html#supported-datasets) with a couple lines of code. Just choose a dataset, an area of interest, and a list of years to generate a Sankey diagram from a premade dataset. Below, we can look at 30 years of vegetation recovery in the area devastated by the Mt. St. Helens eruption.\n\n```python\nimport sankee\nimport ee\n\nee.Initialize()\n\nsankee.datasets.LCMS_LC.sankify(\n  years=[1990, 2000, 2010, 2020],\n  region=ee.Geometry.Point([-122.192688, 46.25917]).buffer(2000),\n  max_classes=3,\n  title=\"Mt. St. Helens Recovery\"\n)\n```\n\n![Proportions of land cover over 4 periods increase from barren to grass and tree cover in a Sankey diagram](docs/_static/helens_recovery.png)\n\nCheck out the [example notebook](https://sankee.readthedocs.io/en/latest/examples/modis_snow_and_ice.html) for an interactive demo.\n\n### Custom Datasets\n\nAny classified images can be used by defining the dataset parameters (which pixel values correspond to which labels and colors). For example, we can look at classified [Dynamic World](https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_DYNAMICWORLD_V1) scenes just two weeks apart that show substantial snow loss on Mountain Jefferson during the 2021 Heat Dome in the Pacific Northwest.\n\n```python\nimport sankee\nimport ee\n\nee.Initialize()\n\n# Load a set of classified images\nimg_list = [\n    ee.Image(\"GOOGLE/DYNAMICWORLD/V1/20210616T185919_20210616T190431_T10TEQ\"),\n    ee.Image(\"GOOGLE/DYNAMICWORLD/V1/20210706T185919_20210706T190638_T10TEQ\")\n]\n\n# Which band contains the classified data?\nband = \"label\"\n\n# What labels correspond to which pixel values?\nlabels = {\n    0: \"Water\", 1: \"Trees\", 2: \"Grass\", 3: \"Flooded\", 4: \"Crops\",\n    5: \"Shrub / Scrub\", 6: \"Build\", 7: \"Bare\", 8: \"Snow / Ice\",\n}\n\n# What colors should be applied to which pixel values?\npalette = {\n    0: \"#419BDF\", 1: \"#397D49\", 2: \"#88B053\", 3: \"#7A87C6\", 4: \"#E49635\",\n    5: \"#DFC35A\", 6: \"#C4281B\", 7: \"#A59B8F\", 8: \"#B39FE1\"\n}\n\nplot = sankee.sankify(\n    image_list=img_list, \n    band=band, \n    labels=labels,\n    palette=palette,\n    region=ee.Geometry.Point([-121.80183, 44.67655]).buffer(3000), \n    max_classes=3,\n    title=\"Mt. Jefferson Snow Loss - June 2021\"\n)\n```\n\n![](docs/_static/jefferson_snow.png)\n\n### Integration with geemap\n\n`sankee` premade datasets are usable through the [geemap](https://github.com/giswqs/geemap) interactive GUI. Check out the [documentation](https://geemap.org/notebooks/75_sankee/) and [video tutorials](https://www.youtube.com/watch?v=IZWpJYX6w8I) by [@giswqs](https://github.com/giswqs).\n\n\n## Contributing\n\nIf you find bugs or have feature requests, please open an issue!\n\n---\n\n[Top](https://github.com/aazuspan/sankee#sankee)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Visualize classified time series data with interactive Sankey plots in Google Earth Engine.",
    "version": "0.2.5",
    "project_urls": {
        "Homepage": "https://github.com/aazuspan/sankee",
        "Source": "https://github.com/aazuspan/sankee"
    },
    "split_keywords": [
        "earth-engine",
        "land-cover",
        "sankey",
        "visualization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f0757bf32bb7b7482d57e783f688b47f3b21683fa85c96298bd96de8b3689d99",
                "md5": "feb865d2e1cc21d7d9da9c0dbc6f957f",
                "sha256": "6b880ba88d9dea4cb1dc51b5b6d132a788f8a5141fbddde87c529cb15955b756"
            },
            "downloads": -1,
            "filename": "sankee-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "feb865d2e1cc21d7d9da9c0dbc6f957f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18896,
            "upload_time": "2024-03-13T05:05:26",
            "upload_time_iso_8601": "2024-03-13T05:05:26.651377Z",
            "url": "https://files.pythonhosted.org/packages/f0/75/7bf32bb7b7482d57e783f688b47f3b21683fa85c96298bd96de8b3689d99/sankee-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4b26d905378e7b554aa19276d3ee1af462498a3de661d513b0b15bfb14a57673",
                "md5": "b5488994309b4efd8bea1d8f335edb2b",
                "sha256": "a65b82f9a6ed75c8e6409387a762d12e02e642325d1d77f6f52c82782b71b511"
            },
            "downloads": -1,
            "filename": "sankee-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b5488994309b4efd8bea1d8f335edb2b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16386,
            "upload_time": "2024-03-13T05:05:30",
            "upload_time_iso_8601": "2024-03-13T05:05:30.448009Z",
            "url": "https://files.pythonhosted.org/packages/4b/26/d905378e7b554aa19276d3ee1af462498a3de661d513b0b15bfb14a57673/sankee-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 05:05:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aazuspan",
    "github_project": "sankee",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sankee"
}
        
Elapsed time: 0.21713s