|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "id": "6ce9d524-db59-44c6-9122-c84a2e3594a1", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "# **RDL - CCDR analytics interface**\n", |
| 9 | + "\n", |
| 10 | + "## Bivariate Risk-Poverty Mapping Tool\n", |
| 11 | + "\n", |
| 12 | + "<p>This tool creates bivariate maps combining hazard risk analytics with relative wealth index data.</p>\n", |
| 13 | + "<p>Input data should be a GeoPackage file with administrative boundaries containing fields for: Unit ID, Unit NAME, Unit POP, RWI, and hazard score (e.g., FL EAI).</p>\n", |
| 14 | + "<p>The tool calculates population-weighted relative wealth index and combines it with hazard data into a bivariate choropleth map.</p>\n", |
| 15 | + "\n", |
| 16 | + "### Cell > Run all or CTRL + Enter" |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + "cell_type": "code", |
| 21 | + "execution_count": 1, |
| 22 | + "id": "86fc5cc8-22d6-4dfd-816f-739ed9738273", |
| 23 | + "metadata": {}, |
| 24 | + "outputs": [ |
| 25 | + { |
| 26 | + "data": { |
| 27 | + "application/vnd.jupyter.widget-view+json": { |
| 28 | + "model_id": "ecae8f2f424045399c6a067d866f6db9", |
| 29 | + "version_major": 2, |
| 30 | + "version_minor": 0 |
| 31 | + }, |
| 32 | + "text/plain": [ |
| 33 | + "VBox(children=(HTML(value='\\n <div style=\\'\\n background: linear-gradient(to bottom, #003366, transp…" |
| 34 | + ] |
| 35 | + }, |
| 36 | + "metadata": {}, |
| 37 | + "output_type": "display_data" |
| 38 | + }, |
| 39 | + { |
| 40 | + "data": { |
| 41 | + "text/html": [ |
| 42 | + "\n", |
| 43 | + " <script>\n", |
| 44 | + " document.querySelector('.file-path-text-3148162213648').onmouseover = function() {\n", |
| 45 | + " document.querySelector('.info-box textarea').value = 'Enter the path to your GeoPackage file containing boundary data with wealth and hazard information.';\n", |
| 46 | + " };\n", |
| 47 | + " document.querySelector('.layer-selector-3148162608784').onmouseover = function() {\n", |
| 48 | + " document.querySelector('.info-box textarea').value = 'Select the layer from the GeoPackage file to analyze. This is only applicable if your file contains multiple layers.';\n", |
| 49 | + " };\n", |
| 50 | + " document.querySelector('.id-field-selector-3148162605088').onmouseover = function() {\n", |
| 51 | + " document.querySelector('.info-box textarea').value = 'Select the field that contains unique identifiers for each boundary feature.';\n", |
| 52 | + " };\n", |
| 53 | + " document.querySelector('.name-field-selector-3148162599376').onmouseover = function() {\n", |
| 54 | + " document.querySelector('.info-box textarea').value = 'Select the field that contains the name or label for each boundary feature.';\n", |
| 55 | + " };\n", |
| 56 | + " document.querySelector('.population-field-selector-3148162603984').onmouseover = function() {\n", |
| 57 | + " document.querySelector('.info-box textarea').value = 'Select the field that contains population data. This is used to calculate population-weighted wealth index.';\n", |
| 58 | + " };\n", |
| 59 | + " document.querySelector('.wealth-field-selector-3148162219072').onmouseover = function() {\n", |
| 60 | + " document.querySelector('.info-box textarea').value = 'Select the field that contains relative wealth index (RWI) or other wealth indicator data.';\n", |
| 61 | + " };\n", |
| 62 | + " document.querySelector('.hazard-field-selector-3148162606960').onmouseover = function() {\n", |
| 63 | + " document.querySelector('.info-box textarea').value = 'Select the field that contains hazard risk data (e.g., flood risk index, expected annual impact).';\n", |
| 64 | + " };\n", |
| 65 | + " document.querySelector('.quantiles-selector-3148162601536').onmouseover = function() {\n", |
| 66 | + " document.querySelector('.info-box textarea').value = 'Select the number of quantiles to use for classifying both wealth and hazard data.\\n\\n3×3 creates a 9-cell bivariate map (tertiles)\\n4×4 creates a 16-cell bivariate map (quartiles)\\n5×5 creates a 25-cell bivariate map (quintiles)';\n", |
| 67 | + " };\n", |
| 68 | + " document.querySelector('.bivariate-palette-selector-3148162597456').onmouseover = function() {\n", |
| 69 | + " document.querySelector('.info-box textarea').value = 'Select the bivariate color palette to use for the map. Each palette is designed to show both poverty and hazard risk with appropriate color relationships.';\n", |
| 70 | + " };\n", |
| 71 | + " </script>\n", |
| 72 | + " " |
| 73 | + ], |
| 74 | + "text/plain": [ |
| 75 | + "<IPython.core.display.HTML object>" |
| 76 | + ] |
| 77 | + }, |
| 78 | + "metadata": {}, |
| 79 | + "output_type": "display_data" |
| 80 | + } |
| 81 | + ], |
| 82 | + "source": [ |
| 83 | + "%matplotlib inline\n", |
| 84 | + "from gui_bivariate_utils import initialize_tool\n", |
| 85 | + "initialize_tool()" |
| 86 | + ] |
| 87 | + }, |
| 88 | + { |
| 89 | + "cell_type": "markdown", |
| 90 | + "id": "8f194706-429e-440a-a09d-26aaa17077be", |
| 91 | + "metadata": {}, |
| 92 | + "source": [ |
| 93 | + "### Methodology\n", |
| 94 | + "\n", |
| 95 | + "#### Population-Weighted Relative Wealth Index\n", |
| 96 | + "The Relative Wealth Index (RWI) is weighted by population to provide a more accurate representation of wealth distribution across administrative areas:\n", |
| 97 | + "\n", |
| 98 | + "1. Calculate the population-weighted RWI for each area: `RWI × Population density`\n", |
| 99 | + "2. Sum these values across all areas\n", |
| 100 | + "3. Divide each area's weighted value by the total sum\n", |
| 101 | + "4. Normalize the resulting values to create w_RWIxPOP\n", |
| 102 | + "\n", |
| 103 | + "#### Bivariate Mapping\n", |
| 104 | + "The bivariate map combines two variables (wealth and hazard risk) into a single visualization:\n", |
| 105 | + "\n", |
| 106 | + "1. Both variables are classified into the selected number of quantiles\n", |
| 107 | + "2. The two classifications are combined into a matrix where each cell represents a specific combination\n", |
| 108 | + "3. Colors are assigned based on the selected color palettes, creating a 3×3, 4×4 or 5x5 grid of colors\n", |
| 109 | + "\n", |
| 110 | + "This approach allows for visualizing the relationship between poverty and hazard risk in a single map, highlighting areas with different combinations of wealth and vulnerability." |
| 111 | + ] |
| 112 | + } |
| 113 | + ], |
| 114 | + "metadata": { |
| 115 | + "kernelspec": { |
| 116 | + "display_name": "Python 3 (ipykernel)", |
| 117 | + "language": "python", |
| 118 | + "name": "python3" |
| 119 | + }, |
| 120 | + "language_info": { |
| 121 | + "codemirror_mode": { |
| 122 | + "name": "ipython", |
| 123 | + "version": 3 |
| 124 | + }, |
| 125 | + "file_extension": ".py", |
| 126 | + "mimetype": "text/x-python", |
| 127 | + "name": "python", |
| 128 | + "nbconvert_exporter": "python", |
| 129 | + "pygments_lexer": "ipython3", |
| 130 | + "version": "3.10.14" |
| 131 | + } |
| 132 | + }, |
| 133 | + "nbformat": 4, |
| 134 | + "nbformat_minor": 5 |
| 135 | +} |
0 commit comments