@echo off REM This batch file generates a series of QGIS-projects, based on a template. For each project a snapshot is generated. REM The program fart.exe is supposed to be in the same folder. Check if the location of qgis.exe is correct for your system. REM (Sake Wagenaar, 28 July 2012 / modified 8 August 2012) SETLOCAL REM ============================================================================== REM CUSTOM DATA: REM ============================================================================== SET TEMPLATE=Template1.qgs SET SUFFIX=_test SET FIELDS=cr94421 cr94271 cr94301 cr94272 cr94281 cr94282 cr92513 cr91080 cr95672 cr94312 SET SUBDIR=.\snapshots REM ============================================================================== REM ============================================================================== REM GENERAL SETTINGS FOR QGIS (from qgis.bat): REM ============================================================================== SET OSGEO4W_ROOT=C:\OSGeo4W REM Alternative location (for instance QGIS 1.7.4): REM OSGEO4W_ROOT=C:\Program Files\Quantum GIS Wroclaw call "%OSGEO4W_ROOT%\bin\o4w_env.bat" call "%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\etc\env.bat" @echo off path %PATH%;"%OSGEO4W_ROOT%\apps\qgis\bin";"%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\lib" REM ============================================================================== REM ============================================================================== REM EXECUTION REM ============================================================================== IF NOT EXIST %SUBDIR% md %SUBDIR% for %%f in (%FIELDS%) do ( echo -------------------------------- echo PROJECT: %%f%SUFFIX%.qgs echo -------------------------------- copy %TEMPLATE% %%f%SUFFIX%.qgs fart -c %%f%SUFFIX%.qgs @REPLACEFIELD@ %%f echo SNAPSHOT: %%f%SUFFIX%.png start "" /wait "%OSGEO4W_ROOT%\apps\qgis\bin\qgis.exe" --project %%f%SUFFIX%.qgs --snapshot %SUBDIR%\%%f%SUFFIX%.png --width 675 --height 770 del %SUBDIR%\%%f%SUFFIX%.pngw ) ENDLOCAL