geemap


Namegeemap JSON
Version 0.16.2 PyPI version JSON
download
home_pagehttps://github.com/giswqs/geemap
SummaryA Python package for interactive mapping using Google Earth Engine and ipyleaflet
upload_time2022-08-04 19:23:35
maintainer
docs_urlNone
authorQiusheng Wu
requires_python>=3.7
licenseMIT license
keywords geemap
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ======
geemap
======

.. image:: https://colab.research.google.com/assets/colab-badge.svg
        :target: https://gishub.org/geemap-colab

.. image:: https://mybinder.org/badge_logo.svg
        :target: https://gishub.org/geemap-binder

.. image:: https://renkulab.io/renku-badge.svg
        :target: https://renkulab.io/projects/renku-stories/geemap/sessions/new?autostart=1

.. image:: https://img.shields.io/pypi/v/geemap.svg
        :target: https://pypi.python.org/pypi/geemap

.. image:: https://img.shields.io/conda/vn/conda-forge/geemap.svg
        :target: https://anaconda.org/conda-forge/geemap

.. image:: https://pepy.tech/badge/geemap
        :target: https://pepy.tech/project/geemap

.. image:: https://github.com/giswqs/geemap/workflows/docs/badge.svg
        :target: https://geemap.org

.. image:: https://img.shields.io/badge/YouTube-Channel-red   
        :target: https://www.youtube.com/c/QiushengWu

.. image:: https://img.shields.io/lgtm/grade/python/g/giswqs/geemap.svg?logo=lgtm&logoWidth=18
        :target: https://lgtm.com/projects/g/giswqs/geemap/context:python
        
.. image:: https://img.shields.io/twitter/follow/giswqs?style=social   	
        :target: https://twitter.com/giswqs

.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
        :target: https://opensource.org/licenses/MIT

.. image:: https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-yellowgreen.svg
        :target: https://www.buymeacoffee.com/giswqs

.. image:: https://joss.theoj.org/papers/10.21105/joss.02305/status.svg
        :target: https://joss.theoj.org/papers/10.21105/joss.02305

**A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and ipywidgets.**

* GitHub repo: https://github.com/giswqs/geemap
* Documentation: https://geemap.org
* PyPI: https://pypi.org/project/geemap/
* Conda-forge: https://anaconda.org/conda-forge/geemap
* 360+ GEE notebook examples: https://github.com/giswqs/earthengine-py-notebooks
* GEE Tutorials on YouTube: https://www.youtube.com/c/QiushengWu
* Free software: MIT license


**Contents**

- `Introduction`_
- `Features`_
- `Installation`_
- `Usage`_
- `Examples`_
- `Dependencies`_
- `Contributing`_
- `References`_
- `Credits`_


Introduction
------------

**geemap** is a Python package for interactive mapping with `Google Earth Engine <https://earthengine.google.com/>`__ (GEE), which is a cloud computing platform with a `multi-petabyte catalog <https://developers.google.com/earth-engine/datasets/>`__ of satellite imagery and geospatial datasets. During the past few years, 
GEE has become very popular in the geospatial community and it has empowered numerous environmental applications at local, regional, and global scales. GEE provides both JavaScript and Python APIs for 
making computational requests to the Earth Engine servers. Compared with the comprehensive `documentation <https://developers.google.com/earth-engine>`__ and interactive IDE (i.e., `GEE JavaScript Code Editor <https://code.earthengine.google.com/>`__) of the GEE JavaScript API, 
the GEE Python API has relatively little documentation and limited functionality for visualizing results interactively. The **geemap** Python package was created to fill this gap. It is built upon `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__ and `ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`__, and enables users to 
analyze and visualize Earth Engine datasets interactively within a Jupyter-based environment.

**geemap** is intended for students and researchers, who would like to utilize the Python ecosystem of diverse libraries and tools to explore Google Earth Engine. It is also designed for existing GEE users who would like to transition from the GEE JavaScript API to Python API. The automated JavaScript-to-Python `conversion module <https://github.com/giswqs/geemap/blob/master/geemap/conversion.py>`__ of the **geemap** package
can greatly reduce the time needed to convert existing GEE JavaScripts to Python scripts and Jupyter notebooks.

For video tutorials and notebook examples, please visit `<https://geemap.org/tutorials>`__. For complete documentation on geemap modules and methods, please visit `<https://geemap.org/geemap>`_.

If you find geemap useful in your research, please consider citing the following papers to support my work. Thank you for your support.

- Wu, Q., (2020). geemap: A Python package for interactive mapping with Google Earth Engine. *The Journal of Open Source Software*, 5(51), 2305. `<https://doi.org/10.21105/joss.02305>`__ 
- Wu, Q., Lane, C. R., Li, X., Zhao, K., Zhou, Y., Clinton, N., DeVries, B., Golden, H. E., & Lang, M. W. (2019). Integrating LiDAR data and multi-temporal aerial imagery to map wetland inundation dynamics using Google Earth Engine. *Remote Sensing of Environment*, 228, 1-13. https://doi.org/10.1016/j.rse.2019.04.015 (`pdf <https://gishub.org/2019_rse>`_ | `source code <https://doi.org/10.6084/m9.figshare.8864921>`_)

Check out the geemap workshop I presented at the GeoPython Conference 2021. This workshop gives a comprehensive introduction to the key features of geemap. 

.. image:: https://img.youtube.com/vi/wGjpjh9IQ5I/0.jpg
        :target: https://www.youtube.com/watch?v=wGjpjh9IQ5I

Features
--------

Below is a partial list of features available for the geemap package. Please check the `examples <https://github.com/giswqs/geemap/tree/master/examples>`__ page for notebook examples, GIF animations, and video tutorials.

* Convert Earth Engine JavaScripts to Python scripts and Jupyter notebooks.
* Display Earth Engine data layers for interactive mapping.
* Support Earth Engine JavaScript API-styled functions in Python, such as `Map.addLayer()`, `Map.setCenter()`, `Map.centerObject()`, `Map.setOptions()`.
* Create split-panel maps with Earth Engine data.
* Retrieve Earth Engine data interactively using the Inspector Tool.
* Interactive plotting of Earth Engine data by simply clicking on the map.
* Convert data format between GeoJSON and Earth Engine.
* Use drawing tools to interact with Earth Engine data.
* Use shapefiles with Earth Engine without having to upload data to one's GEE account.
* Export Earth Engine FeatureCollection to other formats (i.e., shp, csv, json, kml, kmz).
* Export Earth Engine Image and ImageCollection as GeoTIFF.
* Extract pixels from an Earth Engine Image into a 3D numpy array.
* Calculate zonal statistics by group.
* Add a customized legend for Earth Engine data.
* Convert Earth Engine JavaScripts to Python code directly within Jupyter notebook.
* Add animated text to GIF images generated from Earth Engine data.
* Add colorbar and images to GIF animations generated from Earth Engine data.
* Create Landsat timelapse animations with animated text using Earth Engine.
* Search places and datasets from Earth Engine Data Catalog.
* Use timeseries inspector to visualize landscape changes over time.
* Export Earth Engine maps as HTML files and PNG images.
* Search Earth Engine API documentation within Jupyter notebooks.
* Import Earth Engine assets from personal account.
* Publish interactive GEE maps directly within Jupyter notebook.
* Add local raster datasets (e.g., GeoTIFF) to the map.
* Perform image classification and accuracy assessment.
* Extract pixel values interactively and export as shapefile and csv.


