mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
Merge pull request #63367 from qgis/backport-63240-to-release-3_44
[Backport release-3_44] processing: Call gdal_merge instead of gdal_merge.py
This commit is contained in:
commit
086dd9bc36
@ -266,6 +266,19 @@ class merge(GdalAlgorithm):
|
||||
arguments.append(list_file)
|
||||
|
||||
return [
|
||||
self.commandName() + (".bat" if isWindows() else ".py"),
|
||||
self.commandName() + merge.command_ext(),
|
||||
GdalUtils.escapeAndJoin(arguments),
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def command_ext() -> str:
|
||||
"""
|
||||
Returns the gdal_merge command extension
|
||||
"""
|
||||
if isWindows():
|
||||
return ".bat"
|
||||
|
||||
if GdalUtils.version() < 3090000:
|
||||
return ".py"
|
||||
|
||||
return ""
|
||||
|
@ -4556,6 +4556,8 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
alg = merge()
|
||||
alg.initAlgorithm()
|
||||
|
||||
merge_command = alg.commandName() + alg.command_ext()
|
||||
|
||||
with tempfile.TemporaryDirectory() as outdir:
|
||||
# this algorithm creates temporary text file with input layers
|
||||
# so we strip its path, leaving only filename
|
||||
@ -4567,7 +4569,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4586,7 +4588,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-separate -ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4610,7 +4612,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-ot Float32 -of GTiff -tap -ps 0.1 0.1 "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4634,7 +4636,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-a_nodata -9999.0 -ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
|
Loading…
x
Reference in New Issue
Block a user