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!
if os.name == 'nt':
OSGEO4W = r"C:\OSGeo4W"
if not os.path.isdir(OSGEO4W):
OSGEO4W += '64'
os.environ['OSGEO4W_ROOT'] = OSGEO4W
os.environ['GDAL_DATA'] = "C:\Program Files\GDAL\gdal-data"
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']
VIRTUAL_ENV_BASE = os.environ['VIRTUAL_ENV']
os.environ['PATH'] = os.path.join(
VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo') + ';' + os.environ['PATH']
os.environ['PROJ_LIB'] = os.path.join(
VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo\data\proj') + ';' + os.environ['PATH']
GEOS_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
r"\Lib\site-packages\osgeo\geos_c.dll")
GDAL_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
r"\Lib\site-packages\osgeo\gdal304.dll")
# To-do: Linux GDAL support here
INSTALLED_APPS = [
'daphne',