Skip to content

Commit

Permalink
fix: Update text based on PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
wildintellect committed Mar 24, 2023
1 parent 747b3ee commit 342fdda
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions visualization/OverviewResampling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "1104f349",
"id": "37c4c227",
"metadata": {},
"source": [
"# Cloud Optimized Geotiff (COG) Overview Resampling\n",
Expand Down Expand Up @@ -31,7 +31,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "1480211a",
"id": "eedcd26f",
"metadata": {},
"outputs": [
{
Expand All @@ -50,7 +50,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "32d6527c",
"id": "bedb3387",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -69,7 +69,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "1d811905",
"id": "b81e23aa",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -80,7 +80,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "5a6d45bf",
"id": "ecb980db",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -160,7 +160,7 @@
},
{
"cell_type": "markdown",
"id": "fa45496d",
"id": "bec46918",
"metadata": {},
"source": [
"## Generate Overviews\n",
Expand All @@ -171,7 +171,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "20674713",
"id": "d0cdc8bc",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -188,6 +188,8 @@
" dst_path = src_path.replace(\".tif\", f\"_{resample_method}.tif\")\n",
" dst_path = f\"{out_dir}/{os.path.basename(dst_path)}\"\n",
" \n",
" # Using multiple CPUS\n",
" # Using blocksize 512 per recommendations\n",
" config = {\"GDAL_NUM_THREADS\": \"ALL_CPUS\", \"GDAL_TIFF_OVR_BLOCKSIZE\": \"512\"} \n",
" output_profile = cog_profiles.get(\"deflate\")\n",
" output_profile.update({\"blockxsize\": \"512\", \"blockysize\": \"512\"})\n",
Expand All @@ -210,7 +212,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "0b85a912",
"id": "67cb709e",
"metadata": {},
"outputs": [
{
Expand All @@ -222,8 +224,7 @@
}
],
"source": [
"# This is a list of resampling methods that GDAL 3.4+ allows\n",
"#resample_methods = [\"AVERAGE\", \"NEAREST\", \"BILINEAR\", \"CUBIC\", \"CUBICSPLINE\", \"LANCZOS\", \"MODE\", \"RMS\"]\n",
"# Make a list of resampling methods that GDAL 3.4+ allows\n",
"\n",
"from rasterio.enums import Resampling as ResamplingEnums\n",
"\n",
Expand All @@ -236,7 +237,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "157adba7",
"id": "aefb2205",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -264,7 +265,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "602cf874",
"id": "4e88387c",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -293,7 +294,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "a398ae4b",
"id": "72e01802",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -375,7 +376,7 @@
},
{
"cell_type": "markdown",
"id": "f7cc2bf5",
"id": "96a13589",
"metadata": {},
"source": [
"## Compare the Results\n",
Expand All @@ -386,7 +387,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "096ba8e8",
"id": "88d3ca7e",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -430,7 +431,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "1e61f9a3",
"id": "497755d1",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -459,7 +460,7 @@
},
{
"cell_type": "markdown",
"id": "e5f517fb",
"id": "5400bd54",
"metadata": {},
"source": [
"## Interpretation\n",
Expand Down

0 comments on commit 342fdda

Please sign in to comment.