kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #1855 from sanmit99/patch-1.1
Fallback gdal_proximity command to native pathpull/1856/head
commit
465b66a9ae
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import rasterio
|
import rasterio
|
||||||
import numpy
|
import numpy
|
||||||
|
@ -29,8 +30,13 @@ except ModuleNotFoundError:
|
||||||
# GDAL <= 3.2
|
# GDAL <= 3.2
|
||||||
try:
|
try:
|
||||||
from osgeo.utils.gdal_proximity import main as gdal_proximity
|
from osgeo.utils.gdal_proximity import main as gdal_proximity
|
||||||
except:
|
except ModuleNotFoundError:
|
||||||
pass
|
# 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):
|
def classify(lasFile, scalar, slope, threshold, window):
|
||||||
start = datetime.now()
|
start = datetime.now()
|
||||||
|
|
Ładowanie…
Reference in New Issue