-
-
Save giswqs/bab47213f0cbd3d1073ea47b01331c62 to your computer and use it in GitHub Desktop.
{ | |
"cells": [ | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "import ee\nimport geemap", | |
"execution_count": 1, | |
"outputs": [] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "Install the development version from GitHub" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# geemap.update_package()", | |
"execution_count": 2, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"scrolled": false, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "Map = geemap.Map()\nMap", | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": "Map(center=[40, -100], controls=(WidgetControl(options=['position'], widget=HBox(children=(ToggleButton(value=…", | |
"application/vnd.jupyter.widget-view+json": { | |
"version_major": 2, | |
"version_minor": 0, | |
"model_id": "f139646aa59840628ef0d6a670fa899b" | |
} | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "Use the Drawing Tools to draw a rectangle." | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "Map.setCenter(-74.520409, -8.373150, 12)", | |
"execution_count": 4, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "Map.add_landsat_ts_gif(label= 'Pucallpa, Peru', bands=['SWIR1', 'NIR', 'Red'], nd_bands=['Green', 'SWIR1'], nd_palette=['black', 'blue'], start_year=2000, start_date='01-01', end_date='12-31', frames_per_second=5)", | |
"execution_count": 7, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "Generating URL...\nDownloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/1e59bb434566d45bd73f1f4c0bd2ea63-78c2470bfee09910979eb532498817e9:getPixels\nPlease wait ...\nThe GIF image has been saved to: /home/qiusheng/Downloads/landsat_ts_kfr.gif\nGenerating URL...\nDownloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/9d2085d568533acbb414c2b6df852f2e-ed2d670708f373bdf179b9d426a373e2:getPixels\nPlease wait ...\nThe GIF image has been saved to: /home/qiusheng/Downloads/landsat_ts_kfr_nd.gif\nAdding animated text to GIF ...\nAdding GIF to the map ...\nThe timelapse has been added to the map.\n", | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"hide_input": false, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3", | |
"language": "python" | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.8.2", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": true, | |
"sideBar": true, | |
"skip_h1_title": true, | |
"base_numbering": 1, | |
"title_cell": "Table of Contents", | |
"title_sidebar": "Table of Contents", | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": true, | |
"toc_window_display": true | |
}, | |
"varInspector": { | |
"window_display": false, | |
"cols": { | |
"lenName": 16, | |
"lenType": 16, | |
"lenVar": 40 | |
}, | |
"kernels_config": { | |
"python": { | |
"library": "var_list.py", | |
"delete_cmd_prefix": "del ", | |
"delete_cmd_postfix": "", | |
"varRefreshCmd": "print(var_dic_list())" | |
}, | |
"r": { | |
"library": "var_list.r", | |
"delete_cmd_prefix": "rm(", | |
"delete_cmd_postfix": ") ", | |
"varRefreshCmd": "cat(var_dic_list()) " | |
} | |
}, | |
"types_to_exclude": [ | |
"module", | |
"function", | |
"builtin_function_or_method", | |
"instance", | |
"_Feature" | |
] | |
}, | |
"gist": { | |
"id": "bab47213f0cbd3d1073ea47b01331c62", | |
"data": { | |
"description": "Pucallpa, Peru", | |
"public": true | |
} | |
}, | |
"_draft": { | |
"nbviewer_url": "https://gist.github.com/bab47213f0cbd3d1073ea47b01331c62" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Thank you for sharing.
I'm not sure, but when I change the coordinates, the location didn't work to produce a time serie.
Do I need re start the kernel?
Hi sir,
In which platform i can ru this code? GEE code editor ?
You will Jupyter notebook to run this.
Thank you for sharing.
I'm not sure, but when I change the coordinates, the location didn't work to produce a time serie.
Do I need re start the kernel?
You can draw any rectangle on the map before executing the last line of code.
Maybe something wrong in my computer.
I'm using the Google Coolab in Chrome navigator and didn´t appear the tool to select the area after authentication ee and import geemap.
Any recomendation to run the geemap, like OS, Navigator, Python version?
Thank you to the fast reply.
Maybe something wrong in my computer.
I'm using the Google Coolab in Chrome navigator and didn´t appear the tool to select the area after authentication ee and import geemap.Any recomendation to run the geemap, like OS, Navigator, Python version?
Thank you to the fast reply.
It won't work with Colab. You will need to use Jupyter on your local computer. Alternatively, you can use the web apps below.
See this video.
Hi sir ,
I need two help from your side. where can I have material/video to learn GEE from basics.
1. I need to create buffer(simple buffer) for 10 points in GEE can i have code for that.
2. Then I have 30 points those points i need to create buffer with different sizes say point1 100m,point 2 300 mts.can i have code for that.
Please reply and help me to learn.
Dear Dr. Wu,
I am attempting to run this code for Fort Collins, CO using jupyter notebook but I am getting an error that I am unable to interpret due to my lack of knowledge in coding. I am sharing my error and my code with you to see if you have any possible solutions to offer.
Error:
Generating URL...
Downloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/333ebeb5236786e37da3cc7b61811603-fa27f18d4c3fcf18bb7a4a618537a06b:getPixels
Please wait ...
An error occurred while downloading.
User memory limit exceeded.
Generating URL...
Downloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/7d7a1e73d3f548d42ea66ea2b112aeb9-afabf5022b51650f093518be3101135d:getPixels
Please wait ...
An error occurred while downloading.
User memory limit exceeded.
The input gif file does not exist.
The input gif file does not exist.
The input gif file does not exist.
The input gif file does not exist.
Adding GIF to the map ...
The provided file does not exist.
The provided file does not exist.
The timelapse has been added to the map.
Code:
import ee
import geemap
Map =geemap.Map()
Map
Map.setCenter( -105.347512, 40.546957, 8)
Map.add_landsat_ts_gif(label= 'Fort Collins, CO', bands=['SWIR1', 'NIR', 'Red'], nd_bands=['NIR', 'Red'], nd_palette=['black', 'green'], nd_threshold=0.3, start_year=2000, start_date='01-01', end_date='12-31', frames_per_second=5)
Thank you!
I am trying to run the code to get a time series for the Everglades and though I have changed my Map center and created a rectangle around the box, when I run the last line of code I keep getting the map from Peru. How do I fix this? Also how do you calculate NDWI in code instead of NDVI. Below is my current code.
Map.setCenter(25.4931887, -81.1582436, 9)
Map.add_landsat_ts_gif(label= 'Everglades', bands=['SWIR1', 'NIR', 'Red'], nd_bands=['NIR', 'SWIR1'], nd_palette=['brown', 'green'], nd_threshold=0.3, start_year=2013, end_year=2023, start_date='03-01', end_date='03-30', frames_per_second=2)
Hi sir,
In which platform i can ru this code? GEE code editor ?