From fe4ca29f73eaffe94d073b3033ac483371cad9ab Mon Sep 17 00:00:00 2001 From: Richard Rigby Date: Wed, 18 Nov 2020 09:28:25 +0000 Subject: [PATCH] Update OSGeo imports Replace deprecated imports, e.g.: import gdal with updated method, e.g. from osgeo import gdal --- bin/LiCSBAS02_ml_prep.py | 2 +- bin/LiCSBAS03op_GACOS.py | 2 +- bin/LiCSBAS_color_geotiff.py | 2 +- bin/LiCSBAS_color_geotiff2tiles.py | 2 +- bin/LiCSBAS_decomposeLOS.py | 2 +- bin/LiCSBAS_disp_img.py | 2 +- bin/LiCSBAS_flt2geotiff.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/LiCSBAS02_ml_prep.py b/bin/LiCSBAS02_ml_prep.py index e0f7aea..98b5157 100755 --- a/bin/LiCSBAS02_ml_prep.py +++ b/bin/LiCSBAS02_ml_prep.py @@ -86,7 +86,7 @@ import sys import time import shutil -import gdal +from osgeo import gdal import glob import numpy as np import subprocess as subp diff --git a/bin/LiCSBAS03op_GACOS.py b/bin/LiCSBAS03op_GACOS.py index 014f0dc..31ee76d 100755 --- a/bin/LiCSBAS03op_GACOS.py +++ b/bin/LiCSBAS03op_GACOS.py @@ -83,7 +83,7 @@ import shutil import glob import numpy as np -import gdal +from osgeo import gdal import multiprocessing as multi import LiCSBAS_io_lib as io_lib import LiCSBAS_tools_lib as tools_lib diff --git a/bin/LiCSBAS_color_geotiff.py b/bin/LiCSBAS_color_geotiff.py index 1218fe5..204c5cd 100755 --- a/bin/LiCSBAS_color_geotiff.py +++ b/bin/LiCSBAS_color_geotiff.py @@ -144,7 +144,7 @@ def __init__(self, msg): #%% Set color range - import gdal + from osgeo import gdal ### Auto if cmin is None: diff --git a/bin/LiCSBAS_color_geotiff2tiles.py b/bin/LiCSBAS_color_geotiff2tiles.py index d539ebf..9edf191 100755 --- a/bin/LiCSBAS_color_geotiff2tiles.py +++ b/bin/LiCSBAS_color_geotiff2tiles.py @@ -53,7 +53,7 @@ import time import shutil import glob -import gdal +from osgeo import gdal import numpy as np import subprocess as subp import multiprocessing as multi diff --git a/bin/LiCSBAS_decomposeLOS.py b/bin/LiCSBAS_decomposeLOS.py index b780aab..ba99664 100755 --- a/bin/LiCSBAS_decomposeLOS.py +++ b/bin/LiCSBAS_decomposeLOS.py @@ -39,7 +39,7 @@ import getopt import os import sys -import gdal, osr +from osgeo import gdal, osr import numpy as np import time from decimal import Decimal diff --git a/bin/LiCSBAS_disp_img.py b/bin/LiCSBAS_disp_img.py index c1ea84a..f4485cd 100755 --- a/bin/LiCSBAS_disp_img.py +++ b/bin/LiCSBAS_disp_img.py @@ -74,7 +74,7 @@ import subprocess as subp import SCM import zipfile -import gdal +from osgeo import gdal import LiCSBAS_tools_lib as tools_lib import LiCSBAS_io_lib as io_lib diff --git a/bin/LiCSBAS_flt2geotiff.py b/bin/LiCSBAS_flt2geotiff.py index 8b9be7c..3aff0a8 100755 --- a/bin/LiCSBAS_flt2geotiff.py +++ b/bin/LiCSBAS_flt2geotiff.py @@ -167,7 +167,7 @@ def main(argv=None): else: print('Use gdal module') try: - import gdal, osr + from osgeo import gdal, osr except: print("\nERROR: gdal must be installed.", file=sys.stderr) return 1