{ "cells": [ { "cell_type": "code", "execution_count": 48, "id": "a334d0e4-acce-4de0-9678-cd3e8cfe8107", "metadata": {}, "outputs": [], "source": [ "import geopandas as gpd\n", "from pathlib import Path\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import folium\n", "import seaborn as sns\n", "import datetime as dt\n", "import numpy as np\n", "from branca.colormap import linear" ] }, { "cell_type": "code", "execution_count": 2, "id": "66c1c682-a9bc-4a5c-92b7-72590667df0d", "metadata": {}, "outputs": [], "source": [ "city = 'Luanda'" ] }, { "cell_type": "code", "execution_count": 10, "id": "18389ca3-54a2-40f4-abec-07c9380d5308", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\Owner\\AppData\\Local\\Temp\\ipykernel_17852\\119210925.py:4: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.\n", "\n", " centroid = cat.centroid\n" ] } ], "source": [ "# read catchment AOI\n", "cat = gpd.read_file('AOI/luanda_catchment_level4.shp').to_crs(epsg = 4326)\n", "aoi = gpd.read_file('AOI/luanda.shp').to_crs(epsg = 4326)\n", "centroid = cat.centroid" ] }, { "cell_type": "code", "execution_count": 4, "id": "4c7cc4db-f74f-4514-a042-3524c91d9478", "metadata": {}, "outputs": [], "source": [ "output_folder = Path('output')" ] }, { "cell_type": "markdown", "id": "4dfce44c-7634-4ecc-9bd8-ce32eb92e082", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "### Dams and reservoirs" ] }, { "cell_type": "code", "execution_count": 5, "id": "3cc8fdc1-f999-4ad5-9e6b-a55443fd055e", "metadata": {}, "outputs": [], "source": [ "dams = gpd.read_file(output_folder / f'{city.lower()}_dams.shp')\n", "reservoirs = gpd.read_file(output_folder / f'{city.lower()}_reservoirs.shp')" ] }, { "cell_type": "code", "execution_count": 6, "id": "7d1533af-f632-4421-9821-4b3bda4f0c75", "metadata": {}, "outputs": [], "source": [ "dams['DAM_ID'] = dams['DAM_ID'].astype('int').astype('string')" ] }, { "cell_type": "code", "execution_count": 9, "id": "1a2f6a7f-c9d9-4a25-abf3-74f553092b72", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "