From efdd1751489dd16212a1df5a9461bb3f8415dd2a Mon Sep 17 00:00:00 2001 From: Dugal Harris Date: Sun, 8 Oct 2023 12:47:57 +0200 Subject: [PATCH] set env vars to auto-download proj transformation grids --- simple_ortho/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/simple_ortho/__init__.py b/simple_ortho/__init__.py index 196f279..9f9db73 100644 --- a/simple_ortho/__init__.py +++ b/simple_ortho/__init__.py @@ -14,13 +14,15 @@ limitations under the License. """ -import logging import os import pathlib -import sys +# enable on-demand download of proj transformation grids +os.environ.update(PROJ_NETWORK='ON', PROJ_ONLY_BEST_DEFAULT='ON', ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS='NO') + +# path to package root if '__file__' in globals(): root_path = pathlib.Path(__file__).absolute().parents[1] else: - root_path = pathlib.Path(os.getcwd()) + root_path = pathlib.Path.cwd().absolute()