Installation
------------

To use **geemap**, you must first `sign up <https://earthengine.google.com/signup/>`__ for a `Google Earth Engine <https://earthengine.google.com/>`__ account.

.. image:: https://i.imgur.com/ng0FzUT.png
        :target: https://earthengine.google.com

**geemap** is available on `PyPI <https://pypi.org/project/geemap/>`__. To install **geemap**, run this command in your terminal:

.. code:: python

  pip install geemap


**geemap** is also available on `conda-forge <https://anaconda.org/conda-forge/geemap>`__. If you have `Anaconda <https://www.anaconda.com/distribution/#download-section>`__ or `Miniconda <https://docs.conda.io/en/latest/miniconda.html>`__ installed on your computer, you can create a conda Python environment to install geemap:

.. code:: python

  conda create -n gee python=3.9
  conda activate gee
  conda install geopandas
  conda install mamba -c conda-forge
  mamba install geemap localtileserver -c conda-forge 

Optionally, you can install `Jupyter notebook extensions <https://github.com/ipython-contrib/jupyter_contrib_nbextensions>`__, which can improve your productivity in the notebook environment. Some useful extensions include Table of Contents, Gist-it, Autopep8, Variable Inspector, etc. See this `post <https://towardsdatascience.com/jupyter-notebook-extensions-517fa69d2231>`__ for more information.       

.. code:: python

  conda install jupyter_contrib_nbextensions -c conda-forge 


If you have installed **geemap** before and want to upgrade to the latest version, you can run the following command in your terminal:

.. code:: python

  pip install -U geemap


If you use conda, you can update geemap to the latest version by running the following command in your terminal:
  
.. code:: python

  conda update -c conda-forge geemap


To install the development version from GitHub using `Git <https://git-scm.com/>`__, run the following command in your terminal:

.. code:: python

  pip install git+https://github.com/giswqs/geemap


To install the development version from GitHub directly within Jupyter notebook without using Git, run the following code:

.. code:: python

  import geemap
  geemap.update_package()
  
To use geemap in a Docker container, check out the following docker containers with geemap installed.

*   `gee-community/ee-jupyter-contrib <https://github.com/gee-community/ee-jupyter-contrib/tree/master/docker/gcp_ai_deep_learning_platform>`__
*   `bkavlak/geemap <https://hub.docker.com/r/bkavlak/geemap>`__
*   `giswqs/geemap <https://hub.docker.com/r/giswqs/geemap>`__

To use geemap in a Docker container, check out `ee-jupyter-contrib <https://github.com/gee-community/ee-jupyter-contrib/tree/master/docker/gcp_ai_deep_learning_platform>`__ or this `page <https://hub.docker.com/r/bkavlak/geemap>`__.


Usage
-----

**Important note:** A key difference between `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__ and `folium <https://github.com/python-visualization/folium>`__ is that ipyleaflet is built upon ipywidgets and allows bidirectional
communication between the front-end and the backend enabling the use of the map to capture user input, while folium is meant for displaying
static data only (`source <https://blog.jupyter.org/interactive-gis-in-jupyter-with-ipyleaflet-52f9657fa7a>`__).
Note that `Google Colab <https://colab.research.google.com/>`__ currently does not support ipyleaflet
(`source <https://github.com/googlecolab/colabtools/issues/60#issuecomment-596225619>`__). Therefore, if you are using geemap with Google Colab, you should use
`import geemap.foliumap <https://github.com/giswqs/geemap/blob/master/geemap/foliumap.py>`__. If you are using geemap with `binder <https://mybinder.org/>`__ or a local Jupyter notebook server,
you can use `import geemap <https://github.com/giswqs/geemap/blob/master/geemap/geemap.py>`__, which provides more functionalities for capturing user input (e.g.,
mouse-clicking and moving).

More GEE Tutorials are available on my `YouTube channel <https://www.youtube.com/c/QiushengWu>`__.

|YouTube|

.. |YouTube| image:: https://wetlands.io/file/images/youtube.png
   :target: https://www.youtube.com/c/QiushengWu

To create an ipyleaflet-based interactive map:

.. code:: python

  import geemap
  Map = geemap.Map(center=[40,-100], zoom=4)
  Map


To create a folium-based interactive map:

.. code:: python

  import geemap.foliumap as geemap
  Map = geemap.Map(center=[40,-100], zoom=4)
  Map


To add an Earth Engine data layer to the Map:

.. code:: python

  Map.addLayer(ee_object, vis_params, name, shown, opacity)


To center the map view at a given coordinates with the given zoom level:

.. code:: python

  Map.setCenter(lon, lat, zoom)


To center the map view around an Earth Engine object:

.. code:: python

  Map.centerObject(ee_object, zoom)


To add LayerControl to a folium-based Map:

.. code:: python

  Map.addLayerControl()


To add a minimap (overview) to an ipyleaflet-based Map:

.. code:: python

  Map.add_minimap()


To add additional basemaps to the Map:

.. code:: python

  Map.add_basemap('Esri Ocean')
  Map.add_basemap('Esri National Geographic')


To add an XYZ tile layer to the Map:

.. code:: python

  url = 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}'
  Map.add_tile_layer(url, name='Google Map', attribution='Google')


To add a WMS layer to the Map:

.. code:: python

  naip_url = 'https://services.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer?'
  Map.add_wms_layer(url=naip_url, layers='0', name='NAIP Imagery', format='image/png', shown=True)


To convert a shapefile to Earth Engine object and add it to the Map:

.. code:: python

  ee_object = geemap.shp_to_ee(shp_file_path)
  Map.addLayer(ee_object, {}, 'Layer name')


To convert a GeoJSON file to Earth Engine object and add it to the Map:

.. code:: python

  ee_object = geemap.geojson_to_ee(geojson_file_path)
  Map.addLayer(ee_object, {}, 'Layer name')


To download an ee.FeatureCollection as a shapefile:

.. code:: python

  geemap.ee_to_csv(ee_object, filename, selectors)


To export an ee.FeatureCollection to other formats, including shp, csv, json, kml, and kmz:

.. code:: python

  geemap.ee_export_vector(ee_object, filename, selectors)


To export an ee.Image as a GeoTIFF file:

.. code:: python

  geemap.ee_export_image(ee_object, filename, scale, crs, region, file_per_band)


To export an ee.ImageCollection as GeoTIFF files:

.. code:: python

  geemap.ee_export_image_collection(ee_object, output, scale, crs, region, file_per_band)


To extract pixels from an ee.Image into a 3D numpy array:

.. code:: python

  geemap.ee_to_numpy(ee_object, bands, region, properties, default_value)

To import a 2D or 3D numpy array to an ee.Image using a given base coordinate reference system (crs) and transform between projected coordinates and the base:

.. code:: python

  geemap.numpy_to_ee(np_array, crs, transform, transformWkt, band_names)

To import one or more variables from a netCDF file with a regular grid in EPSG:4326 to an ee.Image:

.. code:: python

  geemap.netcdf_to_ee(nc_file, var_names, band_names, lon='lon', lat='lat')

To calculate zonal statistics:

.. code:: python

  geemap.zonal_statistics(in_value_raster, in_zone_vector, out_file_path, statistics_type='MEAN')


To calculate zonal statistics by group:

.. code:: python

  geemap.zonal_statistics_by_group(in_value_raster, in_zone_vector, out_file_path, statistics_type='SUM')


To create a split-panel Map:

.. code:: python

  Map.split_map(left_layer='HYBRID', right_layer='ESRI')


To add a marker cluster to the Map:

.. code:: python

  Map.marker_cluster()
  feature_collection = ee.FeatureCollection(Map.ee_markers)


To add a customized legend to the Map:

.. code:: python

  legend_dict = {
      'one': (0, 0, 0),
      'two': (255,255,0),
      'three': (127, 0, 127)
  }
  Map.add_legend(legend_title='Legend', legend_dict=legend_dict, position='bottomright')
  Map.add_legend(builtin_legend='NLCD')


To download a GIF from an Earth Engine ImageCollection:

.. code:: python

  geemap.download_ee_video(tempCol, videoArgs, saved_gif)


To add animated text to an existing GIF image:

.. code:: python

  geemap.add_text_to_gif(in_gif, out_gif, xy=('5%', '5%'), text_sequence=1984, font_size=30, font_color='#0000ff', duration=100)


To create a colorbar for an Earth Engine image:

.. code:: python

  palette = ['blue', 'purple', 'cyan', 'green', 'yellow', 'red']
  create_colorbar(width=250, height=30, palette=palette, vertical=False,add_labels=True, font_size=20, labels=[-40, 35])


To create a Landsat timelapse animation and add it to the Map:

.. code:: python

  Map.add_landsat_ts_gif(label='Place name', start_year=1985, bands=['NIR', 'Red', 'Green'], frames_per_second=5)


To convert all GEE JavaScripts in a folder recursively to Python scripts:

.. code:: python

  from geemap.conversion import *
  js_to_python_dir(in_dir, out_dir)


To convert all GEE Python scripts in a folder recursively to Jupyter notebooks:  

.. code:: python

  from geemap.conversion import *
  template_file = get_nb_template()
  py_to_ipynb_dir(in_dir, template_file, out_dir)


To execute all Jupyter notebooks in a folder recursively and save output cells:  

.. code:: python

  from geemap.conversion import *
  execute_notebook_dir(in_dir) 


To search Earth Engine API documentation with Jupyter notebooks:  

.. code:: python

  import geemap
  geemap.ee_search()


To publish an interactive GEE map with Jupyter notebooks:  

.. code:: python

  Map.publish(name, headline, visibility)


To add a local raster dataset to the map:  

.. code:: python

  Map.add_raster(image, bands, colormap, layer_name)
  

To get image basic properties:

.. code:: python

  geemap.image_props(image).getInfo()


To get image descriptive statistics:

.. code:: python

  geemap.image_stats(image, region, scale)


To remove all user-drawn geometries:

.. code:: python

  geemap.remove_drawn_features()


To extract pixel values based on user-drawn geometries:

.. code:: python

  geemap.extract_values_to_points(out_shp)


To load a Cloud Optimized GeoTIFF as an ee.Image:

.. code:: python

  image = geemap.load_GeoTIFF(URL)


To load a list of Cloud Optimized GeoTIFFs as an ee.ImageCollection:

.. code:: python

  collection = geemap.load_GeoTIFFs(URLs)


Examples
--------

The following examples require the geemap package, which can be installed using ``pip install geemap``. Check the `Installation`_ section for more information. More examples can be found at 
another repo: `A collection of 300+ Jupyter Python notebook examples for using Google Earth Engine with interactive mapping <https://github.com/giswqs/earthengine-py-notebooks>`__.

- `Converting GEE JavaScripts to Python scripts and Jupyter notebooks`_
- `Interactive mapping using GEE Python API and geemap`_

Converting GEE JavaScripts to Python scripts and Jupyter notebooks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Launch an interactive notebook with **Google Colab**. Keep in mind that the conversion might not always work perfectly. Additional manual changes might still be needed. ``ui`` and ``chart`` are not supported. 
The source code for this automated conversion module can be found at `conversion.py <https://github.com/giswqs/geemap/blob/master/geemap/conversion.py>`__.

.. image:: https://colab.research.google.com/assets/colab-badge.svg
        :target: https://colab.research.google.com/github/giswqs/geemap/blob/master/examples/notebooks/08_ee_js_to_ipynb.ipynb


.. code:: python

        import os
        from geemap.conversion import *

        # Create a temporary working directory
        work_dir = os.path.join(os.path.expanduser('~'), 'geemap')
        # Get Earth Engine JavaScript examples. There are five examples in the geemap package folder. 
        # Change js_dir to your own folder containing your Earth Engine JavaScripts, such as js_dir = '/path/to/your/js/folder'
        js_dir = get_js_examples(out_dir=work_dir) 

        # Convert all Earth Engine JavaScripts in a folder recursively to Python scripts.
        js_to_python_dir(in_dir=js_dir, out_dir=js_dir, use_qgis=True)
        print("Python scripts saved at: {}".format(js_dir))

        # Convert all Earth Engine Python scripts in a folder recursively to Jupyter notebooks.
        nb_template = get_nb_template()  # Get the notebook template from the package folder.
        py_to_ipynb_dir(js_dir, nb_template)

        # Execute all Jupyter notebooks in a folder recursively and save the output cells.
        execute_notebook_dir(in_dir=js_dir)


.. image:: https://i.imgur.com/8bedWtl.gif



Interactive mapping using GEE Python API and geemap
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Launch an interactive notebook with **Google Colab**. Note that **Google Colab** currently does not support ipyleaflet. Therefore, you should use ``import geemap.foliumap`` instead of ``import geemap``.

.. image:: https://colab.research.google.com/assets/colab-badge.svg
        :target: https://colab.research.google.com/github/giswqs/geemap/blob/master/examples/notebooks/geemap_and_folium.ipynb

