From 01bd75cb66e6053679f1adf4d2e84ed8cd235a83 Mon Sep 17 00:00:00 2001 From: Charlie Marshak Date: Mon, 26 Feb 2024 17:40:24 -0800 Subject: [PATCH] radd --- CHANGELOG.md | 8 +- README.md | 5 +- notebooks/Basic_Demo.ipynb | 193 ++++++++--- notebooks/tile_creation/6_RADD.ipynb | 301 ++++++++++++++++++ ...radd_deforestation_alerts_2022.geojson.zip | Bin 0 -> 1548 bytes src/tile_mate/stitcher.py | 1 + tests/test_stitch_api.py | 10 +- 7 files changed, 471 insertions(+), 47 deletions(-) create mode 100644 notebooks/tile_creation/6_RADD.ipynb create mode 100644 src/tile_mate/data/radd_deforestation_alerts_2022.geojson.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index eb91fe0..35f45b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.0.8] +## [0.0.9] ## Added -* Test (and fix bugs) in exception handling related to coverage, tile set names available, and keyword arguments. -* Hansen datasets including `treecover 2000`, `gain`, `lossyear` as indicated here: https://data.globalforestwatch.org/documents/941f17325a494ed78c4817f9bb20f33a/explore +* Hansen datasets including `treecover_2000`, `gain`, `lossyear` (these are the tile shortnames). Infomration on these tiles can be found here: https://data.globalforestwatch.org/documents/941f17325a494ed78c4817f9bb20f33a/explore +* RADD Deforestation Alerts from 2022 (with shortname `radd_deforestation_alerts_2022`): https://data.globalforestwatch.org/datasets/gfw::deforestation-alerts-radd/about +## Fixed +* Test (and fix bugs) in exception handling related to tile coverage, tile sets available, and keyword arguments for certain tiles (e.g. year and season). ## [0.0.8] * Fix typo in `pekel_water_occ_2021` and other instances of misspelled name: `peckel` --> `pekel` diff --git a/README.md b/README.md index d8396aa..1d78fdf 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The datasets supported are: In [1]: from tile_mate.stitcher import DATASET_SHORTNAMES In [2]: DATASET_SHORTNAMES -Out[2]: ['pekel_water_occ_2021', +Out[2]: 'pekel_water_occ_2021', 'esa_world_cover_2020', 'esa_world_cover_2021', 'hansen_annual_mosaic', @@ -71,7 +71,8 @@ Out[2]: ['pekel_water_occ_2021', 'hansen_treecover_2000', 's1_coherence_2020', 'cop_100_lulc_discrete', - 'hand'] + 'radd_deforestation_alerts_2022', + 'hand' ``` These correspond to + Pekel: https://global-surface-water.appspot.com/download diff --git a/notebooks/Basic_Demo.ipynb b/notebooks/Basic_Demo.ipynb index 6d1cb87..c83dfe5 100644 --- a/notebooks/Basic_Demo.ipynb +++ b/notebooks/Basic_Demo.ipynb @@ -53,6 +53,7 @@ " 'hansen_treecover_2000',\n", " 's1_coherence_2020',\n", " 'cop_100_lulc_discrete',\n", + " 'radd_deforestation_alerts_2022',\n", " 'hand']" ] }, @@ -83,16 +84,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|██████████| 1/1 [00:00<00:00, 6288.31it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:14<00:00, 14.11s/it]\n" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 704\n", + "Reading tile imagery: 100%|█| 1/1 [00:02<00:00, 2.0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 588 ms, sys: 121 ms, total: 709 ms\n", - "Wall time: 32 s\n" + "CPU times: user 520 ms, sys: 109 ms, total: 629 ms\n", + "Wall time: 8.11 s\n" ] }, { @@ -200,16 +201,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 12018.06it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:05<00:00, 5.32s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 103\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 1.1" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 186 ms, sys: 129 ms, total: 315 ms\n", - "Wall time: 18.5 s\n" + "CPU times: user 168 ms, sys: 108 ms, total: 276 ms\n", + "Wall time: 2.92 s\n" ] }, { @@ -298,16 +299,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 10979.85it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:06<00:00, 6.20s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 942\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 1.0" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 187 ms, sys: 137 ms, total: 324 ms\n", - "Wall time: 18.1 s\n" + "CPU times: user 159 ms, sys: 101 ms, total: 260 ms\n", + "Wall time: 2.83 s\n" ] }, { @@ -388,16 +389,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|██████████| 1/1 [00:00<00:00, 9686.61it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:04<00:00, 4.12s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 991\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 1.9" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 110 ms, sys: 55.9 ms, total: 165 ms\n", - "Wall time: 15.2 s\n" + "CPU times: user 109 ms, sys: 41.8 ms, total: 151 ms\n", + "Wall time: 2.36 s\n" ] }, { @@ -437,7 +438,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -480,16 +481,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 10205.12it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:03<00:00, 3.14s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 100\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 2.3" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 105 ms, sys: 48.9 ms, total: 154 ms\n", - "Wall time: 14.6 s\n" + "CPU times: user 95.4 ms, sys: 34 ms, total: 129 ms\n", + "Wall time: 2.16 s\n" ] }, { @@ -572,16 +573,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 12483.05it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:03<00:00, 3.23s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 116\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 2.3" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 102 ms, sys: 44.9 ms, total: 147 ms\n", - "Wall time: 14.3 s\n" + "CPU times: user 91.9 ms, sys: 30.3 ms, total: 122 ms\n", + "Wall time: 2.22 s\n" ] }, { @@ -630,16 +631,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 16194.22it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:03<00:00, 3.43s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 714\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 2.3" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 149 ms, sys: 50.3 ms, total: 199 ms\n", - "Wall time: 15.8 s\n" + "CPU times: user 116 ms, sys: 33.5 ms, total: 150 ms\n", + "Wall time: 2.51 s\n" ] }, { @@ -721,16 +722,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 12052.60it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:03<00:00, 3.31s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 188\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 2.4" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 6.3 s, sys: 154 ms, total: 6.46 s\n", - "Wall time: 26.1 s\n" + "CPU times: user 6.24 s, sys: 150 ms, total: 6.39 s\n", + "Wall time: 9.22 s\n" ] }, { @@ -815,16 +816,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|██████████| 1/1 [00:00<00:00, 8050.49it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:03<00:00, 3.20s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 126\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 1.2" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 139 ms, sys: 78.6 ms, total: 217 ms\n", - "Wall time: 27.8 s\n" + "CPU times: user 115 ms, sys: 32.1 ms, total: 147 ms\n", + "Wall time: 7.05 s\n" ] }, { @@ -908,16 +909,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "Reading tile metadata: 100%|█████████| 1/1 [00:00<00:00, 10305.42it/s]\n", - "Reading tile imagery: 100%|█████████████| 1/1 [00:10<00:00, 10.07s/it]" + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 907\n", + "Reading tile imagery: 100%|█| 1/1 [00:01<00:00, 1.3" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 844 ms, sys: 200 ms, total: 1.04 s\n", - "Wall time: 23.1 s\n" + "CPU times: user 785 ms, sys: 147 ms, total: 932 ms\n", + "Wall time: 3.89 s\n" ] }, { @@ -981,6 +982,116 @@ " interpolation='none',\n", " cmap='viridis')" ] + }, + { + "cell_type": "markdown", + "id": "2d6cce6b-24ff-4dc3-be68-323cd0f9e8d0", + "metadata": {}, + "source": [ + "# RADD\n", + "\n", + "From the RADD [website](https://data.globalforestwatch.org/datasets/gfw::deforestation-alerts-radd/about):\n", + "\n", + "```\n", + "Each pixel (alert) encodes the date of disturbance and confidence level in one integer value. The leading integer of the decimal representation is 2 for a low-confidence alert and 3 for a high-confidence alert, followed by the number of days since December 31, 2014. 0 is the no-data value. For example:\n", + "\n", + "* 20001 is a low confidence alert on January 1st, 2015\n", + "* 30055 is a high confidence alert on February 24, 2015\n", + "* 21847 is a low confidence alert on January 21, 2020\n", + "* 0 represents no alert\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "824dd760-c7a9-40bd-9080-4061d2125d36", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Reading tile metadata: 100%|█| 1/1 [00:00<00:00, 178\n", + "Reading tile imagery: 100%|█| 1/1 [00:00<00:00, 2.1" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 59.8 ms, sys: 9.25 ms, total: 69.1 ms\n", + "Wall time: 510 ms\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "data": { + "text/plain": [ + "array([ 0, 22119, 23259, 23271, 23283, 23295, 23307, 32023, 32035,\n", + " 32047, 32059, 32071, 32083, 32131, 32155, 32167, 32275, 32323,\n", + " 32461, 32779, 32791, 32803, 32827, 32839, 32851, 32863, 32875,\n", + " 32887, 32899, 32911, 32923, 32935, 32947, 32959, 32971, 32983,\n", + " 33067, 33079, 33103, 33115, 33127, 33139, 33151, 33163, 33175,\n", + " 33187, 33199, 33211, 33247, 33271, 33283, 33295, 33307, 33319],\n", + " dtype=uint16)" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "%%time\n", + "\n", + "amzn_bounds = [-53, -2, -52.95, -1.95]\n", + "\n", + "X_radd, p_radd = get_raster_from_tiles(amzn_bounds, \n", + " tile_shortname='radd_deforestation_alerts_2022',\n", + " )\n", + "np.unique(X_radd)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "e6ea7a83-72de-4d33-936c-5a6fe613b802", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdMAAAGiCAYAAAC8gCzJAAAAOXRFWHRT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YV199VdOnT1dMTIzP5wMAQGd8+p5pdXW1XC6Xqqur1dLSIpfLJZfLpcbGRu+Y1NRUFRcXe69v2bJFJSUl3q/HTJs2TXl5ecrOzm5z7L/+9a969913NXfuXF8uAQCAa/LpV2OWLl2qDRs2eK+npaVJkvbs2aPMzExJUkVFhdxut3dMTU2NFi9erLq6OiUkJGjWrFlasmRJu2OvW7dOI0eObBdZAAD6WoAxxvh7En2toaFBTqdTEx7frqCwof6eDgCgh1ouNunDJ6fL7XYrIiLC39PpX1+NAQBgICKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFgipgAAWCKmAABYIqYAAFjyaUxXrVqljIwMORwORUZGdusxdXV1mj17thITE+VwOJSTk6PKyso2Y2prazVz5kzFx8dr6NChmjhxorZu3eqDFQAAcG0+janH41F+fr7mz5/frfHGGOXl5enEiRPatm2bysrKlJycrKysLDU1NXnHzZw5UxUVFdq+fbs++ugj3XvvvZoxY4bKysp8tRQAADrl05iuWLFCixYt0m233dat8ZWVlTpw4IBefvllffe739W4ceO0Zs0aNTY2auPGjd5x+/fv14IFC/S9731PN910k371q18pMjJShw8f7vC4zc3NamhoaHMBAOB66VfvmTY3N0uSwsLCvLcFBQUpJCREe/fu9d72d3/3d9q8ebPOnTun1tZWbdq0Sc3NzcrMzOzwuKtXr5bT6fRekpKSfLoOAMA3S7+KaWpqqpKTk1VU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l48KA5efKk2bVrlxk3bpy5//77uzzugw8+aEaOHGl27txpDh8+bO68805z++23m6+//to7Jicnx9x6661m3759Zt++febWW281d911l8/WauNa+/Tqq6+aBQsWmJKSElNVVWVef/11Ex4ebl588cVOj9nY2Ghuuukmc88995gPP/zQfPjhh+bHP/6x+e53v2taWlqMMcZ88sknZvjw4ebBBx80x44dMx988IHJyMgw//iP/+jzNfeGv/bJGGPGjBljfvSjH5kjR46Y48ePm1/84hfG4XCYmpoan665N/y1T83NzW2es6amxsydO9ekpKSY1tZWn6+7p/z587R161YzfPhw8/LLL5uKigpz7Ngxs2XLFp+ut7f8uU/Xeu7uGDQxff7553v0mBdeeMGMGjWq0/vPnz9vgoODzaZNm7y3ffLJJyYwMND84Q9/MMYY8+c//9lIMgcOHPCO2b9/v5Fkjh071rNF9IHe7NMvfvELc+edd3Z6/9tvv20CAwON2+323nbu3DkjyezcudMYY8zatWtNbGxsmx/esrIyI8lUVlb2bBF9wF/79OmnnxpJ5t133/WOaWhoMJLMrl27eraIPuCvfbqax+MxsbGx5oknnujRXPqKv/bpq6++MiNHjjT/9V//1at59zV//jz15rmvNihe5pWkp59+WiNGjNB3vvMdrVq1Sh6Pp9OxZ86c0f/8z/9o6tSpnY651j/1Jkn79++X0+nU5MmTvWPuuOMOOZ1O75j+pif7JF37n81rbm5WQEBAm99CEhYWpsDAQO3du9c7JiQkpM2vkwwPD5ck75j+xh/7NGLECN1yyy36zW9+o6amJn399ddau3at4uLilJ6efn0Wdp35Y5+utn37dn322WfeX/zSH/ljnw4fPqxPPvlEgYGBSktLU0JCgnJzc3X06NHrsygf8OfPU0+fux2rFPcTzz33nCkpKTFHjhwx//mf/2mio6PNnDlz2o0rKCgw4eHhRpK5++67zYULFzo95htvvGFCQkLa3T5t2jTz85//3BhjzKpVq8zYsWPbjRk7dqx58sknLVbkG93dp8v27dtngoODzf/93/91Oubs2bMmIiLCPPTQQ6apqck0Njaaf/7nfzaSvPtUXl5uhgwZYp555hnT3Nxszp07Z+69914jiX26Yp+MMeb06dMmPT3dBAQEmKCgIJOYmGjKysqu5/KuG3/u05Vyc3NNbm6u9Xp8xV/7tHHjRiPJ3HjjjWbr1q2mtLTU3H///WbEiBHm888/v+7rtOXPn6eePndH+m1Mly1bZiR1eTl48GCHj926dauRZD777LM2t9fU1Ji//OUv5n//93/Nt7/9bTN//vxOn7+zmGZlZZl58+YZYy7F9Fvf+la7MWPGjDGrV6/uyXJ7zRf7ZMylAMbExJiVK1decw5vv/22uemmm7wB+MlPfmImTpzYZn/feOMNExcXZ4KCgkxISIj55S9/aeLi4szTTz/d+8X3wEDYp9bWVjN9+nSTm5tr9u7daw4dOmTmz59vRo4cac6cOWO3Ad00EPbpSqdOnTKBgYFm69atPV+shYGwT2+88YaRZNauXet9zMWLF010dLR55ZVXernynhkI+9TT5+5Mv43pp59+av7yl790eenszPL06dPt3su82nvvvWckdfo/qXfeecdIMufOnWtz+4QJE8zSpUuNMZfeEHc6ne0e63Q6zbp167q5Uju+2KejR4+a2NhY8/jjj/d4LvX19cYYY+Li4swzzzzTbkxtba354osvTGNjowkMDDT//d//3aPn6K2BsE+7du1q9/6OMX37l7OBsE9XeuKJJ0xMTIzxeDw9OratgbBPu3fvNpLMe++912b89773vR4/R28NhH3qyXN3pd/G1Mbvf/97I8n87W9/63TMu+++aySZjz/+uMP7L38AafPmzd7bzpw50+EHkP70pz95xxw4cKDffgDpah3tU3l5uYmNjTWPPPJIr4/7zjvvmICAgC734NVXXzUOh8P7w92f9dU+bd++3QQGBrb7FOG3vvUts2rVql4/T1/p65+n1tZWM3r0aPPwww/3+tj+0Ff75Ha7TWhoaJsPIF3+sNaVZ6v9lT///9SdhlxtwMd037595rnnnjNlZWXmxIkTZvPmzSYxMdFMnz7dO+att94y69atMx999JH5+OOPzVtvvWXGjx9vpkyZ4h1z+vRpM27cuDZhfPDBB82oUaPMrl27zOHDh80PfvCDDr8aM2HCBLN//36zf/9+c9ttt/XLr8Z0Z58uv3TywAMPtPmI+NmzZ71jOtqndevWmf3795u//vWv5vXXXzdRUVFm8eLFbZ7/xRdfNIcOHTIVFRXmpZdeMuHh4eaFF17w/cJ7yJ/79Omnn5oRI0aYe++917hcLlNRUWF++ctfmuDgYONyufpmA7rJ3z9Pxlw6k5dk/vznP/t2sRb8vU8PPfSQGTlypHn77bfNsWPHzJw5c0xsbGy7V9z8zZ/71J3n7o4BH9NDhw6ZyZMnG6fTacLCwsy4cePMsmXLTFNTk3fM7t27zfe//33vmLFjx5pHH320zVnRxx9/bCSZPXv2eG+7cOGCKSwsNFFRUSY8PNzcddddprq6us3zf/755+aBBx4ww4YNM8OGDTMPPPBAvzzb6s4+dfb+RnJysndMR/v06KOPmri4OBMcHGzGjh1rnn322Xbf95s5c6aJiooyISEhZsKECeY3v/mNr5fcK/7ep4MHD5rs7GwTFRVlhg0bZu644w6zY8cOXy+7x/y9T8YYc//995uMjAxfLtOav/fJ4/GYhx9+2MTGxpphw4aZrKwsU15e7utl95g/96k7z90d/BNsAABYGjTfMwUAwF+IKQAAlogpAACWiCkAAJaIKQAAlogpAACWiCkAAJaIKQAAlogpAACWiCkAAJaIKQAAlv4frH4nWt4u02EAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "show(X_radd, \n", + " transform=p_radd['transform'], \n", + " interpolation='none',\n", + " cmap='tab20c')" + ] } ], "metadata": { diff --git a/notebooks/tile_creation/6_RADD.ipynb b/notebooks/tile_creation/6_RADD.ipynb new file mode 100644 index 0000000..72db03a --- /dev/null +++ b/notebooks/tile_creation/6_RADD.ipynb @@ -0,0 +1,301 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "1e2d311e-1c23-419f-82f2-e1074c99ef7a", + "metadata": {}, + "outputs": [], + "source": [ + "import geopandas as gpd\n", + "from tile_mate.tile_model import TILE_SCHEMA\n", + "from tile_mate.stitcher import DATA_DIR\n", + "from dem_stitcher.geojson_io import to_geojson_gzip\n", + "import requests" + ] + }, + { + "cell_type": "markdown", + "id": "3d7d1196-2f51-4659-b3dd-c034e3663ecf", + "metadata": {}, + "source": [ + "Source: https://data.globalforestwatch.org/datasets/gfw::deforestation-alerts-radd/about" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ad3c4086-39b6-4d52-8cc2-0f944ff43d59", + "metadata": {}, + "outputs": [], + "source": [ + "url = 'https://opendata.arcgis.com/api/v3/datasets/d10aed6037844b86bab85d42bb27954a_0/downloads/data?format=geojson&spatialRefId=4326&where=1%3D1'\n", + "resp = requests.get(url)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "b88e512c-2351-4f18-adee-62dd9229acd4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
geometrytile_iddownloadObjectIdShape__AreaShape__Length
0POLYGON ((0.00000 0.00000, 10.00000 0.00000, 1...00N_000Ehttps://data-api.globalforestwatch.org/dataset...11.245543e+124.464170e+06
1POLYGON ((10.00000 0.00000, 20.00000 0.00000, ...00N_010Ehttps://data-api.globalforestwatch.org/dataset...21.245543e+124.464170e+06
2POLYGON ((20.00000 0.00000, 30.00000 0.00000, ...00N_020Ehttps://data-api.globalforestwatch.org/dataset...31.245543e+124.464170e+06
3POLYGON ((30.00000 0.00000, 40.00000 0.00000, ...00N_030Ehttps://data-api.globalforestwatch.org/dataset...41.245543e+124.464170e+06
4POLYGON ((40.00000 0.00000, 50.00000 0.00000, ...00N_040Ehttps://data-api.globalforestwatch.org/dataset...51.245543e+124.464170e+06
\n", + "
" + ], + "text/plain": [ + " geometry tile_id \\\n", + "0 POLYGON ((0.00000 0.00000, 10.00000 0.00000, 1... 00N_000E \n", + "1 POLYGON ((10.00000 0.00000, 20.00000 0.00000, ... 00N_010E \n", + "2 POLYGON ((20.00000 0.00000, 30.00000 0.00000, ... 00N_020E \n", + "3 POLYGON ((30.00000 0.00000, 40.00000 0.00000, ... 00N_030E \n", + "4 POLYGON ((40.00000 0.00000, 50.00000 0.00000, ... 00N_040E \n", + "\n", + " download ObjectId Shape__Area \\\n", + "0 https://data-api.globalforestwatch.org/dataset... 1 1.245543e+12 \n", + "1 https://data-api.globalforestwatch.org/dataset... 2 1.245543e+12 \n", + "2 https://data-api.globalforestwatch.org/dataset... 3 1.245543e+12 \n", + "3 https://data-api.globalforestwatch.org/dataset... 4 1.245543e+12 \n", + "4 https://data-api.globalforestwatch.org/dataset... 5 1.245543e+12 \n", + "\n", + " Shape__Length \n", + "0 4.464170e+06 \n", + "1 4.464170e+06 \n", + "2 4.464170e+06 \n", + "3 4.464170e+06 \n", + "4 4.464170e+06 " + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = gpd.GeoDataFrame.from_features(resp.json())\n", + "df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "b956f1fa-dc17-429d-b15c-9e765f09fbf3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tile_idurlgeometry
000N_000Ehttps://data-api.globalforestwatch.org/dataset...POLYGON ((0.00000 0.00000, 10.00000 0.00000, 1...
100N_010Ehttps://data-api.globalforestwatch.org/dataset...POLYGON ((10.00000 0.00000, 20.00000 0.00000, ...
200N_020Ehttps://data-api.globalforestwatch.org/dataset...POLYGON ((20.00000 0.00000, 30.00000 0.00000, ...
300N_030Ehttps://data-api.globalforestwatch.org/dataset...POLYGON ((30.00000 0.00000, 40.00000 0.00000, ...
400N_040Ehttps://data-api.globalforestwatch.org/dataset...POLYGON ((40.00000 0.00000, 50.00000 0.00000, ...
\n", + "
" + ], + "text/plain": [ + " tile_id url \\\n", + "0 00N_000E https://data-api.globalforestwatch.org/dataset... \n", + "1 00N_010E https://data-api.globalforestwatch.org/dataset... \n", + "2 00N_020E https://data-api.globalforestwatch.org/dataset... \n", + "3 00N_030E https://data-api.globalforestwatch.org/dataset... \n", + "4 00N_040E https://data-api.globalforestwatch.org/dataset... \n", + "\n", + " geometry \n", + "0 POLYGON ((0.00000 0.00000, 10.00000 0.00000, 1... \n", + "1 POLYGON ((10.00000 0.00000, 20.00000 0.00000, ... \n", + "2 POLYGON ((20.00000 0.00000, 30.00000 0.00000, ... \n", + "3 POLYGON ((30.00000 0.00000, 40.00000 0.00000, ... \n", + "4 POLYGON ((40.00000 0.00000, 50.00000 0.00000, ... " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_formatted = df[['tile_id', 'download', 'geometry']].copy()\n", + "df_formatted = df_formatted.rename(columns={'download': 'url'})\n", + "df_formatted.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "5c03447e-c6cc-401e-b25e-d3a5338dc79c", + "metadata": {}, + "outputs": [], + "source": [ + "df_radd = TILE_SCHEMA.validate(df_formatted)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "69047a72-cd48-4308-b09c-f1a34517e656", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/Users/cmarshak/bekaert-team/tile-mate/src/tile_mate/data/radd_deforestation_alerts_2022.geojson.zip'" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "to_geojson_gzip(df_radd, str(DATA_DIR / 'radd_deforestation_alerts_2022.geojson.zip'))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "tile-mate", + "language": "python", + "name": "tile-mate" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/src/tile_mate/data/radd_deforestation_alerts_2022.geojson.zip b/src/tile_mate/data/radd_deforestation_alerts_2022.geojson.zip new file mode 100644 index 0000000000000000000000000000000000000000..b4e37998dc216b391121c588d1f422c14f63305c GIT binary patch literal 1548 zcmV+n2J`tJiwFoTI^AUg|8ikuWM5=uW^Zz3b97;JX>V>{VQgh`baP)aFfuYOXJv0{ zb8l`gdTDR~&6`0_<46#N{|d^16DIC%+i^xhdsyurS1WPw0inpmPA1w+90el=jri}I z025EQU$B%K=@o|&53EV}UK?EXs(y^xmu)@zaxwb5F59PF{b#dY*YkGOY(`fXqs99d zANLpB{Rl5TT(I3W+j`fo-Y(f+v0B%&Rdu*1j{lj(as1ces;Axh@TIS9yM6pJ9#>^s zM&)*Oy<9gB<$BTVU!i?2+xge)X19F%_G8_SpPzQKU0GGLa=m|v$ML#s_t%Z9=6SPj z%4)o#c{CE#HKi|ORcJ;kp&%V{=X0=(~?Em+AHg7hI%kPKx z5dBxb+}J9M=T)9Zxl8gWna7K$%&IhcsHSE0kmhNb&quHOA7uZM-|BYv^8Ukq;P|&$ zzbxN*&6{Rdtu}`@dO&t}7hlI$7yEziuP*LPUqt3Z0(JQO{{D6UvgeRDZ1RRo-lJ{% z;t1OyDT8m>@GTj>$J_PAk+wxr2H&yaJ2HHachVO}+73w>{DciZA;b50r+smxoggWN zU$Eg9RQQocKXO1Ffkz3{G6zz&11Z}9@5l#!gv3**We#L)2Qsz;na4Z@sw193EpuSP zc3{GGVB#^)fa-`(pq4q1vmMCU4&)y52~ZvJ9BP>ZQ}$!fl>8Vp^=nKKLa|={Q+(0dJfZYW$ z>@HBi+yT`Qw@}L*V7Gz{yA>2LPk`!(JE&z2u=_!V-46s|bD#IMe+DKLtu=fMIvqwB)`)kZ5oYjOHSQ2CzGBT4LWIM>IGFMzOrm z0Cwj`OX?fMhz6&?D3uo)!0tY134MbU(clmmh4MlJ*ewVxnQssx8k_;6OkQX}$~Hhr z%N^D>SQE2oZR~s>QueLD zekcmgeg>t*cSib~EGXC(sL02Lc2K*cpJFZaA!GZXBqkf$MD4g|SPOlauzgUHmJRKr zcHAde3w_AhJ}3#zhPF~W?m5;n9}K%}*3!EkT8imPWrMZQ2X^hOrG-7T8q;yNSPOk% z7tmTd*+UC59e0Pd&!$z+o;qe0l3)h^`x|x`M!KSZbwaNBQba>YB z?uQV+WgmVW*_t2KSh(thHvYu)3pRZf>rED%X>j5#l0pj{`v%aFZ2Cc&h3ige^G`@W zVbj+UYWmrXg$qw;^-M@?7O?;RYU$4fZ614K;uKB*ODwo$ z{|?eKSn+vY?EFaz2j(m!78Gm?bPQJ5Q-c)F#~vkE3w=o0w}O(v3X3NxG9P*hrPzXk zZGn!#ilG@I7X@IT83 y$F3EeqFTZE&z|l?>0pp_G7Bu*0wuMA^NRy_qI7`8+|h#j*Z%=(C%QN=YXAUGR_&_* literal 0 HcmV?d00001 diff --git a/src/tile_mate/stitcher.py b/src/tile_mate/stitcher.py index 3a21607..b324848 100644 --- a/src/tile_mate/stitcher.py +++ b/src/tile_mate/stitcher.py @@ -22,6 +22,7 @@ 'hansen_treecover_2000': 'hansen_landsat_mosaic_2022.geojson.zip', 's1_coherence_2020': 's1_coherence_2020.geojson.zip', 'cop_100_lulc_discrete': 'cop_100m_lulc_discrete_classes.geojson.zip', + 'radd_deforestation_alerts_2022': 'radd_deforestation_alerts_2022.geojson.zip', 'hand': 'asf_hand_2021.geojson.zip', } DATASET_SHORTNAMES = list(GEOJSON_DICT.keys()) diff --git a/tests/test_stitch_api.py b/tests/test_stitch_api.py index aa64560..b261c7e 100644 --- a/tests/test_stitch_api.py +++ b/tests/test_stitch_api.py @@ -65,7 +65,15 @@ def test_cop100_dataset(year: int): @pytest.mark.parametrize( - 'dataset_shortname', ['hansen_gain', 'hansen_treecover_2000', 'hansen_lossyear', 'hand', 'pekel_water_occ_2021'] + 'dataset_shortname', + [ + 'hansen_gain', + 'hansen_treecover_2000', + 'hansen_lossyear', + 'hand', + 'pekel_water_occ_2021', + 'radd_deforestation_alerts_2022', + ], ) def test_no_kwarg_datasets(dataset_shortname): bounds = [-120.45, 34.85, -120.15, 34.95]