|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "b2a2a558-249e-4ad0-b3e1-397eeb5c0377", |
| 5 | + "id": "49fb9369-003a-4817-81e9-2cb3cc514b0e", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# OECD/SWAC Urban Green Space and tree cover estimation approach\n", |
9 | | - "\n", |
| 9 | + "* **Products used:** \n", |
| 10 | + "[esa_worldcover_2020](https://explorer.digitalearth.africa/products/esa_worldcover_2020), [esa_worldcover_2021](https://explorer.digitalearth.africa/products/esa_worldcover_2021)" |
| 11 | + ] |
| 12 | + }, |
| 13 | + { |
| 14 | + "cell_type": "raw", |
| 15 | + "id": "4943777f-8599-4a2a-ad3d-b21cdc1bde18", |
| 16 | + "metadata": {}, |
| 17 | + "source": [ |
| 18 | + "**Keywords**: :index:`datasets; esa_worldcover_2020`, :index:`datasets; esa_worldcover_2021`" |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "cell_type": "markdown", |
| 23 | + "id": "b2a2a558-249e-4ad0-b3e1-397eeb5c0377", |
| 24 | + "metadata": {}, |
| 25 | + "source": [ |
10 | 26 | "### Background\n", |
11 | 27 | "This notebook shows the [Sahel and West Africa Club's](https://www.oecd.org/swac/) (SWAC, OECD) approach to estimating urban green space and tree cover indicators within African urban agglomerations. Urban green spaces enhance a city's resilience to climate change and sustainability by mitigating extreme weather and gradual threats like drought and erosion. They reduce air pollution, sequester carbon, improve water quality, and support biodiversity and people's physical and mental health. A [SWAC analysis](https://www.oecd-ilibrary.org/development/boosting-african-cities-resilience-to-climate-change_3303cfb3-en) highlights these benefits for African cities and uncovers interesting continental trends.\n", |
12 | 28 | "\n", |
|
143 | 159 | " <meta name="viewport" content="width=device-width,\n", |
144 | 160 | " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", |
145 | 161 | " <style>\n", |
146 | | - " #map_06894361789f5a3b0acf408c2289289f {\n", |
| 162 | + " #map_0a0016f958e13c993f026949793cb32e {\n", |
147 | 163 | " position: relative;\n", |
148 | 164 | " width: 100.0%;\n", |
149 | 165 | " height: 100.0%;\n", |
|
173 | 189 | "<body>\n", |
174 | 190 | " \n", |
175 | 191 | " \n", |
176 | | - " <div class="folium-map" id="map_06894361789f5a3b0acf408c2289289f" ></div>\n", |
| 192 | + " <div class="folium-map" id="map_0a0016f958e13c993f026949793cb32e" ></div>\n", |
177 | 193 | " \n", |
178 | 194 | "</body>\n", |
179 | 195 | "<script>\n", |
180 | 196 | " \n", |
181 | 197 | " \n", |
182 | | - " var map_06894361789f5a3b0acf408c2289289f = L.map(\n", |
183 | | - " "map_06894361789f5a3b0acf408c2289289f",\n", |
| 198 | + " var map_0a0016f958e13c993f026949793cb32e = L.map(\n", |
| 199 | + " "map_0a0016f958e13c993f026949793cb32e",\n", |
184 | 200 | " {\n", |
185 | 201 | " center: [6.6975, -1.6286],\n", |
186 | 202 | " crs: L.CRS.EPSG3857,\n", |
|
189 | 205 | " preferCanvas: false,\n", |
190 | 206 | " }\n", |
191 | 207 | " );\n", |
192 | | - " L.control.scale().addTo(map_06894361789f5a3b0acf408c2289289f);\n", |
| 208 | + " L.control.scale().addTo(map_0a0016f958e13c993f026949793cb32e);\n", |
193 | 209 | "\n", |
194 | 210 | " \n", |
195 | 211 | "\n", |
196 | 212 | " \n", |
197 | 213 | " \n", |
198 | | - " var tile_layer_565e9d20e8c910cb79df3e789f4c3ea3 = L.tileLayer(\n", |
| 214 | + " var tile_layer_94aa53f8dea5a6d1d28f4e2e47a9f6f7 = L.tileLayer(\n", |
199 | 215 | " "https://mt1.google.com/vt/lyrs=s\\u0026x={x}\\u0026y={y}\\u0026z={z}",\n", |
200 | 216 | " {"attribution": "http://mt0.google.com/vt/lyrs=y\\u0026hl=en\\u0026x={x}\\u0026y={y}\\u0026z={z}", "detectRetina": false, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", |
201 | 217 | " );\n", |
202 | 218 | " \n", |
203 | 219 | " \n", |
204 | | - " tile_layer_565e9d20e8c910cb79df3e789f4c3ea3.addTo(map_06894361789f5a3b0acf408c2289289f);\n", |
| 220 | + " tile_layer_94aa53f8dea5a6d1d28f4e2e47a9f6f7.addTo(map_0a0016f958e13c993f026949793cb32e);\n", |
205 | 221 | " \n", |
206 | 222 | " \n", |
207 | | - " map_06894361789f5a3b0acf408c2289289f.fitBounds(\n", |
| 223 | + " map_0a0016f958e13c993f026949793cb32e.fitBounds(\n", |
208 | 224 | " [[6.4975, -1.8286], [6.8975, -1.4286]],\n", |
209 | 225 | " {}\n", |
210 | 226 | " );\n", |
211 | 227 | " \n", |
212 | 228 | " \n", |
213 | | - " function geo_json_ba27429b7f1551c76ecec4478c2e9ebe_styler(feature) {\n", |
| 229 | + " function geo_json_3133d596ddc276ad9109b9a6a622feee_styler(feature) {\n", |
214 | 230 | " switch(feature.id) {\n", |
215 | 231 | " default:\n", |
216 | 232 | " return {"fillOpacity": 0.5, "weight": 2};\n", |
217 | 233 | " }\n", |
218 | 234 | " }\n", |
219 | | - " function geo_json_ba27429b7f1551c76ecec4478c2e9ebe_highlighter(feature) {\n", |
| 235 | + " function geo_json_3133d596ddc276ad9109b9a6a622feee_highlighter(feature) {\n", |
220 | 236 | " switch(feature.id) {\n", |
221 | 237 | " default:\n", |
222 | 238 | " return {"fillOpacity": 0.75};\n", |
223 | 239 | " }\n", |
224 | 240 | " }\n", |
225 | | - " function geo_json_ba27429b7f1551c76ecec4478c2e9ebe_pointToLayer(feature, latlng) {\n", |
| 241 | + " function geo_json_3133d596ddc276ad9109b9a6a622feee_pointToLayer(feature, latlng) {\n", |
226 | 242 | " var opts = {"bubblingMouseEvents": true, "color": "#3388ff", "dashArray": null, "dashOffset": null, "fill": true, "fillColor": "#3388ff", "fillOpacity": 0.2, "fillRule": "evenodd", "lineCap": "round", "lineJoin": "round", "opacity": 1.0, "radius": 2, "stroke": true, "weight": 3};\n", |
227 | 243 | " \n", |
228 | | - " let style = geo_json_ba27429b7f1551c76ecec4478c2e9ebe_styler(feature)\n", |
| 244 | + " let style = geo_json_3133d596ddc276ad9109b9a6a622feee_styler(feature)\n", |
229 | 245 | " Object.assign(opts, style)\n", |
230 | 246 | " \n", |
231 | 247 | " return new L.CircleMarker(latlng, opts)\n", |
232 | 248 | " }\n", |
233 | 249 | "\n", |
234 | | - " function geo_json_ba27429b7f1551c76ecec4478c2e9ebe_onEachFeature(feature, layer) {\n", |
| 250 | + " function geo_json_3133d596ddc276ad9109b9a6a622feee_onEachFeature(feature, layer) {\n", |
235 | 251 | " layer.on({\n", |
236 | 252 | " mouseout: function(e) {\n", |
237 | 253 | " if(typeof e.target.setStyle === "function"){\n", |
238 | | - " geo_json_ba27429b7f1551c76ecec4478c2e9ebe.resetStyle(e.target);\n", |
| 254 | + " geo_json_3133d596ddc276ad9109b9a6a622feee.resetStyle(e.target);\n", |
239 | 255 | " }\n", |
240 | 256 | " },\n", |
241 | 257 | " mouseover: function(e) {\n", |
242 | 258 | " if(typeof e.target.setStyle === "function"){\n", |
243 | | - " const highlightStyle = geo_json_ba27429b7f1551c76ecec4478c2e9ebe_highlighter(e.target.feature)\n", |
| 259 | + " const highlightStyle = geo_json_3133d596ddc276ad9109b9a6a622feee_highlighter(e.target.feature)\n", |
244 | 260 | " e.target.setStyle(highlightStyle);\n", |
245 | 261 | " }\n", |
246 | 262 | " },\n", |
247 | 263 | " });\n", |
248 | 264 | " };\n", |
249 | | - " var geo_json_ba27429b7f1551c76ecec4478c2e9ebe = L.geoJson(null, {\n", |
250 | | - " onEachFeature: geo_json_ba27429b7f1551c76ecec4478c2e9ebe_onEachFeature,\n", |
| 265 | + " var geo_json_3133d596ddc276ad9109b9a6a622feee = L.geoJson(null, {\n", |
| 266 | + " onEachFeature: geo_json_3133d596ddc276ad9109b9a6a622feee_onEachFeature,\n", |
251 | 267 | " \n", |
252 | | - " style: geo_json_ba27429b7f1551c76ecec4478c2e9ebe_styler,\n", |
253 | | - " pointToLayer: geo_json_ba27429b7f1551c76ecec4478c2e9ebe_pointToLayer,\n", |
| 268 | + " style: geo_json_3133d596ddc276ad9109b9a6a622feee_styler,\n", |
| 269 | + " pointToLayer: geo_json_3133d596ddc276ad9109b9a6a622feee_pointToLayer,\n", |
254 | 270 | " });\n", |
255 | 271 | "\n", |
256 | | - " function geo_json_ba27429b7f1551c76ecec4478c2e9ebe_add (data) {\n", |
257 | | - " geo_json_ba27429b7f1551c76ecec4478c2e9ebe\n", |
| 272 | + " function geo_json_3133d596ddc276ad9109b9a6a622feee_add (data) {\n", |
| 273 | + " geo_json_3133d596ddc276ad9109b9a6a622feee\n", |
258 | 274 | " .addData(data);\n", |
259 | 275 | " }\n", |
260 | | - " geo_json_ba27429b7f1551c76ecec4478c2e9ebe_add({"bbox": [-1.8286, 6.4975, -1.4286, 6.8975], "features": [{"bbox": [-1.8286, 6.4975, -1.4286, 6.8975], "geometry": {"coordinates": [[[-1.4286, 6.4975], [-1.4286, 6.8975], [-1.8286, 6.8975], [-1.8286, 6.4975], [-1.4286, 6.4975]]], "type": "Polygon"}, "id": "0", "properties": {"agglosID": 1}, "type": "Feature"}], "type": "FeatureCollection"});\n", |
| 276 | + " geo_json_3133d596ddc276ad9109b9a6a622feee_add({"bbox": [-1.8286, 6.4975, -1.4286, 6.8975], "features": [{"bbox": [-1.8286, 6.4975, -1.4286, 6.8975], "geometry": {"coordinates": [[[-1.4286, 6.4975], [-1.4286, 6.8975], [-1.8286, 6.8975], [-1.8286, 6.4975], [-1.4286, 6.4975]]], "type": "Polygon"}, "id": "0", "properties": {"agglosID": 1}, "type": "Feature"}], "type": "FeatureCollection"});\n", |
261 | 277 | "\n", |
262 | 278 | " \n", |
263 | 279 | " \n", |
264 | | - " geo_json_ba27429b7f1551c76ecec4478c2e9ebe.bindTooltip(\n", |
| 280 | + " geo_json_3133d596ddc276ad9109b9a6a622feee.bindTooltip(\n", |
265 | 281 | " function(layer){\n", |
266 | 282 | " let div = L.DomUtil.create('div');\n", |
267 | 283 | " \n", |
|
285 | 301 | " ,{"className": "foliumtooltip", "sticky": true});\n", |
286 | 302 | " \n", |
287 | 303 | " \n", |
288 | | - " geo_json_ba27429b7f1551c76ecec4478c2e9ebe.addTo(map_06894361789f5a3b0acf408c2289289f);\n", |
| 304 | + " geo_json_3133d596ddc276ad9109b9a6a622feee.addTo(map_0a0016f958e13c993f026949793cb32e);\n", |
289 | 305 | " \n", |
290 | 306 | "</script>\n", |
291 | 307 | "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" |
292 | 308 | ], |
293 | 309 | "text/plain": [ |
294 | | - "<folium.folium.Map at 0x7fca172768f0>" |
| 310 | + "<folium.folium.Map at 0x7fd1f76f9ea0>" |
295 | 311 | ] |
296 | 312 | }, |
297 | 313 | "execution_count": 3, |
|
340 | 356 | { |
341 | 357 | "data": { |
342 | 358 | "application/vnd.jupyter.widget-view+json": { |
343 | | - "model_id": "b8e075f07bea4ef5a331d02c1765b0b7", |
| 359 | + "model_id": "c8df1f17bfe943e28aa570bcfca09529", |
344 | 360 | "version_major": 2, |
345 | 361 | "version_minor": 0 |
346 | 362 | }, |
|
783 | 799 | " 'p_Urban_green_space_WC2020', 'p_Tree_cover_WC2020', \n", |
784 | 800 | " 'p_Urban_green_space_WC2021', 'p_Tree_cover_WC2021', 'geometry']].copy()\n", |
785 | 801 | "\n", |
| 802 | + "# Convert the resulting DataFrame into a GeoDataFrame to handle spatial data, setting the geometry column appropriately and defining the CRS as \"EPSG:4326\"\n", |
786 | 803 | "green_space_indicators = gpd.GeoDataFrame(green_space_indicators, geometry='geometry', crs=\"EPSG:4326\")\n", |
787 | 804 | "# Display final DataFrame\n", |
788 | 805 | "green_space_indicators.head()\n" |
|
0 commit comments