.. code:: python

        # Installs geemap package
        import subprocess

        try:
                import geemap
        except ImportError:
                print('geemap package not installed. Installing ...')
                subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])

        # Checks whether this notebook is running on Google Colab
        try:
                import google.colab
                import geemap.foliumap as emap
        except:
                import geemap as emap

        # Authenticates and initializes Earth Engine
        import ee

        try:
                ee.Initialize()
        except Exception as e:
                ee.Authenticate()
                ee.Initialize()

        # Creates an interactive map
        Map = emap.Map(center=[40,-100], zoom=4)

        # Adds Earth Engine dataset
        image = ee.Image('USGS/SRTMGL1_003')

        # Sets visualization parameters.
        vis_params = {
                'min': 0,
                'max': 4000,
                'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}

        # Prints the elevation of Mount Everest.
        xy = ee.Geometry.Point([86.9250, 27.9881])
        elev = image.sample(xy, 30).first().get('elevation').getInfo()
        print('Mount Everest elevation (m):', elev)

        # Adds Earth Engine layers to Map
        Map.addLayer(image, vis_params, 'SRTM DEM', True, 0.5)
        Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')
        Map.setCenter(100, 40, 4)
        # Map.centerObject(xy, 13)

        # Display the Map
        Map.addLayerControl()
        Map


.. image:: https://i.imgur.com/7NMQw6I.gif

Dependencies
------------

* `bqplot <https://github.com/bloomberg/bqplot>`__
* `colour <https://github.com/vaab/colour>`__
* `earthengine-api <https://github.com/google/earthengine-api>`__
* `folium <https://github.com/python-visualization/folium>`__
* `geeadd <https://github.com/samapriya/gee_asset_manager_addon>`__
* `geocoder <https://github.com/DenisCarriere/geocoder>`__
* `ipyfilechooser <https://github.com/crahan/ipyfilechooser>`__
* `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__
* `ipynb-py-convert <https://github.com/kiwi0fruit/ipynb-py-convert>`__
* `ipytree <https://github.com/QuantStack/ipytree>`__
* `ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`__
* `mss <https://github.com/BoboTiG/python-mss>`__
* `pillow <https://github.com/python-pillow/Pillow>`__
* `pyshp <https://github.com/GeospatialPython/pyshp>`__
* `xarray-leaflet <https://github.com/davidbrochart/xarray_leaflet>`__



Contributing
------------
Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Report Bugs
^^^^^^^^^^^

Report bugs at https://github.com/giswqs/geemap/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
^^^^^^^^

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

Implement Features
^^^^^^^^^^^^^^^^^^

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

Write Documentation
^^^^^^^^^^^^^^^^^^^

geemap could always use more documentation, whether as part of the
official geemap docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
^^^^^^^^^^^^^^^

The best way to send feedback is to file an issue at https://github.com/giswqs/geemap/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
  are welcome :)

Get Started!
^^^^^^^^^^^^

Ready to contribute? Here's how to set up `geemap` for local development.

1. Fork the `geemap` repo on GitHub.
2. Clone your fork locally::

    $ git clone git@github.com:your_name_here/geemap.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

    $ mkvirtualenv geemap
    $ cd geemap/
    $ python setup.py develop

4. Create a branch for local development::

    $ git checkout -b name-of-your-bugfix-or-feature

   Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
   tests, including testing other Python versions with tox::

    $ flake8 geemap tests
    $ python setup.py test or pytest
    $ tox

   To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.

Pull Request Guidelines
^^^^^^^^^^^^^^^^^^^^^^^

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
   your new functionality into a function with a docstring, and add the
   feature to the list in README.rst.
3. The pull request should work for Python 3.6, 3.7 and 3.8, and for PyPy. Check
   https://travis-ci.com/giswqs/geemap/pull_requests
   and make sure that the tests pass for all supported Python versions.

Tips
^^^^

To run a subset of tests::


    $ python -m unittest tests.test_geemap
    

Deploying
^^^^^^^^^

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::

$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags

Travis will then deploy to PyPI if tests pass.


References
----------

To support my work, please consider citing the following articles:

- **Wu, Q.**, (2020). geemap: A Python package for interactive mapping with Google Earth Engine. *The Journal of Open Source Software*, 5(51), 2305. https://doi.org/10.21105/joss.02305 
- **Wu, Q.**, Lane, C. R., Li, X., Zhao, K., Zhou, Y., Clinton, N., DeVries, B., Golden, H. E., & Lang, M. W. (2019). Integrating LiDAR data and multi-temporal aerial imagery to map wetland inundation dynamics using Google Earth Engine. *Remote Sensing of Environment*, 228, 1-13. https://doi.org/10.1016/j.rse.2019.04.015 (`pdf <https://gishub.org/2019_rse>`_ | `source code <https://doi.org/10.6084/m9.figshare.8864921>`_)


Credits
-------

This package was created with `Cookiecutter <https://github.com/cookiecutter/cookiecutter>`__ and the `audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage>`__ project template.


.. image:: https://badges.gitter.im/geemap/community.svg
   :alt: Join the chat at https://gitter.im/geemap/community
   :target: https://gitter.im/geemap/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge


=======
History
=======
0.7.0 (2020-05-22)
------------------
0.6.0 (2020-04-05)
------------------
0.5.0 (2020-03-24)
------------------
0.4.0 (2020-03-19)
------------------
0.3.0 (2020-03-18)
------------------
0.2.0 (2020-03-17)
------------------
0.1.0 (2020-03-08)
------------------

