I am trying to batch mosaic a set of rasters using gdal in OSGeo4w shell command line. When I try to use gdal_merge I am getting error as below.
run o-help for a list of available commands
C:\>gdal_merge
'gdal_merge' is not recognized as an internal or external command,
operable program or batch file.
I tried to see the available libraries in OSGeo. I found gdal_merge is not installed while running
o-help
C:\>o-help
-={ OSGeo4W Shell Commands }=-
avcexport avcimport
cct cs2cs
curl derb
dllupdate fax2ps
fax2tiff fftw-wisdom
gdaladdo gdalbuildvrt
gdaldem gdalenhance
gdalinfo gdallocationinfo
gdalmanage gdalserver
gdalsrsinfo gdaltindex
gdaltransform gdalwarp
gdal_contour gdal_grid
gdal_rasterize gdal_translate
genbrk genccode
gencfu gencmn
gencnval gendict
gennorm2 genrb
gensprep geod
geotifcp gie
gif2h5 gnmanalyse
gnmmanage gpsbabel`
But I am seeing gdal_merge in other system. Also, I am able to find the gdal_merge.py in the below directory.
C:\OSGeo4W64\apps\Python37\Scripts
Why is it not showing in my system, and how do I fix this issue?
python "%OSGEO4W_ROOT%\apps\Python37\Scripts\gdal_merge.py" %*
. BTW for most use cases gdalbuildvrt is better than gdal_merge.py.@echo off call "%OSGEO4W_ROOT%\bin\o4w_env.bat" python "%OSGEO4W_ROOT%\bin\gdal_merge.py" %*