Skip to content

Instantly share code, notes, and snippets.

@giswqs
Created May 23, 2022 18:41
Show Gist options
  • Save giswqs/7a25698dd97ee28d8ee9b67c8855db25 to your computer and use it in GitHub Desktop.
Save giswqs/7a25698dd97ee28d8ee9b67c8855db25 to your computer and use it in GitHub Desktop.
esa_landcover.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"trusted": true
},
"id": "7ca9e497",
"cell_type": "code",
"source": "import ee\nimport geemap.foliumap as geemap",
"execution_count": 1,
"outputs": []
},
{
"metadata": {
"trusted": true
},
"id": "1fbeebc0",
"cell_type": "code",
"source": "Map = geemap.Map()\ndataset = ee.ImageCollection(\"ESA/WorldCover/v100\").first()\nMap.addLayer(dataset, {'bands': ['Map']}, 'ESA Land Cover')\n\ncountries = ee.FeatureCollection('users/giswqs/public/countries')\nconus = ee.FeatureCollection('users/giswqs/public/us_states').filterBounds(ee.Geometry.BBox(-130, 23, 64, 51))\n\nstyle = {'color': '000000ff', 'width': 1, 'lineType': 'solid', 'fillColor': 'FF000000'}\n\nMap.addLayer(countries.style(**style), {}, 'Countries')\nMap.addLayer(conus.style(**style), {}, 'CONUS')\nMap.add_legend(builtin_legend='ESA_WorldCover')\nMap",
"execution_count": 2,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 2,
"data": {
"text/plain": "<geemap.foliumap.Map at 0x7f9a55c1bf10>",
"text/html": "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe src=\"about:blank\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" data-html=%3C%21DOCTYPE+html%3E%0A%3Chead%3E++++%0A++++%3Cmeta+http-equiv%3D%22content-type%22+content%3D%22text/html%3B+charset%3DUTF-8%22+/%3E%0A++++%0A++++++++%3Cscript%3E%0A++++++++++++L_NO_TOUCH+%3D+false%3B%0A++++++++++++L_DISABLE_3D+%3D+false%3B%0A++++++++%3C/script%3E%0A++++%0A++++%3Cstyle%3Ehtml%2C+body+%7Bwidth%3A+100%25%3Bheight%3A+100%25%3Bmargin%3A+0%3Bpadding%3A+0%3B%7D%3C/style%3E%0A++++%3Cstyle%3E%23map+%7Bposition%3Aabsolute%3Btop%3A0%3Bbottom%3A0%3Bright%3A0%3Bleft%3A0%3B%7D%3C/style%3E%0A++++%3Cscript+src%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.6.0/dist/leaflet.js%22%3E%3C/script%3E%0A++++%3Cscript+src%3D%22https%3A//code.jquery.com/jquery-1.12.4.min.js%22%3E%3C/script%3E%0A++++%3Cscript+src%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js%22%3E%3C/script%3E%0A++++%3Cscript+src%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js%22%3E%3C/script%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//cdn.jsdelivr.net/npm/leaflet%401.6.0/dist/leaflet.css%22/%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css%22/%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css%22/%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css%22/%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css%22/%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css%22/%3E%0A++++%0A++++++++++++%3Cmeta+name%3D%22viewport%22+content%3D%22width%3Ddevice-width%2C%0A++++++++++++++++initial-scale%3D1.0%2C+maximum-scale%3D1.0%2C+user-scalable%3Dno%22+/%3E%0A++++++++++++%3Cstyle%3E%0A++++++++++++++++%23map_ab36be12e8184cf0aaa0c02cfa301d11+%7B%0A++++++++++++++++++++position%3A+relative%3B%0A++++++++++++++++++++width%3A+100.0%25%3B%0A++++++++++++++++++++height%3A+100.0%25%3B%0A++++++++++++++++++++left%3A+0.0%25%3B%0A++++++++++++++++++++top%3A+0.0%25%3B%0A++++++++++++++++%7D%0A++++++++++++%3C/style%3E%0A++++++++%0A++++%3Cscript+src%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.js%22%3E%3C/script%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.css%22/%3E%0A++++%3Cscript+src%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.js%22%3E%3C/script%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.css%22/%3E%0A++++%3Cscript+src%3D%22https%3A//unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js%22%3E%3C/script%3E%0A++++%3Clink+rel%3D%22stylesheet%22+href%3D%22https%3A//unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css%22/%3E%0A%3C/head%3E%0A%3Cbody%3E++++%0A++++%0A++++++++++++%3Cdiv+class%3D%22folium-map%22+id%3D%22map_ab36be12e8184cf0aaa0c02cfa301d11%22+%3E%3C/div%3E%0A++++++++%0A++++%0A%0A%3C%21doctype+html%3E%0A%3Chtml+lang%3D%22en%22%3E%0A%3Chead%3E%0A++%3Cmeta+charset%3D%22utf-8%22%3E%0A++%3Cmeta+name%3D%22viewport%22+content%3D%22width%3Ddevice-width%2C+initial-scale%3D1%22%3E%0A++%3Ctitle%3EjQuery+UI+Draggable+-+Default+functionality%3C/title%3E%0A++%3Clink+rel%3D%22stylesheet%22+href%3D%22//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css%22%3E%0A%0A++%3Cscript+src%3D%22https%3A//code.jquery.com/jquery-1.12.4.js%22%3E%3C/script%3E%0A++%3Cscript+src%3D%22https%3A//code.jquery.com/ui/1.12.1/jquery-ui.js%22%3E%3C/script%3E%0A%0A++%3Cscript%3E%0A++%24%28+function%28%29+%7B%0A++++%24%28+%22%23maplegend%22+%29.draggable%28%7B%0A++++++++++++++++++++start%3A+function+%28event%2C+ui%29+%7B%0A++++++++++++++++++++++++%24%28this%29.css%28%7B%0A++++++++++++++++++++++++++++right%3A+%22auto%22%2C%0A++++++++++++++++++++++++++++top%3A+%22auto%22%2C%0A++++++++++++++++++++++++++++bottom%3A+%22auto%22%0A++++++++++++++++++++++++%7D%29%3B%0A++++++++++++++++++++%7D%0A++++++++++++++++%7D%29%3B%0A%7D%29%3B%0A%0A++%3C/script%3E%0A%3C/head%3E%0A%3Cbody%3E%0A%0A%0A%3Cdiv+id%3D%27maplegend%27+class%3D%27maplegend%27%0A++++style%3D%27position%3A+absolute%3B+z-index%3A9999%3B+border%3A2px+solid+grey%3B+background-color%3Argba%28255%2C+255%2C+255%2C+0.8%29%3B%0A+++++border-radius%3A6px%3B+padding%3A+10px%3B+font-size%3A14px%3B+right%3A+20px%3B+bottom%3A+20px%3B%27%3E%0A%0A%3Cdiv+class%3D%27legend-title%27%3ELegend%3C/div%3E%0A%3Cdiv+class%3D%27legend-scale%27%3E%0A++%3Cul+class%3D%27legend-labels%27%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23006400%3Bopacity%3A1.0%3B%27%3E%3C/span%3E10+Trees%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23ffbb22%3Bopacity%3A1.0%3B%27%3E%3C/span%3E20+Shrubland%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23ffff4c%3Bopacity%3A1.0%3B%27%3E%3C/span%3E30+Grassland%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23f096ff%3Bopacity%3A1.0%3B%27%3E%3C/span%3E40+Cropland%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23fa0000%3Bopacity%3A1.0%3B%27%3E%3C/span%3E50+Built-up%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23b4b4b4%3Bopacity%3A1.0%3B%27%3E%3C/span%3E60+Barren+/+sparse+vegetation%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23f0f0f0%3Bopacity%3A1.0%3B%27%3E%3C/span%3E70+Snow+and+ice%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%230064c8%3Bopacity%3A1.0%3B%27%3E%3C/span%3E80+Open+water%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%230096a0%3Bopacity%3A1.0%3B%27%3E%3C/span%3E90+Herbaceous+wetland%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%2300cf75%3Bopacity%3A1.0%3B%27%3E%3C/span%3E95+Mangroves%3C/li%3E%0A++++%3Cli%3E%3Cspan+style%3D%27background%3A%23fae6a0%3Bopacity%3A1.0%3B%27%3E%3C/span%3E100+Moss+and+lichen%3C/li%3E%0A++%3C/ul%3E%0A%3C/div%3E%0A%3C/div%3E%0A%0A%3C/body%3E%0A%3C/html%3E%0A%0A%3Cstyle+type%3D%27text/css%27%3E%0A++.maplegend+.legend-title+%7B%0A++++text-align%3A+left%3B%0A++++margin-bottom%3A+5px%3B%0A++++font-weight%3A+bold%3B%0A++++font-size%3A+90%25%3B%0A++++%7D%0A++.maplegend+.legend-scale+ul+%7B%0A++++margin%3A+0%3B%0A++++margin-bottom%3A+5px%3B%0A++++padding%3A+0%3B%0A++++float%3A+left%3B%0A++++list-style%3A+none%3B%0A++++%7D%0A++.maplegend+.legend-scale+ul+li+%7B%0A++++font-size%3A+80%25%3B%0A++++list-style%3A+none%3B%0A++++margin-left%3A+0%3B%0A++++line-height%3A+18px%3B%0A++++margin-bottom%3A+2px%3B%0A++++%7D%0A++.maplegend+ul.legend-labels+li+span+%7B%0A++++display%3A+block%3B%0A++++float%3A+left%3B%0A++++height%3A+16px%3B%0A++++width%3A+30px%3B%0A++++margin-right%3A+5px%3B%0A++++margin-left%3A+0%3B%0A++++border%3A+1px+solid+%23999%3B%0A++++%7D%0A++.maplegend+.legend-source+%7B%0A++++font-size%3A+80%25%3B%0A++++color%3A+%23777%3B%0A++++clear%3A+both%3B%0A++++%7D%0A++.maplegend+a+%7B%0A++++color%3A+%23777%3B%0A++++%7D%0A%3C/style%3E%0A%3C/body%3E%0A%3Cscript%3E++++%0A++++%0A++++++++++++var+map_ab36be12e8184cf0aaa0c02cfa301d11+%3D+L.map%28%0A++++++++++++++++%22map_ab36be12e8184cf0aaa0c02cfa301d11%22%2C%0A++++++++++++++++%7B%0A++++++++++++++++++++center%3A+%5B20.0%2C+0.0%5D%2C%0A++++++++++++++++++++crs%3A+L.CRS.EPSG3857%2C%0A++++++++++++++++++++zoom%3A+2%2C%0A++++++++++++++++++++zoomControl%3A+true%2C%0A++++++++++++++++++++preferCanvas%3A+false%2C%0A++++++++++++++++++++eeInitialize%3A+true%2C%0A++++++++++++++++++++addGoogleMap%3A+true%2C%0A++++++++++++++++++++pluginLatlngpopup%3A+false%2C%0A++++++++++++++++++++pluginFullscreen%3A+true%2C%0A++++++++++++++++++++pluginDraw%3A+true%2C%0A++++++++++++++++++++DrawExport%3A+false%2C%0A++++++++++++++++++++pluginMinimap%3A+false%2C%0A++++++++++++++++++++pluginLayercontrol%3A+false%2C%0A++++++++++++++++++++locateControl%3A+false%2C%0A++++++++++++++++++++searchControl%3A+true%2C%0A++++++++++++++++%7D%0A++++++++++++%29%3B%0A%0A++++++++++++%0A%0A++++++++%0A++++%0A++++++++++++var+tile_layer_ab460e06712246b5afd3c0691ad04396+%3D+L.tileLayer%28%0A++++++++++++++++%22https%3A//%7Bs%7D.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png%22%2C%0A++++++++++++++++%7B%22attribution%22%3A+%22Data+by+%5Cu0026copy%3B+%5Cu003ca+href%3D%5C%22http%3A//openstreetmap.org%5C%22%5Cu003eOpenStreetMap%5Cu003c/a%5Cu003e%2C+under+%5Cu003ca+href%3D%5C%22http%3A//www.openstreetmap.org/copyright%5C%22%5Cu003eODbL%5Cu003c/a%5Cu003e.%22%2C+%22detectRetina%22%3A+false%2C+%22maxNativeZoom%22%3A+24%2C+%22maxZoom%22%3A+24%2C+%22minZoom%22%3A+0%2C+%22noWrap%22%3A+false%2C+%22opacity%22%3A+1%2C+%22subdomains%22%3A+%22abc%22%2C+%22tms%22%3A+false%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++var+tile_layer_9877c684f5d74a4fa43a2bab439579bc+%3D+L.tileLayer%28%0A++++++++++++++++%22https%3A//mt1.google.com/vt/lyrs%3Dm%5Cu0026x%3D%7Bx%7D%5Cu0026y%3D%7By%7D%5Cu0026z%3D%7Bz%7D%22%2C%0A++++++++++++++++%7B%22attribution%22%3A+%22Google%22%2C+%22detectRetina%22%3A+false%2C+%22maxNativeZoom%22%3A+22%2C+%22maxZoom%22%3A+22%2C+%22minZoom%22%3A+0%2C+%22noWrap%22%3A+false%2C+%22opacity%22%3A+1%2C+%22subdomains%22%3A+%22abc%22%2C+%22tms%22%3A+false%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++L.control.fullscreen%28%0A++++++++++++++++%7B%22forceSeparateButton%22%3A+false%2C+%22position%22%3A+%22topleft%22%2C+%22title%22%3A+%22Full+Screen%22%2C+%22titleCancel%22%3A+%22Exit+Full+Screen%22%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++var+options+%3D+%7B%0A++++++++++++++position%3A+%22topleft%22%2C%0A++++++++++++++draw%3A+%7B%7D%2C%0A++++++++++++++edit%3A+%7B%7D%2C%0A++++++++++++%7D%0A++++++++++++//+FeatureGroup+is+to+store+editable+layers.%0A++++++++++++var+drawnItems+%3D+new+L.featureGroup%28%29.addTo%28%0A++++++++++++++++map_ab36be12e8184cf0aaa0c02cfa301d11%0A++++++++++++%29%3B%0A++++++++++++options.edit.featureGroup+%3D+drawnItems%3B%0A++++++++++++var+draw_control_26e6feacf2894da88e0dc205c6bc6f4b+%3D+new+L.Control.Draw%28%0A++++++++++++++++options%0A++++++++++++%29.addTo%28+map_ab36be12e8184cf0aaa0c02cfa301d11+%29%3B%0A++++++++++++map_ab36be12e8184cf0aaa0c02cfa301d11.on%28L.Draw.Event.CREATED%2C+function%28e%29+%7B%0A++++++++++++++++var+layer+%3D+e.layer%2C%0A++++++++++++++++++++type+%3D+e.layerType%3B%0A++++++++++++++++var+coords+%3D+JSON.stringify%28layer.toGeoJSON%28%29%29%3B%0A++++++++++++++++layer.on%28%27click%27%2C+function%28%29+%7B%0A++++++++++++++++++++alert%28coords%29%3B%0A++++++++++++++++++++console.log%28coords%29%3B%0A++++++++++++++++%7D%29%3B%0A++++++++++++++++drawnItems.addLayer%28layer%29%3B%0A+++++++++++++%7D%29%3B%0A++++++++++++map_ab36be12e8184cf0aaa0c02cfa301d11.on%28%27draw%3Acreated%27%2C+function%28e%29+%7B%0A++++++++++++++++drawnItems.addLayer%28e.layer%29%3B%0A++++++++++++%7D%29%3B%0A++++++++++++%0A++++++++%0A++++%0A++++++++++++L.Control.geocoder%28%0A++++++++++++++++%7B%22collapsed%22%3A+true%2C+%22defaultMarkGeocode%22%3A+true%2C+%22position%22%3A+%22topleft%22%7D%0A++++++++++++%29.on%28%27markgeocode%27%2C+function%28e%29+%7B%0A++++++++++++++++map_ab36be12e8184cf0aaa0c02cfa301d11.setView%28e.geocode.center%2C+11%29%3B%0A++++++++++++%7D%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A%0A++++++++%0A++++%0A++++++++++++map_ab36be12e8184cf0aaa0c02cfa301d11.fitBounds%28%0A++++++++++++++++%5B%5B20%2C+0%5D%2C+%5B20%2C+0%5D%5D%2C%0A++++++++++++++++%7B%22maxZoom%22%3A+2%7D%0A++++++++++++%29%3B%0A++++++++%0A++++%0A++++++++++++var+tile_layer_6f76306ba14c438089cd76b9ca9691e5+%3D+L.tileLayer%28%0A++++++++++++++++%22https%3A//earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/maps/420275333450fe93b70f0c1eda166ba3-dfd31b814605658648d9d26b934b82bf/tiles/%7Bz%7D/%7Bx%7D/%7By%7D%22%2C%0A++++++++++++++++%7B%22attribution%22%3A+%22Google+Earth+Engine%22%2C+%22detectRetina%22%3A+false%2C+%22maxNativeZoom%22%3A+24%2C+%22maxZoom%22%3A+24%2C+%22minZoom%22%3A+0%2C+%22noWrap%22%3A+false%2C+%22opacity%22%3A+1.0%2C+%22subdomains%22%3A+%22abc%22%2C+%22tms%22%3A+false%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++var+tile_layer_2505333417d64589aba2f47663d98819+%3D+L.tileLayer%28%0A++++++++++++++++%22https%3A//earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/maps/d3bc0cab372ab933ca34e8713b4f86b0-661db38887978f0ac264d67d6e160fde/tiles/%7Bz%7D/%7Bx%7D/%7By%7D%22%2C%0A++++++++++++++++%7B%22attribution%22%3A+%22Google+Earth+Engine%22%2C+%22detectRetina%22%3A+false%2C+%22maxNativeZoom%22%3A+24%2C+%22maxZoom%22%3A+24%2C+%22minZoom%22%3A+0%2C+%22noWrap%22%3A+false%2C+%22opacity%22%3A+1.0%2C+%22subdomains%22%3A+%22abc%22%2C+%22tms%22%3A+false%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++var+tile_layer_8c35abf613674486b610f85db782a5c5+%3D+L.tileLayer%28%0A++++++++++++++++%22https%3A//earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/maps/45d1e284f6be727ff721f79ba0b5000f-495155c8c1ac99e33cc1c3e6a29f6737/tiles/%7Bz%7D/%7Bx%7D/%7By%7D%22%2C%0A++++++++++++++++%7B%22attribution%22%3A+%22Google+Earth+Engine%22%2C+%22detectRetina%22%3A+false%2C+%22maxNativeZoom%22%3A+24%2C+%22maxZoom%22%3A+24%2C+%22minZoom%22%3A+0%2C+%22noWrap%22%3A+false%2C+%22opacity%22%3A+1.0%2C+%22subdomains%22%3A+%22abc%22%2C+%22tms%22%3A+false%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A++++%0A++++++++++++var+layer_control_d8238ab29e424f6ab878e6d8fc586761+%3D+%7B%0A++++++++++++++++base_layers+%3A+%7B%0A++++++++++++++++++++%22openstreetmap%22+%3A+tile_layer_ab460e06712246b5afd3c0691ad04396%2C%0A++++++++++++++++%7D%2C%0A++++++++++++++++overlays+%3A++%7B%0A++++++++++++++++++++%22Google+Maps%22+%3A+tile_layer_9877c684f5d74a4fa43a2bab439579bc%2C%0A++++++++++++++++++++%22ESA+Land+Cover%22+%3A+tile_layer_6f76306ba14c438089cd76b9ca9691e5%2C%0A++++++++++++++++++++%22Countries%22+%3A+tile_layer_2505333417d64589aba2f47663d98819%2C%0A++++++++++++++++++++%22CONUS%22+%3A+tile_layer_8c35abf613674486b610f85db782a5c5%2C%0A++++++++++++++++%7D%2C%0A++++++++++++%7D%3B%0A++++++++++++L.control.layers%28%0A++++++++++++++++layer_control_d8238ab29e424f6ab878e6d8fc586761.base_layers%2C%0A++++++++++++++++layer_control_d8238ab29e424f6ab878e6d8fc586761.overlays%2C%0A++++++++++++++++%7B%22autoZIndex%22%3A+true%2C+%22collapsed%22%3A+true%2C+%22position%22%3A+%22topright%22%7D%0A++++++++++++%29.addTo%28map_ab36be12e8184cf0aaa0c02cfa301d11%29%3B%0A++++++++%0A%3C/script%3E onload=\"this.contentDocument.open();this.contentDocument.write( decodeURIComponent(this.getAttribute('data-html')));this.contentDocument.close();\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
},
"metadata": {}
}
]
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "Map.publish('ESA Land Cover')",
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<IPython.core.display.Markdown object>",
"text/markdown": "Uploading report and associated data - *please wait...*"
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": "<IPython.core.display.Markdown object>",
"text/markdown": "Your report only contains a single element - did you know you can include additional plots, tables and text in a single report? More info <a href='https://docs.datapane.com/reports/blocks/layout-pages-and-selects' target='_blank'>here</a>"
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": "<IPython.core.display.Markdown object>",
"text/markdown": "Report successfully uploaded. View and share your report <a href='https://datapane.com/reports/E7oqqLA/esa-land-cover/' target='_blank'>here</a>, or edit your report <a href='https://datapane.com/reports/E7oqqLA/esa-land-cover/edit/' target='_blank'>here</a>."
},
"metadata": {}
}
]
},
{
"metadata": {
"trusted": true
},
"id": "42a40a59",
"cell_type": "code",
"source": "geemap.zonal_statistics_by_group(\n dataset,\n countries,\n 'countries.csv',\n statistics_type='SUM',\n denominator=1000000,\n decimal_places=2,\n scale=1000\n)",
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"text": "Computing ... \nGenerating URL ...\nDownloading data from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/tables/a2dbd41f846d6375a10c3e2b74fcebf1-df65315685aaf2133ba4b7669386b2bc:getFeatures\nPlease wait ...\nData downloaded to /home/qiusheng/Downloads/countries.csv\n",
"name": "stdout"
}
]
},
{
"metadata": {
"trusted": true
},
"id": "f4935fd9",
"cell_type": "code",
"source": "geemap.zonal_statistics_by_group(\n dataset,\n conus,\n 'conus.csv',\n statistics_type='SUM',\n denominator=1000000,\n decimal_places=2,\n scale=1000\n)",
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"text": "Computing ... \nGenerating URL ...\nDownloading data from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/tables/902eda966d2c9afc64f6f3b26db4743d-02d94723ac66ce2a4b371b2727ec2e22:getFeatures\nPlease wait ...\nData downloaded to /home/qiusheng/Downloads/conus.csv\n",
"name": "stdout"
}
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
},
"language_info": {
"name": "python",
"version": "3.9.10",
"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": false,
"base_numbering": 1,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"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": "",
"data": {
"description": "esa_landcover.ipynb",
"public": true
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment