From b302816fb5d619f37a9fc6dc264bc70ac20f8fe3 Mon Sep 17 00:00:00 2001 From: bhyeh Date: Mon, 13 Mar 2023 15:36:16 -0400 Subject: [PATCH] Add gdal workaround for building and translating --- openmapflow/notebooks/create_map.ipynb | 36 +++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/openmapflow/notebooks/create_map.ipynb b/openmapflow/notebooks/create_map.ipynb index 8a1ba13..3704805 100644 --- a/openmapflow/notebooks/create_map.ipynb +++ b/openmapflow/notebooks/create_map.ipynb @@ -26,6 +26,24 @@ "%env USE_AUTH_EPHEM=0" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade gdal \n", + "%%shell\n", + "yes | add-apt-repository ppa:ubuntugis/ppa\n", + "apt-get update\n", + "apt-get install python3-gdal=3.0.4+dfsg-1build3\n", + "apt-get install gdal-bin=3.0.4+dfsg-1build3\n", + "apt-get install libgdal-dev=3.0.4+dfsg-1build3\n", + "C_INCLUDE_PATH=/usr/include/gdal \n", + "CPLUS_INCLUDE_PATH=/usr/include/gdal \n", + "python -m pip install GDAL==3.0.4" + ] + }, { "cell_type": "code", "execution_count": null, @@ -83,7 +101,8 @@ " get_available_models\n", ")\n", "warnings.simplefilter(action='ignore', category=FutureWarning)\n", - "print(PROJECT)" + "print(PROJECT)\n", + "os.environ[\"GCLOUD_PROJECT\"] = GCLOUD_PROJECT_ID" ] }, { @@ -313,6 +332,21 @@ "build_vrt(prefix)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Upgrade gdal to 3.3.2\n", + "%%shell\n", + "apt-get install gdal-bin\n", + "apt-get install libgdal-dev\n", + "C_INCLUDE_PATH=/usr/include/gdal \n", + "CPLUS_INCLUDE_PATH=/usr/include/gdal \n", + "python -m pip install GDAL==3.3.2" + ] + }, { "cell_type": "code", "execution_count": null,