Skip to content

Commit

Permalink
Fixed import errors caused by newer versions of QGIS
Browse files Browse the repository at this point in the history
  • Loading branch information
HUGIN-MC committed Aug 17, 2022
1 parent 41aa55e commit 7b93309
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hugin_qgis_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import os

from osgeo import gdal
from gdalconst import *
import osr
from osgeo import gdalconst
from osgeo import osr

import tempfile

Expand All @@ -57,7 +57,7 @@ def loadConfig(path):
return config

def loadRaster(path):
ds = gdal.Open(path, GA_ReadOnly)
ds = gdal.Open(path, gdal.GA_ReadOnly)
if ds is None:
raise QgsProcessingException("Cannot open raster '{}'.".format(path))
return ds
Expand Down Expand Up @@ -234,7 +234,7 @@ def alignRaster(refDS, inputDS, outputFile):
outputDS.GetRasterBand(i+1).SetNoDataValue(NoDataValue)
outputDS.SetGeoTransform(referenceTrans)
outputDS.SetProjection(referenceProj)
res = gdal.ReprojectImage(inputDS, outputDS, inputProj, referenceProj, GRA_Bilinear)
res = gdal.ReprojectImage(inputDS, outputDS, inputProj, referenceProj, gdal.GRA_Bilinear)
if res != 0:
raise QgsProcessingException("GDAL ReprojectImage failed with {} on '{}'".format(res, outputFile))
# flush changes to disk
Expand Down

0 comments on commit 7b93309

Please sign in to comment.