Skip to content

Commit

Permalink
Add support for publishing maps #109
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jul 5, 2020
1 parent c9c51be commit 086230e
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Below is a partial list of features available for the geemap package. Please che
* Exporting Earth Engine maps as HTML files and PNG images.
* Searching Earth Engine API documentation within Jupyter notebooks.
* Importing Earth Engine assets from personal account.
# Publishing interactive GEE maps directly within Jupyter notebook.


Installation
Expand Down Expand Up @@ -423,6 +424,13 @@ To search Earth Engine API documentation with Jupyter notebooks:
geemap.ee_search()
To publish an interactive GEE map with Jupyter notebooks:

.. code:: python
Map.publish(name, headline, visibility)
Examples
--------
Expand Down
189 changes: 189 additions & 0 deletions examples/notebooks/24_publish_maps.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To follow this tutorial, you will need to [sign up](https://datapane.com/accounts/signup/) for an account with <https://datapane.com>, then install and authenticate the `datapane` Python package. More information can be found [here](https://docs.datapane.com/tutorials/tut-getting-started). \n",
"\n",
"- `pip install datapane`\n",
"- `datapane login`\n",
"- `datapane ping`"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import ee \n",
"import geemap.eefolium as geemap"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# Create a map centered at (lat, lon).\n",
"Map = geemap.Map(center=[40, -100], zoom=4)\n",
"\n",
"# Use an elevation dataset and terrain functions to create\n",
"# a custom visualization of topography.\n",
"\n",
"# Load a global elevation image.\n",
"elev = ee.Image('USGS/GMTED2010')\n",
"\n",
"# Zoom to an area of interest.\n",
"Map.setCenter(-121.069, 50.709, 6)\n",
"\n",
"# Add the elevation to the map.\n",
"Map.addLayer(elev, {}, 'elev')\n",
"\n",
"# Use the terrain algorithms to compute a hillshade with 8-bit values.\n",
"shade = ee.Terrain.hillshade(elev)\n",
"Map.addLayer(shade, {}, 'hillshade', False)\n",
"\n",
"# Create a \"sea\" variable to be used for cartographic purposes\n",
"sea = elev.lte(0)\n",
"Map.addLayer(sea.mask(sea), {'palette':'000022'}, 'sea', False)\n",
"\n",
"# Create a custom elevation palette from hex strings.\n",
"elevationPalette = ['006600', '002200', 'fff700', 'ab7634', 'c4d0ff', 'ffffff']\n",
"# Use these visualization parameters, customized by location.\n",
"visParams = {'min': 1, 'max': 3000, 'palette': elevationPalette}\n",
"\n",
"# Create a mosaic of the sea and the elevation data\n",
"visualized = ee.ImageCollection([\n",
" # Mask the elevation to get only land\n",
" elev.mask(sea.Not()).visualize(**visParams),\n",
" # Use the sea mask directly to display sea.\n",
" sea.mask(sea).visualize(**{'palette':'000022'})\n",
"]).mosaic()\n",
"\n",
"# Note that the visualization image doesn't require visualization parameters.\n",
"Map.addLayer(visualized, {}, 'elev palette', False)\n",
"\n",
"# Convert the visualized elevation to HSV, first converting to [0, 1] data.\n",
"hsv = visualized.divide(255).rgbToHsv()\n",
"# Select only the hue and saturation bands.\n",
"hs = hsv.select(0, 1)\n",
"# Convert the hillshade to [0, 1] data, as expected by the HSV algorithm.\n",
"v = shade.divide(255)\n",
"# Create a visualization image by converting back to RGB from HSV.\n",
"# Note the cast to byte in order to export the image correctly.\n",
"rgb = hs.addBands(v).hsvToRgb().multiply(255).byte()\n",
"Map.addLayer(rgb, {}, 'styled')\n",
"\n",
"states = ee.FeatureCollection('TIGER/2018/States')\n",
"Map.addLayer(ee.Image().paint(states, 0, 2), {}, \"US States\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIG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AgICAgICAgICAgICJodHRwczovL210MS5nb29nbGUuY29tL3Z0L2x5cnM9bVx1MDAyNng9e3h9XHUwMDI2eT17eX1cdTAwMjZ6PXt6fSIsCiAgICAgICAgICAgICAgICB7ImF0dHJpYnV0aW9uIjogIkdvb2dsZSIsICJkZXRlY3RSZXRpbmEiOiBmYWxzZSwgIm1heE5hdGl2ZVpvb20iOiAxOCwgIm1heFpvb20iOiAxOCwgIm1pblpvb20iOiAwLCAibm9XcmFwIjogZmFsc2UsICJvcGFjaXR5IjogMSwgInN1YmRvbWFpbnMiOiAiYWJjIiwgInRtcyI6IGZhbHNlfQogICAgICAgICAgICApLmFkZFRvKG1hcF82MGNkNWNiZWJmYmM0NDYyOTNlYzZlNjgwNzI4YzlhNik7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgICAgIHZhciBsYXRfbG5nX3BvcHVwXzFkY2M1ZmY5MDliNzQxODNiZWIxYzkwZTY2ZmIxZmM1ID0gTC5wb3B1cCgpOwogICAgICAgICAgICAgICAgZnVuY3Rpb24gbGF0TG5nUG9wKGUpIHsKICAgICAgICAgICAgICAgICAgICBsYXRfbG5nX3BvcHVwXzFkY2M1ZmY5MDliNzQxODNiZWIxYzkwZTY2ZmIxZmM1CiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRMYXRMbmcoZS5sYXRsbmcpCiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRDb250ZW50KCJMYXRpdHVkZTogIiArIGUubGF0bG5nLmxhdC50b0ZpeGVkKDQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjxicj5Mb25naXR1ZGU6ICIgKyBlLmxhdGxuZy5sbmcudG9GaXhlZCg0KSkKICAgICAgICAgICAgICAgICAgICAgICAgLm9wZW5PbihtYXBfNjBjZDVjYmViZmJjNDQ2MjkzZWM2ZTY4MDcyOGM5YTYpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIG1hcF82MGNkNWNiZWJmYmM0NDYyOTNlYzZlNjgwNzI4YzlhNi5vbignY2xpY2snLCBsYXRMbmdQb3ApOwogICAgICAgICAgICAKICAgIAogICAgICAgICAgICBtYXBfNjBjZDVjYmViZmJjNDQ2MjkzZWM2ZTY4MDcyOGM5YTYuZml0Qm91bmRzKAogICAgICAgICAgICAgICAgW1s0MCwgLTEwMF0sIFs0MCwgLTEwMF1dLAogICAgICAgICAgICAgICAgeyJtYXhab29tIjogNH0KICAgICAgICAgICAgKTsKICAgICAgICAKICAgIAogICAgICAgICAgICBtYXBfNjBjZDVjYmViZmJjNDQ2MjkzZWM2ZTY4MDcyOGM5YTYuZml0Qm91bmRzKAogICAgICAgICAgICAgICAgW1s1MC43MDksIC0xMjEuMDY5XSwgWzUwLjcwOSwgLTEyMS4wNjldXSwKICAgICAgICAgICAgICAgIHsibWF4Wm9vbSI6IDZ9CiAgICAgICAgICAgICk7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgdmFyIHRpbGVfbGF5ZXJfYWE4ZDJiODc2ZWZhNDEwZDkyOGE5Y2YxNDZlZmJjODggPSBMLnRpbGVMYXllcigKICAgICAgICAgICAgICAgICJodHRwczovL2VhcnRoZW5naW5lLmdvb2dsZWFwaXMuY29tL3YxYWxwaGEvcHJvamVjdHMvZWFydGhlbmdpbmUtbGVnYWN5L21hcHMvNTUwMjFlNTgwZWM1YzMxODU2MDE4NWQ2YmJiODlmYTEtZDg3YmRlNTM1NjZiMTJlM2I0NDMyZDdiMzAwNDVhZGIvdGlsZXMve3p9L3t4fS97eX0iLAogICAgICAgICAgICAgICAgeyJhdHRyaWJ1dGlvbiI6ICJHb29nbGUgRWFydGggRW5naW5lIiwgImRldGVjdFJldGluYSI6IGZhbHNlLCAibWF4TmF0aXZlWm9vbSI6IDE4LCAibWF4Wm9vbSI6IDE4LCAibWluWm9vbSI6IDAsICJub1dyYXAiOiBmYWxzZSwgIm9wYWNpdHkiOiAxLjAsICJzdWJkb21haW5zIjogImFiYyIsICJ0bXMiOiBmYWxzZX0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ZWZ0IiwgInRpdGxlIjogIkZ1bGwgU2NyZWVuIiwgInRpdGxlQ2FuY2VsIjogIkV4aXQgRnVsbCBTY3JlZW4ifQogICAgICAgICAgICApLmFkZFRvKG1hcF82MGNkNWNiZWJmYmM0NDYyOTNlYzZlNjgwNzI4YzlhNik7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgICAgIHZhciBsYXRfbG5nX3BvcHVwX2U2NGRmYzFkYzQyYjRiZjA5NDA1N2EzODBhNDc3YWRhID0gTC5wb3B1cCgpOwogICAgICAgICAgICAgICAgZnVuY3Rpb24gbGF0TG5nUG9wKGUpIHsKICAgICAgICAgICAgICAgICAgICBsYXRfbG5nX3BvcHVwX2U2NGRmYzFkYzQyYjRiZjA5NDA1N2EzODBhNDc3YWRhCiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRMYXRMbmcoZS5sYXRsbmcpCiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRDb250ZW50KCJMYXRpdHVkZTogIiArIGUubGF0bG5nLmxhdC50b0ZpeGVkKDQpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjxicj5Mb25naXR1ZGU6ICIgKyBlLmxhdGxuZy5sbmcudG9GaXhlZCg0KSkKICAgICAgICAgICAgICAgICAgICAgICAgLm9wZW5PbihtYXBfNjBjZDVjYmViZmJjNDQ2MjkzZWM2ZTY4MDcyOGM5YTYpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIG1hcF82MGNkNWNiZWJmYmM0NDYyOTNlYzZlNjgwNzI4YzlhNi5vbignY2xpY2snLCBsYXRMbmdQb3ApOwogICAgICAgICAgICAKPC9zY3JpcHQ+\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
],
"text/plain": [
"<geemap.eefolium.Map at 0x7fbf57f0b160>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Add layer control to the map.\n",
"Map.setControlVisibility()\n",
"# Display the map.\n",
"Map"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"Map.publish(name='gee_folium_map', headline='Terrain Visualization', visibility='PUBLIC', overwrite=True)"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": true,
"title_cell": "Table of Contents",
"title_sidebar": "Table of Contents",
"toc_cell": false,
"toc_position": {
"height": "calc(100% - 180px)",
"left": "10px",
"top": "150px",
"width": "318px"
},
"toc_section_display": true,
"toc_window_display": true
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit 086230e

Please sign in to comment.