set PATH=C:\programs\GMT5\bin;%PATH%
set GSBIN=C:\PROGRA~2\gs\gs9.04/bin
set COORDSCUT=-6.5/2.4/48/52
rem width = xmaxsvg / 150.0 * 2.54
set PAPERX=16.1713333333333
rem height = ymaxsvg / 150.0 * 2.54
set PAPERY=11.2606666666667
set PROJNCOORDS=-JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT%
grdcut.exe topo30.grd -R%COORDSCUT% -Gh_cor_cut.grd
if not errorlevel 0 goto End
grdgradient h_cor_cut.grd -Ne0.1 -A315 -M -Ghi.grd
if not errorlevel 0 goto End
grdcut.exe ETOPO1_Bed_g_gmt4.grd -R%COORDSCUT% -Gh_cut2.grd
if not errorlevel 0 goto End
grdsample h_cut2.grd -I30c -nb -Gh_cor_cut2.grd
if not errorlevel 0 goto End
grdgradient h_cor_cut2.grd -Ne0.025 -A315 -M -Ghi2.grd
if not errorlevel 0 goto End
grdimage h_cor_cut2.grd -Ihi2.grd -Cwiki-water-verlauf2.cpt -P -R%COORDSCUT% -JX%PAPERX%cd/%PAPERY%cd --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -K > map.eps
if not errorlevel 0 goto End
pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -Gc -P -Dh --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps
if not errorlevel 0 goto End
grdimage h_cor_cut.grd -Ihi.grd -Cmount.cpt -P -R%COORDSCUT% -JX%PAPERX%cd/%PAPERY%cd --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps
if not errorlevel 0 goto End
pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -Q -P -Dh --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O -K >> map.eps
if not errorlevel 0 goto End
pscoast.exe -JX%PAPERX%cd/%PAPERY%cd -R%COORDSCUT% -N1/0.75p,#646464 -Ia/0.3p,#0978AB -W0.333,#0978AB -P -Df --PAPER_MEDIA=Custom_%PAPERX%cx%PAPERY%c -X0 -Y0 -O >> map.eps
if not errorlevel 0 goto End
%GSBIN%\gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -dEPSCrop -r150 -sOutputFile=Oblast_relief.png map.eps
if not errorlevel 0 goto End
del hi.grd
del hi2.grd
:End