earthengine-jupyter


Nameearthengine-jupyter JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/google/earthengine-jupyter
SummaryTools for working with the Earth Engine from a Jupyter development environment
upload_time2022-11-30 04:01:15
maintainer
docs_urlNone
authortylere
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            earthengine-jupyter
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

**NOTICE: This is an experimental project and is not an officially
supported Google project. You are welcome to use it, but we do not
guarantee stability.**

## Setup

``` python
try:
  import ee_jupyter
  print('ee_jupyter was already installed.')
except ModuleNotFoundError:
  print('ee_jupyter was not found. Installing now...')
  import os
  result = os.system('pip -q install earthengine-jupyter')
```

    Make sure that the earthengine-jupyter package is installed...

## How to use

This lib contains a
[`Map`](https://googlestaging.github.io/earthengine-jupyter/ipyleaflet.html#map)
class that can be used to display an interactive map.

``` python
import ee
from ee_jupyter.core import authenticate_if_needed
from ee_jupyter.ipyleaflet import Map
```

``` python
authenticate_if_needed()
```

    ✓ Authentication credentials were found.

``` python
# Intialize the Earth Engine client library.
ee.Initialize()
```

``` python
map1 = Map(center=(37.5924, -122.09), zoom=8)
map1
```

    Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zo…

Define an Earth Engine image layer, and add it to the interactive map.

``` python
img1 = ee.Image("LANDSAT/LC09/C02/T1_L2/LC09_044034_20220127")
visualization = {
    'bands': ['SR_B4', 'SR_B3', 'SR_B2'],
    'min': 0.2 / 0.0000275,
    'max': 0.4 / 0.0000275,
}
map1.addLayer(eeObject=img1, visParams=visualization, name='Landsat scene')
```

We can also create an inspector object and associate it with the
previously created map.

``` python
from ee_jupyter.ipyleaflet import Inspector

inspector1 = Inspector(map_object=map1)
inspector1
```

    Inspector(layout=Layout(border_bottom='solid', border_left='solid', border_right='solid', border_top='solid', …

Typically when you create a inspector object, you will want to display
it near the map.

``` python
from ipywidgets import HBox

display(HBox([map1, inspector1]))
```

    HBox(children=(Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom…

<div>

> **Tip With Caption**
>
> Note that when viewed on GitHub Pages you can manipulate Jupyter
> widgets independently, but the widgets do not interact with each
> other. To experience the cross-widget interactivity, open up this
> notebook in a Jupyter environment.

</div>

# Displaying a Map Image

If you want to display a static (non-interactive) image, you can do that
as well. The `embed=True` parameter will allow the image to be saved
within the notebook.

``` python
from IPython.display import Image


visualization['dimensions'] = 400  # maximum dimension for the image
url = img1.getThumbUrl(visualization)

Image(url=url, format='png', embed=True)
```

![](index_files/figure-commonmark/cell-10-output-1.png)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/google/earthengine-jupyter",
    "name": "earthengine-jupyter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nbdev jupyter notebook python",
    "author": "tylere",
    "author_email": "tylere@google.com",
    "download_url": "https://files.pythonhosted.org/packages/b1/73/ed09241b420fb0e274d31e07a17474772dcab5051187eedaca330e788732/earthengine-jupyter-0.0.7.tar.gz",
    "platform": null,
    "description": "earthengine-jupyter\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n**NOTICE: This is an experimental project and is not an officially\nsupported Google project. You are welcome to use it, but we do not\nguarantee stability.**\n\n## Setup\n\n``` python\ntry:\n  import ee_jupyter\n  print('ee_jupyter was already installed.')\nexcept ModuleNotFoundError:\n  print('ee_jupyter was not found. Installing now...')\n  import os\n  result = os.system('pip -q install earthengine-jupyter')\n```\n\n    Make sure that the earthengine-jupyter package is installed...\n\n## How to use\n\nThis lib contains a\n[`Map`](https://googlestaging.github.io/earthengine-jupyter/ipyleaflet.html#map)\nclass that can be used to display an interactive map.\n\n``` python\nimport ee\nfrom ee_jupyter.core import authenticate_if_needed\nfrom ee_jupyter.ipyleaflet import Map\n```\n\n``` python\nauthenticate_if_needed()\n```\n\n    \u2713 Authentication credentials were found.\n\n``` python\n# Intialize the Earth Engine client library.\nee.Initialize()\n```\n\n``` python\nmap1 = Map(center=(37.5924, -122.09), zoom=8)\nmap1\n```\n\n    Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zo\u2026\n\nDefine an Earth Engine image layer, and add it to the interactive map.\n\n``` python\nimg1 = ee.Image(\"LANDSAT/LC09/C02/T1_L2/LC09_044034_20220127\")\nvisualization = {\n    'bands': ['SR_B4', 'SR_B3', 'SR_B2'],\n    'min': 0.2 / 0.0000275,\n    'max': 0.4 / 0.0000275,\n}\nmap1.addLayer(eeObject=img1, visParams=visualization, name='Landsat scene')\n```\n\nWe can also create an inspector object and associate it with the\npreviously created map.\n\n``` python\nfrom ee_jupyter.ipyleaflet import Inspector\n\ninspector1 = Inspector(map_object=map1)\ninspector1\n```\n\n    Inspector(layout=Layout(border_bottom='solid', border_left='solid', border_right='solid', border_top='solid', \u2026\n\nTypically when you create a inspector object, you will want to display\nit near the map.\n\n``` python\nfrom ipywidgets import HBox\n\ndisplay(HBox([map1, inspector1]))\n```\n\n    HBox(children=(Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom\u2026\n\n<div>\n\n> **Tip With Caption**\n>\n> Note that when viewed on GitHub Pages you can manipulate Jupyter\n> widgets independently, but the widgets do not interact with each\n> other. To experience the cross-widget interactivity, open up this\n> notebook in a Jupyter environment.\n\n</div>\n\n# Displaying a Map Image\n\nIf you want to display a static (non-interactive) image, you can do that\nas well. The `embed=True` parameter will allow the image to be saved\nwithin the notebook.\n\n``` python\nfrom IPython.display import Image\n\n\nvisualization['dimensions'] = 400  # maximum dimension for the image\nurl = img1.getThumbUrl(visualization)\n\nImage(url=url, format='png', embed=True)\n```\n\n![](index_files/figure-commonmark/cell-10-output-1.png)\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Tools for working with the Earth Engine from a Jupyter development environment",
    "version": "0.0.7",
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "0fb90f932071b3509554567e02843111",
                "sha256": "a942441016d3c9703c3d6a52b590ccee4f182bc3cfed015ec2c0161d62739883"
            },
            "downloads": -1,
            "filename": "earthengine_jupyter-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0fb90f932071b3509554567e02843111",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13514,
            "upload_time": "2022-11-30T04:01:13",
            "upload_time_iso_8601": "2022-11-30T04:01:13.468774Z",
            "url": "https://files.pythonhosted.org/packages/9d/bb/f75269b57393974f189115319f9a9bfde0f3efdf455305a836fde14e53c3/earthengine_jupyter-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ac5d472462456fc445db9e483a915b45",
                "sha256": "b0de4b7ef9574b56ef8229aa19ab062e5267a44c49bcfcf51145f81e991bfb21"
            },
            "downloads": -1,
            "filename": "earthengine-jupyter-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "ac5d472462456fc445db9e483a915b45",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12868,
            "upload_time": "2022-11-30T04:01:15",
            "upload_time_iso_8601": "2022-11-30T04:01:15.363550Z",
            "url": "https://files.pythonhosted.org/packages/b1/73/ed09241b420fb0e274d31e07a17474772dcab5051187eedaca330e788732/earthengine-jupyter-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-11-30 04:01:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "google",
    "github_project": "earthengine-jupyter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "earthengine-jupyter"
}
        
Elapsed time: 0.01258s