* First release on PyPI.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/giswqs/geemap",
    "name": "geemap",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "geemap",
    "author": "Qiusheng Wu",
    "author_email": "giswqs@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c6/6b/378a6b5e18292136afb3e41a3ac9b7c974a9d13a95d03b9fabef52af6836/geemap-0.16.2.tar.gz",
    "platform": null,
    "description": "======\ngeemap\n======\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n        :target: https://gishub.org/geemap-colab\n\n.. image:: https://mybinder.org/badge_logo.svg\n        :target: https://gishub.org/geemap-binder\n\n.. image:: https://renkulab.io/renku-badge.svg\n        :target: https://renkulab.io/projects/renku-stories/geemap/sessions/new?autostart=1\n\n.. image:: https://img.shields.io/pypi/v/geemap.svg\n        :target: https://pypi.python.org/pypi/geemap\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/geemap.svg\n        :target: https://anaconda.org/conda-forge/geemap\n\n.. image:: https://pepy.tech/badge/geemap\n        :target: https://pepy.tech/project/geemap\n\n.. image:: https://github.com/giswqs/geemap/workflows/docs/badge.svg\n        :target: https://geemap.org\n\n.. image:: https://img.shields.io/badge/YouTube-Channel-red   \n        :target: https://www.youtube.com/c/QiushengWu\n\n.. image:: https://img.shields.io/lgtm/grade/python/g/giswqs/geemap.svg?logo=lgtm&logoWidth=18\n        :target: https://lgtm.com/projects/g/giswqs/geemap/context:python\n        \n.. image:: https://img.shields.io/twitter/follow/giswqs?style=social   \t\n        :target: https://twitter.com/giswqs\n\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\n        :target: https://opensource.org/licenses/MIT\n\n.. image:: https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-yellowgreen.svg\n        :target: https://www.buymeacoffee.com/giswqs\n\n.. image:: https://joss.theoj.org/papers/10.21105/joss.02305/status.svg\n        :target: https://joss.theoj.org/papers/10.21105/joss.02305\n\n**A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and ipywidgets.**\n\n* GitHub repo: https://github.com/giswqs/geemap\n* Documentation: https://geemap.org\n* PyPI: https://pypi.org/project/geemap/\n* Conda-forge: https://anaconda.org/conda-forge/geemap\n* 360+ GEE notebook examples: https://github.com/giswqs/earthengine-py-notebooks\n* GEE Tutorials on YouTube: https://www.youtube.com/c/QiushengWu\n* Free software: MIT license\n\n\n**Contents**\n\n- `Introduction`_\n- `Features`_\n- `Installation`_\n- `Usage`_\n- `Examples`_\n- `Dependencies`_\n- `Contributing`_\n- `References`_\n- `Credits`_\n\n\nIntroduction\n------------\n\n**geemap** is a Python package for interactive mapping with `Google Earth Engine <https://earthengine.google.com/>`__ (GEE), which is a cloud computing platform with a `multi-petabyte catalog <https://developers.google.com/earth-engine/datasets/>`__ of satellite imagery and geospatial datasets. During the past few years, \nGEE has become very popular in the geospatial community and it has empowered numerous environmental applications at local, regional, and global scales. GEE provides both JavaScript and Python APIs for \nmaking computational requests to the Earth Engine servers. Compared with the comprehensive `documentation <https://developers.google.com/earth-engine>`__ and interactive IDE (i.e., `GEE JavaScript Code Editor <https://code.earthengine.google.com/>`__) of the GEE JavaScript API, \nthe GEE Python API has relatively little documentation and limited functionality for visualizing results interactively. The **geemap** Python package was created to fill this gap. It is built upon `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__ and `ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`__, and enables users to \nanalyze and visualize Earth Engine datasets interactively within a Jupyter-based environment.\n\n**geemap** is intended for students and researchers, who would like to utilize the Python ecosystem of diverse libraries and tools to explore Google Earth Engine. It is also designed for existing GEE users who would like to transition from the GEE JavaScript API to Python API. The automated JavaScript-to-Python `conversion module <https://github.com/giswqs/geemap/blob/master/geemap/conversion.py>`__ of the **geemap** package\ncan greatly reduce the time needed to convert existing GEE JavaScripts to Python scripts and Jupyter notebooks.\n\nFor video tutorials and notebook examples, please visit `<https://geemap.org/tutorials>`__. For complete documentation on geemap modules and methods, please visit `<https://geemap.org/geemap>`_.\n\nIf you find geemap useful in your research, please consider citing the following papers to support my work. Thank you for your support.\n\n- Wu, Q., (2020). geemap: A Python package for interactive mapping with Google Earth Engine. *The Journal of Open Source Software*, 5(51), 2305. `<https://doi.org/10.21105/joss.02305>`__ \n- Wu, Q., Lane, C. R., Li, X., Zhao, K., Zhou, Y., Clinton, N., DeVries, B., Golden, H. E., & Lang, M. W. (2019). Integrating LiDAR data and multi-temporal aerial imagery to map wetland inundation dynamics using Google Earth Engine. *Remote Sensing of Environment*, 228, 1-13. https://doi.org/10.1016/j.rse.2019.04.015 (`pdf <https://gishub.org/2019_rse>`_ | `source code <https://doi.org/10.6084/m9.figshare.8864921>`_)\n\nCheck out the geemap workshop I presented at the GeoPython Conference 2021. This workshop gives a comprehensive introduction to the key features of geemap. \n\n.. image:: https://img.youtube.com/vi/wGjpjh9IQ5I/0.jpg\n        :target: https://www.youtube.com/watch?v=wGjpjh9IQ5I\n\nFeatures\n--------\n\nBelow is a partial list of features available for the geemap package. Please check the `examples <https://github.com/giswqs/geemap/tree/master/examples>`__ page for notebook examples, GIF animations, and video tutorials.\n\n* Convert Earth Engine JavaScripts to Python scripts and Jupyter notebooks.\n* Display Earth Engine data layers for interactive mapping.\n* Support Earth Engine JavaScript API-styled functions in Python, such as `Map.addLayer()`, `Map.setCenter()`, `Map.centerObject()`, `Map.setOptions()`.\n* Create split-panel maps with Earth Engine data.\n* Retrieve Earth Engine data interactively using the Inspector Tool.\n* Interactive plotting of Earth Engine data by simply clicking on the map.\n* Convert data format between GeoJSON and Earth Engine.\n* Use drawing tools to interact with Earth Engine data.\n* Use shapefiles with Earth Engine without having to upload data to one's GEE account.\n* Export Earth Engine FeatureCollection to other formats (i.e., shp, csv, json, kml, kmz).\n* Export Earth Engine Image and ImageCollection as GeoTIFF.\n* Extract pixels from an Earth Engine Image into a 3D numpy array.\n* Calculate zonal statistics by group.\n* Add a customized legend for Earth Engine data.\n* Convert Earth Engine JavaScripts to Python code directly within Jupyter notebook.\n* Add animated text to GIF images generated from Earth Engine data.\n* Add colorbar and images to GIF animations generated from Earth Engine data.\n* Create Landsat timelapse animations with animated text using Earth Engine.\n* Search places and datasets from Earth Engine Data Catalog.\n* Use timeseries inspector to visualize landscape changes over time.\n* Export Earth Engine maps as HTML files and PNG images.\n* Search Earth Engine API documentation within Jupyter notebooks.\n* Import Earth Engine assets from personal account.\n* Publish interactive GEE maps directly within Jupyter notebook.\n* Add local raster datasets (e.g., GeoTIFF) to the map.\n* Perform image classification and accuracy assessment.\n* Extract pixel values interactively and export as shapefile and csv.\n\n\nInstallation\n------------\n\nTo use **geemap**, you must first `sign up <https://earthengine.google.com/signup/>`__ for a `Google Earth Engine <https://earthengine.google.com/>`__ account.\n\n.. image:: https://i.imgur.com/ng0FzUT.png\n        :target: https://earthengine.google.com\n\n**geemap** is available on `PyPI <https://pypi.org/project/geemap/>`__. To install **geemap**, run this command in your terminal:\n\n.. code:: python\n\n  pip install geemap\n\n\n**geemap** is also available on `conda-forge <https://anaconda.org/conda-forge/geemap>`__. If you have `Anaconda <https://www.anaconda.com/distribution/#download-section>`__ or `Miniconda <https://docs.conda.io/en/latest/miniconda.html>`__ installed on your computer, you can create a conda Python environment to install geemap:\n\n.. code:: python\n\n  conda create -n gee python=3.9\n  conda activate gee\n  conda install geopandas\n  conda install mamba -c conda-forge\n  mamba install geemap localtileserver -c conda-forge \n\nOptionally, you can install `Jupyter notebook extensions <https://github.com/ipython-contrib/jupyter_contrib_nbextensions>`__, which can improve your productivity in the notebook environment. Some useful extensions include Table of Contents, Gist-it, Autopep8, Variable Inspector, etc. See this `post <https://towardsdatascience.com/jupyter-notebook-extensions-517fa69d2231>`__ for more information.       \n\n.. code:: python\n\n  conda install jupyter_contrib_nbextensions -c conda-forge \n\n\nIf you have installed **geemap** before and want to upgrade to the latest version, you can run the following command in your terminal:\n\n.. code:: python\n\n  pip install -U geemap\n\n\nIf you use conda, you can update geemap to the latest version by running the following command in your terminal:\n  \n.. code:: python\n\n  conda update -c conda-forge geemap\n\n\nTo install the development version from GitHub using `Git <https://git-scm.com/>`__, run the following command in your terminal:\n\n.. code:: python\n\n  pip install git+https://github.com/giswqs/geemap\n\n\nTo install the development version from GitHub directly within Jupyter notebook without using Git, run the following code:\n\n.. code:: python\n\n  import geemap\n  geemap.update_package()\n  \nTo use geemap in a Docker container, check out the following docker containers with geemap installed.\n\n*   `gee-community/ee-jupyter-contrib <https://github.com/gee-community/ee-jupyter-contrib/tree/master/docker/gcp_ai_deep_learning_platform>`__\n*   `bkavlak/geemap <https://hub.docker.com/r/bkavlak/geemap>`__\n*   `giswqs/geemap <https://hub.docker.com/r/giswqs/geemap>`__\n\nTo use geemap in a Docker container, check out `ee-jupyter-contrib <https://github.com/gee-community/ee-jupyter-contrib/tree/master/docker/gcp_ai_deep_learning_platform>`__ or this `page <https://hub.docker.com/r/bkavlak/geemap>`__.\n\n\nUsage\n-----\n\n**Important note:** A key difference between `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__ and `folium <https://github.com/python-visualization/folium>`__ is that ipyleaflet is built upon ipywidgets and allows bidirectional\ncommunication between the front-end and the backend enabling the use of the map to capture user input, while folium is meant for displaying\nstatic data only (`source <https://blog.jupyter.org/interactive-gis-in-jupyter-with-ipyleaflet-52f9657fa7a>`__).\nNote that `Google Colab <https://colab.research.google.com/>`__ currently does not support ipyleaflet\n(`source <https://github.com/googlecolab/colabtools/issues/60#issuecomment-596225619>`__). Therefore, if you are using geemap with Google Colab, you should use\n`import geemap.foliumap <https://github.com/giswqs/geemap/blob/master/geemap/foliumap.py>`__. If you are using geemap with `binder <https://mybinder.org/>`__ or a local Jupyter notebook server,\nyou can use `import geemap <https://github.com/giswqs/geemap/blob/master/geemap/geemap.py>`__, which provides more functionalities for capturing user input (e.g.,\nmouse-clicking and moving).\n\nMore GEE Tutorials are available on my `YouTube channel <https://www.youtube.com/c/QiushengWu>`__.\n\n|YouTube|\n\n.. |YouTube| image:: https://wetlands.io/file/images/youtube.png\n   :target: https://www.youtube.com/c/QiushengWu\n\nTo create an ipyleaflet-based interactive map:\n\n.. code:: python\n\n  import geemap\n  Map = geemap.Map(center=[40,-100], zoom=4)\n  Map\n\n\nTo create a folium-based interactive map:\n\n.. code:: python\n\n  import geemap.foliumap as geemap\n  Map = geemap.Map(center=[40,-100], zoom=4)\n  Map\n\n\nTo add an Earth Engine data layer to the Map:\n\n.. code:: python\n\n  Map.addLayer(ee_object, vis_params, name, shown, opacity)\n\n\nTo center the map view at a given coordinates with the given zoom level:\n\n.. code:: python\n\n  Map.setCenter(lon, lat, zoom)\n\n\nTo center the map view around an Earth Engine object:\n\n.. code:: python\n\n  Map.centerObject(ee_object, zoom)\n\n\nTo add LayerControl to a folium-based Map:\n\n.. code:: python\n\n  Map.addLayerControl()\n\n\nTo add a minimap (overview) to an ipyleaflet-based Map:\n\n.. code:: python\n\n  Map.add_minimap()\n\n\nTo add additional basemaps to the Map:\n\n.. code:: python\n\n  Map.add_basemap('Esri Ocean')\n  Map.add_basemap('Esri National Geographic')\n\n\nTo add an XYZ tile layer to the Map:\n\n.. code:: python\n\n  url = 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}'\n  Map.add_tile_layer(url, name='Google Map', attribution='Google')\n\n\nTo add a WMS layer to the Map:\n\n.. code:: python\n\n  naip_url = 'https://services.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer?'\n  Map.add_wms_layer(url=naip_url, layers='0', name='NAIP Imagery', format='image/png', shown=True)\n\n\nTo convert a shapefile to Earth Engine object and add it to the Map:\n\n.. code:: python\n\n  ee_object = geemap.shp_to_ee(shp_file_path)\n  Map.addLayer(ee_object, {}, 'Layer name')\n\n\nTo convert a GeoJSON file to Earth Engine object and add it to the Map:\n\n.. code:: python\n\n  ee_object = geemap.geojson_to_ee(geojson_file_path)\n  Map.addLayer(ee_object, {}, 'Layer name')\n\n\nTo download an ee.FeatureCollection as a shapefile:\n\n.. code:: python\n\n  geemap.ee_to_csv(ee_object, filename, selectors)\n\n\nTo export an ee.FeatureCollection to other formats, including shp, csv, json, kml, and kmz:\n\n.. code:: python\n\n  geemap.ee_export_vector(ee_object, filename, selectors)\n\n\nTo export an ee.Image as a GeoTIFF file:\n\n.. code:: python\n\n  geemap.ee_export_image(ee_object, filename, scale, crs, region, file_per_band)\n\n\nTo export an ee.ImageCollection as GeoTIFF files:\n\n.. code:: python\n\n  geemap.ee_export_image_collection(ee_object, output, scale, crs, region, file_per_band)\n\n\nTo extract pixels from an ee.Image into a 3D numpy array:\n\n.. code:: python\n\n  geemap.ee_to_numpy(ee_object, bands, region, properties, default_value)\n\nTo import a 2D or 3D numpy array to an ee.Image using a given base coordinate reference system (crs) and transform between projected coordinates and the base:\n\n.. code:: python\n\n  geemap.numpy_to_ee(np_array, crs, transform, transformWkt, band_names)\n\nTo import one or more variables from a netCDF file with a regular grid in EPSG:4326 to an ee.Image:\n\n.. code:: python\n\n  geemap.netcdf_to_ee(nc_file, var_names, band_names, lon='lon', lat='lat')\n\nTo calculate zonal statistics:\n\n.. code:: python\n\n  geemap.zonal_statistics(in_value_raster, in_zone_vector, out_file_path, statistics_type='MEAN')\n\n\nTo calculate zonal statistics by group:\n\n.. code:: python\n\n  geemap.zonal_statistics_by_group(in_value_raster, in_zone_vector, out_file_path, statistics_type='SUM')\n\n\nTo create a split-panel Map:\n\n.. code:: python\n\n  Map.split_map(left_layer='HYBRID', right_layer='ESRI')\n\n\nTo add a marker cluster to the Map:\n\n.. code:: python\n\n  Map.marker_cluster()\n  feature_collection = ee.FeatureCollection(Map.ee_markers)\n\n\nTo add a customized legend to the Map:\n\n.. code:: python\n\n  legend_dict = {\n      'one': (0, 0, 0),\n      'two': (255,255,0),\n      'three': (127, 0, 127)\n  }\n  Map.add_legend(legend_title='Legend', legend_dict=legend_dict, position='bottomright')\n  Map.add_legend(builtin_legend='NLCD')\n\n\nTo download a GIF from an Earth Engine ImageCollection:\n\n.. code:: python\n\n  geemap.download_ee_video(tempCol, videoArgs, saved_gif)\n\n\nTo add animated text to an existing GIF image:\n\n.. code:: python\n\n  geemap.add_text_to_gif(in_gif, out_gif, xy=('5%', '5%'), text_sequence=1984, font_size=30, font_color='#0000ff', duration=100)\n\n\nTo create a colorbar for an Earth Engine image:\n\n.. code:: python\n\n  palette = ['blue', 'purple', 'cyan', 'green', 'yellow', 'red']\n  create_colorbar(width=250, height=30, palette=palette, vertical=False,add_labels=True, font_size=20, labels=[-40, 35])\n\n\nTo create a Landsat timelapse animation and add it to the Map:\n\n.. code:: python\n\n  Map.add_landsat_ts_gif(label='Place name', start_year=1985, bands=['NIR', 'Red', 'Green'], frames_per_second=5)\n\n\nTo convert all GEE JavaScripts in a folder recursively to Python scripts:\n\n.. code:: python\n\n  from geemap.conversion import *\n  js_to_python_dir(in_dir, out_dir)\n\n\nTo convert all GEE Python scripts in a folder recursively to Jupyter notebooks:  \n\n.. code:: python\n\n  from geemap.conversion import *\n  template_file = get_nb_template()\n  py_to_ipynb_dir(in_dir, template_file, out_dir)\n\n\nTo execute all Jupyter notebooks in a folder recursively and save output cells:  \n\n.. code:: python\n\n  from geemap.conversion import *\n  execute_notebook_dir(in_dir) \n\n\nTo search Earth Engine API documentation with Jupyter notebooks:  \n\n.. code:: python\n\n  import geemap\n  geemap.ee_search()\n\n\nTo publish an interactive GEE map with Jupyter notebooks:  \n\n.. code:: python\n\n  Map.publish(name, headline, visibility)\n\n\nTo add a local raster dataset to the map:  \n\n.. code:: python\n\n  Map.add_raster(image, bands, colormap, layer_name)\n  \n\nTo get image basic properties:\n\n.. code:: python\n\n  geemap.image_props(image).getInfo()\n\n\nTo get image descriptive statistics:\n\n.. code:: python\n\n  geemap.image_stats(image, region, scale)\n\n\nTo remove all user-drawn geometries:\n\n.. code:: python\n\n  geemap.remove_drawn_features()\n\n\nTo extract pixel values based on user-drawn geometries:\n\n.. code:: python\n\n  geemap.extract_values_to_points(out_shp)\n\n\nTo load a Cloud Optimized GeoTIFF as an ee.Image:\n\n.. code:: python\n\n  image = geemap.load_GeoTIFF(URL)\n\n\nTo load a list of Cloud Optimized GeoTIFFs as an ee.ImageCollection:\n\n.. code:: python\n\n  collection = geemap.load_GeoTIFFs(URLs)\n\n\nExamples\n--------\n\nThe following examples require the geemap package, which can be installed using ``pip install geemap``. Check the `Installation`_ section for more information. More examples can be found at \nanother repo: `A collection of 300+ Jupyter Python notebook examples for using Google Earth Engine with interactive mapping <https://github.com/giswqs/earthengine-py-notebooks>`__.\n\n- `Converting GEE JavaScripts to Python scripts and Jupyter notebooks`_\n- `Interactive mapping using GEE Python API and geemap`_\n\nConverting GEE JavaScripts to Python scripts and Jupyter notebooks\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nLaunch an interactive notebook with **Google Colab**. Keep in mind that the conversion might not always work perfectly. Additional manual changes might still be needed. ``ui`` and ``chart`` are not supported. \nThe source code for this automated conversion module can be found at `conversion.py <https://github.com/giswqs/geemap/blob/master/geemap/conversion.py>`__.\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n        :target: https://colab.research.google.com/github/giswqs/geemap/blob/master/examples/notebooks/08_ee_js_to_ipynb.ipynb\n\n\n.. code:: python\n\n        import os\n        from geemap.conversion import *\n\n        # Create a temporary working directory\n        work_dir = os.path.join(os.path.expanduser('~'), 'geemap')\n        # Get Earth Engine JavaScript examples. There are five examples in the geemap package folder. \n        # Change js_dir to your own folder containing your Earth Engine JavaScripts, such as js_dir = '/path/to/your/js/folder'\n        js_dir = get_js_examples(out_dir=work_dir) \n\n        # Convert all Earth Engine JavaScripts in a folder recursively to Python scripts.\n        js_to_python_dir(in_dir=js_dir, out_dir=js_dir, use_qgis=True)\n        print(\"Python scripts saved at: {}\".format(js_dir))\n\n        # Convert all Earth Engine Python scripts in a folder recursively to Jupyter notebooks.\n        nb_template = get_nb_template()  # Get the notebook template from the package folder.\n        py_to_ipynb_dir(js_dir, nb_template)\n\n        # Execute all Jupyter notebooks in a folder recursively and save the output cells.\n        execute_notebook_dir(in_dir=js_dir)\n\n\n.. image:: https://i.imgur.com/8bedWtl.gif\n\n\n\nInteractive mapping using GEE Python API and geemap\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nLaunch an interactive notebook with **Google Colab**. Note that **Google Colab** currently does not support ipyleaflet. Therefore, you should use ``import geemap.foliumap`` instead of ``import geemap``.\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n        :target: https://colab.research.google.com/github/giswqs/geemap/blob/master/examples/notebooks/geemap_and_folium.ipynb\n\n.. code:: python\n\n        # Installs geemap package\n        import subprocess\n\n        try:\n                import geemap\n        except ImportError:\n                print('geemap package not installed. Installing ...')\n                subprocess.check_call([\"python\", '-m', 'pip', 'install', 'geemap'])\n\n        # Checks whether this notebook is running on Google Colab\n        try:\n                import google.colab\n                import geemap.foliumap as emap\n        except:\n                import geemap as emap\n\n        # Authenticates and initializes Earth Engine\n        import ee\n\n        try:\n                ee.Initialize()\n        except Exception as e:\n                ee.Authenticate()\n                ee.Initialize()\n\n        # Creates an interactive map\n        Map = emap.Map(center=[40,-100], zoom=4)\n\n        # Adds Earth Engine dataset\n        image = ee.Image('USGS/SRTMGL1_003')\n\n        # Sets visualization parameters.\n        vis_params = {\n                'min': 0,\n                'max': 4000,\n                'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}\n\n        # Prints the elevation of Mount Everest.\n        xy = ee.Geometry.Point([86.9250, 27.9881])\n        elev = image.sample(xy, 30).first().get('elevation').getInfo()\n        print('Mount Everest elevation (m):', elev)\n\n        # Adds Earth Engine layers to Map\n        Map.addLayer(image, vis_params, 'SRTM DEM', True, 0.5)\n        Map.addLayer(xy, {'color': 'red'}, 'Mount Everest')\n        Map.setCenter(100, 40, 4)\n        # Map.centerObject(xy, 13)\n\n        # Display the Map\n        Map.addLayerControl()\n        Map\n\n\n.. image:: https://i.imgur.com/7NMQw6I.gif\n\nDependencies\n------------\n\n* `bqplot <https://github.com/bloomberg/bqplot>`__\n* `colour <https://github.com/vaab/colour>`__\n* `earthengine-api <https://github.com/google/earthengine-api>`__\n* `folium <https://github.com/python-visualization/folium>`__\n* `geeadd <https://github.com/samapriya/gee_asset_manager_addon>`__\n* `geocoder <https://github.com/DenisCarriere/geocoder>`__\n* `ipyfilechooser <https://github.com/crahan/ipyfilechooser>`__\n* `ipyleaflet <https://github.com/jupyter-widgets/ipyleaflet>`__\n* `ipynb-py-convert <https://github.com/kiwi0fruit/ipynb-py-convert>`__\n* `ipytree <https://github.com/QuantStack/ipytree>`__\n* `ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`__\n* `mss <https://github.com/BoboTiG/python-mss>`__\n* `pillow <https://github.com/python-pillow/Pillow>`__\n* `pyshp <https://github.com/GeospatialPython/pyshp>`__\n* `xarray-leaflet <https://github.com/davidbrochart/xarray_leaflet>`__\n\n\n\nContributing\n------------\nContributions are welcome, and they are greatly appreciated! Every little bit\nhelps, and credit will always be given.\n\nYou can contribute in many ways:\n\nReport Bugs\n^^^^^^^^^^^\n\nReport bugs at https://github.com/giswqs/geemap/issues.\n\nIf you are reporting a bug, please include:\n\n* Your operating system name and version.\n* Any details about your local setup that might be helpful in troubleshooting.\n* Detailed steps to reproduce the bug.\n\nFix Bugs\n^^^^^^^^\n\nLook through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help\nwanted\" is open to whoever wants to implement it.\n\nImplement Features\n^^^^^^^^^^^^^^^^^^\n\nLook through the GitHub issues for features. Anything tagged with \"enhancement\"\nand \"help wanted\" is open to whoever wants to implement it.\n\nWrite Documentation\n^^^^^^^^^^^^^^^^^^^\n\ngeemap could always use more documentation, whether as part of the\nofficial geemap docs, in docstrings, or even on the web in blog posts,\narticles, and such.\n\nSubmit Feedback\n^^^^^^^^^^^^^^^\n\nThe best way to send feedback is to file an issue at https://github.com/giswqs/geemap/issues.\n\nIf you are proposing a feature:\n\n* Explain in detail how it would work.\n* Keep the scope as narrow as possible, to make it easier to implement.\n* Remember that this is a volunteer-driven project, and that contributions\n  are welcome :)\n\nGet Started!\n^^^^^^^^^^^^\n\nReady to contribute? Here's how to set up `geemap` for local development.\n\n1. Fork the `geemap` repo on GitHub.\n2. Clone your fork locally::\n\n    $ git clone git@github.com:your_name_here/geemap.git\n\n3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::\n\n    $ mkvirtualenv geemap\n    $ cd geemap/\n    $ python setup.py develop\n\n4. Create a branch for local development::\n\n    $ git checkout -b name-of-your-bugfix-or-feature\n\n   Now you can make your changes locally.\n\n5. When you're done making changes, check that your changes pass flake8 and the\n   tests, including testing other Python versions with tox::\n\n    $ flake8 geemap tests\n    $ python setup.py test or pytest\n    $ tox\n\n   To get flake8 and tox, just pip install them into your virtualenv.\n\n6. Commit your changes and push your branch to GitHub::\n\n    $ git add .\n    $ git commit -m \"Your detailed description of your changes.\"\n    $ git push origin name-of-your-bugfix-or-feature\n\n7. Submit a pull request through the GitHub website.\n\nPull Request Guidelines\n^^^^^^^^^^^^^^^^^^^^^^^\n\nBefore you submit a pull request, check that it meets these guidelines:\n\n1. The pull request should include tests.\n2. If the pull request adds functionality, the docs should be updated. Put\n   your new functionality into a function with a docstring, and add the\n   feature to the list in README.rst.\n3. The pull request should work for Python 3.6, 3.7 and 3.8, and for PyPy. Check\n   https://travis-ci.com/giswqs/geemap/pull_requests\n   and make sure that the tests pass for all supported Python versions.\n\nTips\n^^^^\n\nTo run a subset of tests::\n\n\n    $ python -m unittest tests.test_geemap\n    \n\nDeploying\n^^^^^^^^^\n\nA reminder for the maintainers on how to deploy.\nMake sure all your changes are committed (including an entry in HISTORY.rst).\nThen run::\n\n$ bump2version patch # possible: major / minor / patch\n$ git push\n$ git push --tags\n\nTravis will then deploy to PyPI if tests pass.\n\n\nReferences\n----------\n\nTo support my work, please consider citing the following articles:\n\n- **Wu, Q.**, (2020). geemap: A Python package for interactive mapping with Google Earth Engine. *The Journal of Open Source Software*, 5(51), 2305. https://doi.org/10.21105/joss.02305 \n- **Wu, Q.**, Lane, C. R., Li, X., Zhao, K., Zhou, Y., Clinton, N., DeVries, B., Golden, H. E., & Lang, M. W. (2019). Integrating LiDAR data and multi-temporal aerial imagery to map wetland inundation dynamics using Google Earth Engine. *Remote Sensing of Environment*, 228, 1-13. https://doi.org/10.1016/j.rse.2019.04.015 (`pdf <https://gishub.org/2019_rse>`_ | `source code <https://doi.org/10.6084/m9.figshare.8864921>`_)\n\n\nCredits\n-------\n\nThis package was created with `Cookiecutter <https://github.com/cookiecutter/cookiecutter>`__ and the `audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage>`__ project template.\n\n\n.. image:: https://badges.gitter.im/geemap/community.svg\n   :alt: Join the chat at https://gitter.im/geemap/community\n   :target: https://gitter.im/geemap/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\n\n=======\nHistory\n=======\n0.7.0 (2020-05-22)\n------------------\n0.6.0 (2020-04-05)\n------------------\n0.5.0 (2020-03-24)\n------------------\n0.4.0 (2020-03-19)\n------------------\n0.3.0 (2020-03-18)\n------------------\n0.2.0 (2020-03-17)\n------------------\n0.1.0 (2020-03-08)\n------------------\n\n* First release on PyPI.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "A Python package for interactive mapping using Google Earth Engine and ipyleaflet",
    "version": "0.16.2",
    "split_keywords": [
        "geemap"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a12cf49c95d58ddf0f1fea0ab0dbc854",
                "sha256": "3290ee46f8b20dad41f7556b56da5136c1da68fdcb2809bc9dbd530368300547"
            },
            "downloads": -1,
            "filename": "geemap-0.16.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a12cf49c95d58ddf0f1fea0ab0dbc854",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 1990851,
            "upload_time": "2022-08-04T19:23:32",
            "upload_time_iso_8601": "2022-08-04T19:23:32.650706Z",
            "url": "https://files.pythonhosted.org/packages/c1/ec/3463e7b18b39cf6a1676a077208b2cbef3a59e90d74642119889eb42b559/geemap-0.16.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a699ad33dbb57adf58443441c568394f",
                "sha256": "ddc0a7da294e2dba411809239aba42c04abc7299bd04e5747bc79562b05ee261"
            },
            "downloads": -1,
            "filename": "geemap-0.16.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a699ad33dbb57adf58443441c568394f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 1989768,
            "upload_time": "2022-08-04T19:23:35",
            "upload_time_iso_8601": "2022-08-04T19:23:35.565309Z",
            "url": "https://files.pythonhosted.org/packages/c6/6b/378a6b5e18292136afb3e41a3ac9b7c974a9d13a95d03b9fabef52af6836/geemap-0.16.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-04 19:23:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "giswqs",
    "github_project": "geemap",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "geemap"
}
        
Elapsed time: 0.55305s