diff --git a/opendm/dem/commands.py b/opendm/dem/commands.py index b39c6cf1..7fdf17dc 100755 --- a/opendm/dem/commands.py +++ b/opendm/dem/commands.py @@ -1,4 +1,5 @@ import os +import subprocess import sys import rasterio import numpy @@ -29,8 +30,13 @@ except ModuleNotFoundError: # GDAL <= 3.2 try: from osgeo.utils.gdal_proximity import main as gdal_proximity - except: - pass + except ModuleNotFoundError: + # GDAL <= 3.0 + gdal_proximity_script = shutil.which("gdal_proximity.py") + if gdal_proximity_script is not None: + def gdal_proximity(args): + subprocess.run([gdal_proximity_script] + args[1:], check=True) + def classify(lasFile, scalar, slope, threshold, window): start = datetime.now()