diff --git a/notebooks/tutorials/zonal-statistics-validation.ipynb b/notebooks/tutorials/zonal-statistics-validation.ipynb index e6c75a33..561a0406 100644 --- a/notebooks/tutorials/zonal-statistics-validation.ipynb +++ b/notebooks/tutorials/zonal-statistics-validation.ipynb @@ -296,7 +296,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 15/15 [00:07<00:00, 1.91it/s]\n" + "100%|██████████| 15/15 [00:07<00:00, 1.90it/s]\n" ] } ], @@ -405,7 +405,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Compute zonal averages using TiTiler API" + "## Compute zonal averages using TiTiler API\n", + "\n", + "We make use of the option on TiTiler to reproject the data subset to an equal-area projection ([Equal Area Cylindrical](https://proj.org/en/9.3/operations/projections/cea.html)) before computing the statistics." ] }, { @@ -413,6 +415,15 @@ "execution_count": 13, "metadata": {}, "outputs": [], + "source": [ + "WORKING_PROJECTION = \"+proj=cea\"" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], "source": [ "def generate_stats(item, geojson, asset_name, params=None):\n", " params = params or {}\n", @@ -434,7 +445,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": { "tags": [] }, @@ -443,7 +454,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 15/15 [00:06<00:00, 2.16it/s]\n" + "100%|██████████| 15/15 [00:15<00:00, 1.04s/it]\n" ] } ], @@ -454,7 +465,7 @@ "for item in tqdm.tqdm(items):\n", " # generate stats with and without reprojection\n", " stats_noproj = generate_stats(item, AOI, ASSET_NAME)\n", - " stats_proj = generate_stats(item, AOI, ASSET_NAME, params={\"dst_crs\": \"+proj=cea\"})\n", + " stats_proj = generate_stats(item, AOI, ASSET_NAME, params={\"dst_crs\": WORKING_PROJECTION})\n", "\n", " timeseries_titiler_noproj.append(stats_noproj)\n", " timeseries_titiler_proj.append(stats_proj)" @@ -462,7 +473,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": { "tags": [] }, @@ -478,7 +489,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": { "tags": [] }, @@ -497,7 +508,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": { "tags": [] }, @@ -510,7 +521,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": { "tags": [] }, @@ -540,7 +551,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": { "tags": [] }, @@ -575,7 +586,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": { "tags": [] }, @@ -591,7 +602,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "metadata": { "tags": [] },