Skip to content

Commit

Permalink
Added support for ArcGIS (gee-community#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Dec 5, 2022
1 parent 6f7edc2 commit 3c329cc
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 5 deletions.
140 changes: 140 additions & 0 deletions docs/notebooks/131_arcgis.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a href=\"https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/zz_template.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>\n",
"\n",
"**Using Earth Engine with ArcGIS Pro**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# !pip install -U geemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 1 - Clone conda env\n",
"\n",
"Clone the `arcgispro-py3` conda environment and name it as `gee` (or whatever name you prefer)\n",
"\n",
"![](https://i.imgur.com/inZw6mR.png)\n",
"\n",
"## Step 2 - Install geemap\n",
"\n",
"Open Command Prompt or PowerShell to install geemap.\n",
"\n",
"`AppData\\Local\\ESRI\\conda\\envs\\gee\\Scripts\\pip.exe install geemap`\n",
"\n",
"![](https://i.imgur.com/AmBULc5.png)\n",
"\n",
"## Step 3 - Create a New Notebook\n",
"\n",
"To create a notebook, click the **Insert** tab on the ArcGIS Pro ribbon, and click the **New Notebook** button. Alternatively, open the **Catalog** pane, browse to your project directory, right-click a folder, and select **New > Notebook**.\n",
"\n",
"## Step 4 - Run GEE script\n",
"\n",
"Run any geemap code as usual. The `Map.addLayer()` function will automatically add Earth Engine layers to the active map. Use `Map.centerObject()` to center an Earth Engine object on the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ee\n",
"import geemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add Earth Engine layers."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map()\n",
"dem = ee.Image('USGS/SRTMGL1_003')\n",
"vis_params = {\n",
" 'min': 0,\n",
" 'max': 4000,\n",
" 'palette': 'terrain',\n",
"}\n",
"Map.addLayer(dem, vis_params, 'SRTM DEM')\n",
"Map"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Center an Earth Engine object on the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map()\n",
"image = (\n",
" ee.Image('LANDSAT/LC09/C02/T1_L2/LC09_044034_20220503')\n",
" .select('SR_B.')\n",
" .multiply(0.0000275)\n",
" .add(-0.2)\n",
")\n",
"\n",
"vis_params = {'bands': ['SR_B5', 'SR_B4', 'SR_B3'], 'min': 0, 'max': 0.3}\n",
"\n",
"Map.addLayer(image, vis_params, 'Landsat 9')\n",
"Map.centerObject(image)\n",
"Map"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"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.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
1 change: 1 addition & 0 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ More video tutorials for geemap and Earth Engine are available on my [YouTube ch
128. Adding text, images, HTML, and widgets to the map ([notebook](https://geemap.org/notebooks/128_add_widget))
129. Creating animated GIF from vector data with only one line of code ([notebook](https://geemap.org/notebooks/129_vector_to_gif))
130. Printing Earth Engine objects without using the getInfo() function ([notebook](https://geemap.org/notebooks/130_print_objects))
131. Using Earth Engine with ArcGIS Pro ([notebook](https://geemap.org/notebooks/131_arcgis))
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ More video tutorials for geemap and Earth Engine are available on my [YouTube ch
128. Adding text, images, HTML, and widgets to the map ([notebook](https://geemap.org/notebooks/128_add_widget))
129. Creating animated GIF from vector data with only one line of code ([notebook](https://geemap.org/notebooks/129_vector_to_gif))
130. Printing Earth Engine objects without using the getInfo() function ([notebook](https://geemap.org/notebooks/130_print_objects))
131. Using Earth Engine with ArcGIS Pro ([notebook](https://geemap.org/notebooks/131_arcgis))

### 1. Introducing the geemap Python package for interactive mapping with Google Earth Engine

Expand Down
140 changes: 140 additions & 0 deletions examples/notebooks/131_arcgis.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a href=\"https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/zz_template.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>\n",
"\n",
"**Using Earth Engine with ArcGIS Pro**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# !pip install -U geemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 1 - Clone conda env\n",
"\n",
"Clone the `arcgispro-py3` conda environment and name it as `gee` (or whatever name you prefer)\n",
"\n",
"![](https://i.imgur.com/inZw6mR.png)\n",
"\n",
"## Step 2 - Install geemap\n",
"\n",
"Open Command Prompt or PowerShell to install geemap.\n",
"\n",
"`AppData\\Local\\ESRI\\conda\\envs\\gee\\Scripts\\pip.exe install geemap`\n",
"\n",
"![](https://i.imgur.com/AmBULc5.png)\n",
"\n",
"## Step 3 - Create a New Notebook\n",
"\n",
"To create a notebook, click the **Insert** tab on the ArcGIS Pro ribbon, and click the **New Notebook** button. Alternatively, open the **Catalog** pane, browse to your project directory, right-click a folder, and select **New > Notebook**.\n",
"\n",
"## Step 4 - Run GEE script\n",
"\n",
"Run any geemap code as usual. The `Map.addLayer()` function will automatically add Earth Engine layers to the active map. Use `Map.centerObject()` to center an Earth Engine object on the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ee\n",
"import geemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add Earth Engine layers."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map()\n",
"dem = ee.Image('USGS/SRTMGL1_003')\n",
"vis_params = {\n",
" 'min': 0,\n",
" 'max': 4000,\n",
" 'palette': 'terrain',\n",
"}\n",
"Map.addLayer(dem, vis_params, 'SRTM DEM')\n",
"Map"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Center an Earth Engine object on the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Map = geemap.Map()\n",
"image = (\n",
" ee.Image('LANDSAT/LC09/C02/T1_L2/LC09_044034_20220503')\n",
" .select('SR_B.')\n",
" .multiply(0.0000275)\n",
" .add(-0.2)\n",
")\n",
"\n",
"vis_params = {'bands': ['SR_B5', 'SR_B4', 'SR_B3'], 'min': 0, 'max': 0.3}\n",
"\n",
"Map.addLayer(image, vis_params, 'Landsat 9')\n",
"Map.centerObject(image)\n",
"Map"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"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.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion geemap/algorithms/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from ee_extra.Algorithms import river
from ee_extra.Algorithms import river
Loading

0 comments on commit 3c329cc

Please sign in to comment.