Simplified GDAL import

This commit is contained in:
Keannu Bernasol 2023-07-28 19:38:33 +08:00
parent 4697bee70f
commit 1beaf909f0

View file

@ -67,19 +67,13 @@ else:
# Will need to install OSGeo4W for this! # Will need to install OSGeo4W for this!
if os.name == 'nt': if os.name == 'nt':
OSGEO4W = r"C:\OSGeo4W" VIRTUAL_ENV_BASE = os.environ['VIRTUAL_ENV']
if not os.path.isdir(OSGEO4W): os.environ['PATH'] = os.path.join(
OSGEO4W += '64' VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo') + ';' + os.environ['PATH']
os.environ['OSGEO4W_ROOT'] = OSGEO4W os.environ['PROJ_LIB'] = os.path.join(
os.environ['GDAL_DATA'] = "C:\Program Files\GDAL\gdal-data" VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo\data\proj') + ';' + os.environ['PATH']
os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj"
GDAL_LIBRARY_PATH = r'C:\OSGeo4W64\bin\gdal204'
os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH']
GEOS_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') + # To-do: Linux GDAL support here
r"\Lib\site-packages\osgeo\geos_c.dll")
GDAL_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
r"\Lib\site-packages\osgeo\gdal304.dll")
INSTALLED_APPS = [ INSTALLED_APPS = [
'daphne', 'daphne',