diff --git a/django/src/rdwatch/server/settings.py b/django/src/rdwatch/server/settings.py index 191e35739..e1b84cb01 100644 --- a/django/src/rdwatch/server/settings.py +++ b/django/src/rdwatch/server/settings.py @@ -5,6 +5,13 @@ _ENVIRON_PREFIX = 'RDWATCH' +if os.name == 'nt': + OSGEO4W = r"C:\OSGeo4W" + assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W + os.environ['OSGEO4W_ROOT'] = OSGEO4W + os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" + os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] + # With the default "late_binding=False", and "environ_name" is # specified or "environ=False", even Values from non-included diff --git a/django/src/rdwatch/utils/stac_search.py b/django/src/rdwatch/utils/stac_search.py index 2b28b1a1e..124a34938 100644 --- a/django/src/rdwatch/utils/stac_search.py +++ b/django/src/rdwatch/utils/stac_search.py @@ -4,6 +4,7 @@ from os import path from typing import Literal, TypedDict from urllib.request import Request, urlopen +import urllib.parse from django.conf import settings @@ -78,7 +79,7 @@ def stac_search( ) -> Results: # Use SMART program server instead of public server # (https://earth-search.aws.element84.com/v0/search) - url = path.join(settings.SMART_STAC_URL, 'search') + url = urllib.parse.urljoin(settings.SMART_STAC_URL, 'search') params = SearchParams() params['bbox'] = bbox if timebuffer is not None: diff --git a/django/src/rdwatch/utils/worldview/stac_search.py b/django/src/rdwatch/utils/worldview/stac_search.py index a65681874..62418cdef 100644 --- a/django/src/rdwatch/utils/worldview/stac_search.py +++ b/django/src/rdwatch/utils/worldview/stac_search.py @@ -3,6 +3,7 @@ from os import path from typing import Literal, TypedDict from urllib.request import Request, urlopen +import urllib.parse from django.conf import settings @@ -74,7 +75,7 @@ def worldview_search( timebuffer: timedelta | None = None, page: int = 1, ) -> Results: - url = path.join(settings.SMART_STAC_URL, 'search') + url = urllib.parse.urljoin(settings.SMART_STAC_URL, 'search') params = SearchParams() params['bbox'] = bbox if timebuffer is not None: diff --git a/django/src/rdwatch/utils/worldview_processed/stac_search.py b/django/src/rdwatch/utils/worldview_processed/stac_search.py index ac293e6b9..483c3a519 100644 --- a/django/src/rdwatch/utils/worldview_processed/stac_search.py +++ b/django/src/rdwatch/utils/worldview_processed/stac_search.py @@ -3,6 +3,7 @@ from os import path from typing import Literal, TypedDict from urllib.request import Request, urlopen +import urllib.parse from django.conf import settings @@ -67,7 +68,7 @@ def worldview_search( timebuffer: timedelta | None = None, page: int = 1, ) -> Results: - url = path.join(settings.SMART_STAC_URL, 'search') + url = urllib.parse.urljoin(settings.SMART_STAC_URL, 'search') params = SearchParams() params['bbox'] = bbox if timebuffer is not None: