0

I'm using gdalwarp from gisinternals msvc compiled binaries.

There should be a script which specifies the path variables. It was given inside the binaries. I modified in a small way such that it works from outside the directory and some other paths are also specified.

@echo off

set SDK_ROOT=%~dp0gdal\
set SDK_ROOT=%SDK_ROOT:\\=\%
set GNUPLOT_ROOT=%~dp0gnuplot\
set GSL_ROOT=%~dp0gsl2\

goto setenv
set PYTHON_ROOT=%~dp0python1\


@echo %SDK_ROOT%
@echo %GNUPLOT_ROOT%


if "%1" == "setenv" goto setenv

%comspec% /k "%SDK_ROOT%SDKShell.bat" setenv %1
goto exit

:setenv
@echo Setting environment for using the GDAL and MapServer tools.

if "%2"=="hideoci" goto hideoci

set ocipath=0
set _path="%PATH:;=" "%"
for %%p in (%_path%) do if not "%%~p"=="" if exist %%~p\oci.dll set ocipath=1

if "%ocipath%"=="0" goto hideoci
@echo WARNING: If you encounter problems with missing oci libraries then type:
@echo   SDKShell hideoci
goto setenv2

:hideoci
@echo Hiding the OCI plugin library.
if not exist "%SDK_ROOT%bin\gdal\plugins-optional" mkdir "%SDK_ROOT%bin\gdal\plugins-optional"
if exist "%SDK_ROOT%bin\gdal\plugins\ogr_OCI.dll" move "%SDK_ROOT%bin\gdal\plugins\ogr_OCI.dll" "%SDK_ROOT%bin\gdal\plugins-optional\ogr_OCI.dll"
if exist "%SDK_ROOT%bin\gdal\plugins\gdal_GEOR.dll" move "%SDK_ROOT%bin\gdal\plugins\gdal_GEOR.dll" "%SDK_ROOT%bin\gdal\plugins-optional\gdal_GEOR.dll"


:setenv2
@echo At set env 2
SET "PATH=%SDK_ROOT%bin;%SDK_ROOT%bin\gdal\python\osgeo;%SDK_ROOT%bin\gdal\python\;%SDK_ROOT%bin\proj6\apps;%SDK_ROOT%bin\gdal\apps;%SDK_ROOT%bin\ms\apps;%SDK_ROOT%bin\gdal\csharp;%SDK_ROOT%bin\ms\csharp;%SDK_ROOT%bin\curl;%GNUPLOT_ROOT%bin\;%GSL_ROOT%bin\;%SDK_ROOT%bin\gdal\plugins;%PATH%"
SET "GDAL_DATA=%SDK_ROOT%bin\gdal-data"
SET "GDAL_DRIVER_PATH=%SDK_ROOT%bin\gdal\plugins"
SET "PYTHONPATH=%SDK_ROOT%bin\gdal\python\osgeo;%SDK_ROOT%bin\gdal\python;%SDK_ROOT%bin\ms\python;%SDK_ROOT%bin\proj6\apps;%SDK_ROOT%bin\gdal\apps;%SDK_ROOT%bin\curl;%SDK_ROOT%bin;%SDK_ROOT%bin\ms\apps;%SDK_ROOT%bin\proj6\share"
SET "PROJ_LIB=%SDK_ROOT%bin\proj6\share;%SDK_ROOT%bin\proj6\apps"
SET "LD_LIB_PATH=%SDK_ROOT%gsl2\lib"



gdal_translate -gcp 0.0000 0.0000 80.207539 16.173769 -gcp 2683 0.0000 80.263502 16.173386 -gcp 0.0000 7906 80.206398 16.028650 -gcp 2683 7906 80.262312 16.028034 -gcp 1341 3953 80.234943 16.101114 HH_Amp.bin HH_Amp_geo.bin

pause

I specified the gdal_translate at the end of the script.

Now, I have specified the gdal_driver path in the script. To be sure, I also specified it in the path variable. But, where is this error coming from?

0

It's not a path problem, but you'd have to specify output format to the commands while giving input as any other image than tiff format.

gdal_translate -of ENVI -gcp 0.0000 0.0000 80.207539 16.173769 -gcp 2683 0.0000 80.263502 16.173386 -gcp 0.0000 7906 80.206398 16.028650 -gcp 2683 7906 80.262312 16.028034 -gcp 1341 3953 80.234943 16.101114 HH_Amp.bin HH_Amp_geo.bin

Solved the problem by adding the flag -of ENVI to the command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.