diff --git a/sample/geslotenheid/brondata.py b/sample/geslotenheid/brondata.py
new file mode 100644
index 0000000000000000000000000000000000000000..49a2e6945ffaab5dce4800c6be5d5578553355b5
--- /dev/null
+++ b/sample/geslotenheid/brondata.py
@@ -0,0 +1,55 @@
+
+"""
+Overzicht van brondata van waaruit de OPGAANDE ELEMENTEN KAART wordt opgebouwd per jaargang.
+De Opgaande Elementenkaart wordt gebruikt als input van Viewscape.
+
+De numerieke dictionary keys verwijzen naar de PEILDATA van de Landschapsmonitor:
+
+01-01-2016
+01-01-2018
+01-01-2019
+01-01-2021
+
+Hans Roelofsen, WEnR, september 2021
+
+"""
+
+bd_dict = {
+
+    2016: {
+        'top10': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\nov2015\TOP10NL.gdb',
+                    'vlak': 'TERREIN_VLAK',
+                    'lijn':'INRICHTINGSELEMENT_LIJNVORMIG'},
+        'bb': {     'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\Bebouwing\geodata\leveringPPK_20210915\Monitoringsbron.gdb',
+                    'vlak': None},
+        'Groen': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\leveringPPK20210915\MonitoringsbronOpgaandGroen2016_dd20210831.gdb',
+                    'vlak': 'Vlakken',
+                    'lijn': 'Lijnen'}},
+    2018:{
+        'top10': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\nov2017\TOP10NL_FGDB_R11_2017openbaar01012018\TOP10NL_openbaar01012018.gdb',
+                    'vlak': 'TERREIN_VLAK',
+                    'lijn':'INRICHTINGSELEMENT_LIJNVORMIG'},
+        'bb': {     'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\Bebouwing\geodata\leveringPPK_20210915\Monitoringsbron.gdb',
+                    'vlak': 'Monitoringsbron_2018'},
+        'Groen': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\leveringPPK20210915\MonitoringsbronOpgaandGroen2018_dd20210831.gdb',
+                    'vlak': 'Vlakken',
+                    'lijn': 'Lijnen'}},
+    2019: {
+        'top10': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\nov2018\TOP10NL_FGDB_R11_2018openbaar01012019\TOP10NL2019.gdb',
+                    'vlak': 'TERREIN_VLAK',
+                    'lijn':'INRICHTINGSELEMENT_LIJNVORMIG'},
+        'bb': {     'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\Bebouwing\geodata\leveringPPK_20210915\Monitoringsbron.gdb',
+                    'vlak': 'Monitoringsbron_2019'},
+        'Groen': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\leveringPPK20210915\MonitoringsbronOpgaandGroen2019_dd20210720.gdb',
+                    'vlak': 'Vlakken',
+                    'lijn': 'Lijnen'}},
+    2021: {
+        'top10': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\sept2020\FGDB\TOP10NL.gdb',
+                    'vlak': 'TERREIN_VLAK',
+                    'lijn':'INRICHTINGSELEMENT_LIJNVORMIG'},
+        'bb': {     'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\Bebouwing\geodata\leveringPPK_20210915\Monitoringsbron.gdb',
+                    'vlak': 'Monitoringsbron_2021'},
+        'Groen': {  'gdb': r'w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\leveringPPK20210915\MonitoringsbronOpgaandGroen2021_dd20210720.gdb',
+                    'vlak': 'Vlakken',
+                    'lijn': 'Lijnen'}}}
+
diff --git a/sample/geslotenheid/create_batch_script.py b/sample/geslotenheid/create_batch_script.py
new file mode 100644
index 0000000000000000000000000000000000000000..7b089d8fb1e8bc89df2e8597c366c928cffa44f7
--- /dev/null
+++ b/sample/geslotenheid/create_batch_script.py
@@ -0,0 +1,51 @@
+"""
+Genereer een BATCH script, waarmee een OPGAANDE ELEMENTEN kaart wordt gemaakt voor een JAARGANG
+Hans Roelofsen, WEnR, september 2021
+"""
+
+import sys
+try:
+    from sample.geslotenheid.brondata import bd_dict as bd
+except ModuleNotFoundError:
+    from brondata import bd_dict as bd
+
+def create_batch_script(year):
+    """
+    verzamel brondata behorende bij het JAAR en plug deze brondata in het dummy batch script
+    :param year: jaargang
+    :return: .\prep_opgaande_elementen_<year>.bat
+    """
+
+    try:
+        replace_dict = {
+            'REPLACE_YEAR': str(year),
+            'REPLACE_OG_GDB': bd[year]['Groen']['gdb'],
+            'REPLACE_BB_GDB': bd[year]['bb']['gdb'],
+            'REPLACE_BB_FC': bd[year]['bb']['vlak'],
+            'REPLACE_T10_GDB': bd[year]['top10']['gdb'],
+            'REPLACE_SCRATCH': r'c:\apps\temp_geodata\openheid21\scratch\1_1_{}'.format(year)}
+    except KeyError as e:
+        print('invalid year: {}'.format(e))
+        sys.exit(1)
+
+    out_file = 'prep_opgaande_elementen_{}.bat'.format(year)
+
+    with open('prep_opgaande_elementen_dummy.bat', 'r') as template:
+        template_data = template.read()
+
+    for k, v in replace_dict.items():
+        template_data = template_data.replace(k, v)
+
+    with open('./{}'.format(out_file), 'w') as dest:
+        dest.write(template_data)
+
+
+if __name__ == '__main__':
+    import argparse
+    parser = argparse.ArgumentParser()
+    parser.add_argument('year', type=int, help='for which year? peildatum 01 01 YEAR')
+    args = parser.parse_args()
+
+    create_batch_script(args.year)
+
+
diff --git a/sample/geslotenheid/prep_opgaande_elementen.bat b/sample/geslotenheid/prep_opgaande_elementen.bat
index 646ace0d27ad6a672ad504d377ffd386e1ebbf31..f369303fbe19b45fe51cbad5f3723fd5cf1c0b18 100644
--- a/sample/geslotenheid/prep_opgaande_elementen.bat
+++ b/sample/geslotenheid/prep_opgaande_elementen.bat
@@ -2,42 +2,64 @@ REM Batch script for creating Opgaande Elementen kaart as input for Viewscape. W
 REM Project: Landschapsmonitor 
 REM Door: Hans Roelofsen, WEnR, team B&B
 
+setlocal enabledelayedexpansion
 
 call c:\Users\roelo008\Miniconda3\Scripts\activate.bat
 call conda activate mrt
 
-REM OUTPUTS
+:: Data Schema
+:: Peil Datum 	Top10		Bebouwing		OpgaandGroen
+:: 01-01-2016   november 2015	<VOLGT>         	2016
+:: 01-01-2018   november 2017	Monitoringsbron_2018    2018
+:: 01-01-2019 	november 2018	Monitoringsbron_2019	2019
+:: 01-01-2021	september 2020	Monitoringsbron_2021	2021 
+
 SET jaar=2018
-SET out1=
-
-REM DIRECTORIES
-SET OGDir=w:/PROJECTS/Landschapsmonitor/cIndicatoren/OpgaandGroen/a_Geodata
-SET BBDir=w:/PROJECTS/Landschapsmonitor/cIndicatoren/Bebouwing/Geodata_Kadaster_22juni_2021
-if %jaar%==2018 (SET T10Dir=W:/PROJECTS/GeoDeskData/TOP10NL/TOP10NL_november2017/TOP10NL.gdb) else (SET T10Dir=W:/PROJECTS/GeoDeskData/TOP10NL/TOP10NL_2019_Sep/TOP10NL_uncompr.gdb)
-SET scratch_dir=c:/apps/temp_geodata/openheid21/Data/b_intern/scratch
-SET OutDir=w:/PROJECTS/Landschapsmonitor/cIndicatoren/Openheid/c_viewscape_input/opgaand_elementen/b_methode_HR_2021/v%jaar%/c_final
+SET peildatum=01-01-%jaar%
+
+REM Opgaand Groen Directories
+SET OG2016Dir=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2016_dd20210831.gdb
+SET OG2018Dir=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2018_dd20210831.gdb
+SET OG2019Dir=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2019_dd20210720.gdb
+SET OG2021Dir=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2021_dd20210720.gdb
+
+REM Bebouwingsdirectories
+SET BBDir=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2021_dd20210720.gdb
+SET BBfc2018=Monitoringsbron_2018
+SET BBfc2019=Monitoringsbron_2019
+SET BBfc2021=Monitoringsbron_2021
+
+REM Top10 Directories
+SET T10_2016=w:\PROJECTS\Landschapsmonitor\cIndicatoren\OpgaandGroen\a_Geodata\levering PPK20210915\MonitoringsbronOpgaandGroen2021_dd20210720.gdb
+SET T10_2018=w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\nov2017\TOP10NL_FGDB_R11-2017(openbaar01012018)\TOP10NL_(openbaar01012018).gdb
+SET T10_2019=w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\nov2018\TOP10NL_FGDB_R11-2018(openbaar01012019)\TOP10NL2019.gdb
+SET T10_2021=w:\PROJECTS\Landschapsmonitor\cIndicatoren\zOverigeGeodata\Top10NL_Kadaster\sept2020\FGDB\TOP10NL.gdb
+
+SET scratch_dir=c:/apps/temp_geodata/openheid21/scratch/1_1_%jaar%
+SET OutDir=c:/apps/temp_geodata/openheid21/output/v1_1_%jaar%
 SET gdal_dir=C:/Program Files/QGIS 3.10/apps/Python37/Scripts
 
-REM minimum aantal 2.5m cellen in een 25m cel voor kwalificatie als gesloten
+
+REM minimum aantal 2.5m cellen in een 25m cel voor kwalificatie als gesloten. Max is natuurlijk 100
 SET drempelwaarde_vlakken=6
 SET drempelwaarde_lijnen=2
 SET drempelwaarde_combi=6
 
 SET timestamp=%date:~0, 4%%date:~5,2%%date:~8,2%t%time:~0,2%%time:~3,2%%time:~6,2%
 
-REM 1 RASTERIZE Opgaand Groen
-gdal_rasterize -at -l Vlakken -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %OGDir%/MonitoringsbronOpgaandGroen_0101%jaar%.gdb %scratch_dir%/%og_vlak_out%
-gdal_rasterize -at -l Lijnen -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %OGDir%/MonitoringsbronOpgaandGroen_0101%jaar%.gdb %scratch_dir%/%og_lijn_out%
+REM RASTERIZE Opgaand Groen
+gdal_rasterize -at -l Vlakken -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 !OG%jaar%Dir! %scratch_dir%/%og_vlak_out%
+gdal_rasterize -at -l Lijnen -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 !OG%jaar%Dir!%scratch_dir%/%og_lijn_out%
 
 REM RASTERIZE Bebouwing
-gdal_rasterize -at -l Monitoringsbron%jaar% -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %BBDir%/MonitoringsbronBebouwing_2018-2019_dd20120325.gdb %scratch_dir%/%BBOut%
+gdal_rasterize -at -l !BBfc%jaar%! -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %BBDir% %scratch_dir%/%BBOut%
  
 REM RASTERIZE Top10 Vlak
-ogr2ogr -sql "SELECT * FROM TERREIN_VLAK WHERE TYPELANDGEBRUIK IN ('fruitkwekerij', 'boomgaard', 'boomkwekerij', 'dodenakker met bos')" -select TYPELANDGEBRUIK %scratch_dir%/%T10VOut%.shp %T10Dir% TERREIN_VLAK
+ogr2ogr -sql "SELECT * FROM TERREIN_VLAK WHERE TYPELANDGEBRUIK IN ('fruitkwekerij', 'boomgaard', 'boomkwekerij', 'dodenakker met bos')" -select TYPELANDGEBRUIK %scratch_dir%/%T10VOut%.shp !T10_%year%! TERREIN_VLAK
 gdal_rasterize -at -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %scratch_dir%/t10_2018_vlak_sel.shp %scratch_dir%/%T10VOut%.tif
 
 REM RASTERIZE Top10 Lijn
-ogr2ogr -sql "SELECT * FROM INRICHTINGSELEMENT_LIJN WHERE TYPEINRICHTINGSELEMENT IN ('muur', 'geluidswering')" -select TYPEINRICHTINGSELEMENT %scratch_dir%/%T10LOut%.shp %T10Dir% INRICHTINGSELEMENT_LIJN
+ogr2ogr -sql "SELECT * FROM INRICHTINGSELEMENT_LIJN WHERE TYPEINRICHTINGSELEMENT IN ('muur', 'geluidswering')" -select TYPEINRICHTINGSELEMENT %scratch_dir%/%T10LOut%.shp !T10_%year%! INRICHTINGSELEMENT_LIJN
 gdal_rasterize -at -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %scratch_dir%/%T10LOut%.shp %scratch_dir%/%T10LOut%.tif
 
 REM COMBINE Add vlakvormige bronrasters together 
@@ -51,7 +73,7 @@ gdalwarp -co COMPRESS=LZW -tr 25 25 -te 10000 300000 280000 625000 -r sum %scrat
 gdalwarp -co COMPRESS=LZW -tr 25 25 -te 10000 300000 280000 625000 -r sum %scratch_dir%/lijnen_%jaar%_combi.tif %scratch_dir%/lijnen_combi_%jaar%_25m.tif 
 
 REM Combineer lijnen en vlakken om gebieden op te sporen waar lijnen of vlakken individueel niet voldoende zijn om de drempelwaarde(s) te overschrijden
-python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/vlakken_combi_%jaar%_25m.tif -B %scratch_dir%/lijnen_combi_%jaar%_25m.tif --outfile=%scratch_dir%/lijn_vlak_combi_%jaar%_25m.tif --calc="A+b"
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/vlakken_combi_%jaar%_25m.tif -B %scratch_dir%/lijnen_combi_%jaar%_25m.tif --outfile=%scratch_dir%/lijn_vlak_combi_%jaar%_25m.tif --calc="A+B"
 
 REM Apply treshold
 python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/vlakken_combi_%jaar%_25m.tif --outfile=%scratch_dir%/vlakken_%jaar%_gte_th.tif --calc="numpy.where(A >= %drempelwaarde_vlakken%, 1, 0)"
diff --git a/sample/geslotenheid/prep_opgaande_elementen_dummy.bat b/sample/geslotenheid/prep_opgaande_elementen_dummy.bat
new file mode 100644
index 0000000000000000000000000000000000000000..842c98da1294886fa5fb00ea9bd35b00de7166b6
--- /dev/null
+++ b/sample/geslotenheid/prep_opgaande_elementen_dummy.bat
@@ -0,0 +1,89 @@
+REM Batch script for creating Opgaande Elementen kaart as input for Viewscape. Werkt momenteel enkel voor jaargangen 2018 en 2019.
+REM Project: Landschapsmonitor 
+REM Door: Hans Roelofsen, WEnR, team B&B
+
+setlocal enabledelayedexpansion
+
+:: Data Schema
+:: Peil Datum 	Top10		Bebouwing		OpgaandGroen
+:: 01-01-2016   november 2015	<VOLGT>         	2016
+:: 01-01-2018   november 2017	Monitoringsbron_2018    2018
+:: 01-01-2019 	november 2018	Monitoringsbron_2019	2019
+:: 01-01-2021	september 2020	Monitoringsbron_2021	2021 
+
+SET jaar=REPLACE_YEAR
+SET peildatum=01-01-2018
+
+REM Opgaand Groen Directories
+SET OGDir="REPLACE_OG_GDB"
+
+REM Bebouwingsdirectories
+SET BBDir="REPLACE_BB_GDB"
+SET BBfc=REPLACE_BB_FC
+
+REM Top10 Directorie
+SET T10Dir=REPLACE_T10_GDB
+
+SET scratch_dir=c:\apps\temp_geodata\openheid21\scratch\1_1_REPLACE_YEAR
+SET out_dir=c:\apps\temp_geodata\openheid21\output
+SET gdal_dir=c:\Program Files\QGIS 3.10\apps\Python37\Scripts
+
+REM minimum aantal 2.5m cellen in een 25m cel voor kwalificatie als gesloten. Max is natuurlijk 100
+SET drempelwaarde_vlakken=6
+SET drempelwaarde_lijnen=2
+SET drempelwaarde_combi=6
+
+REM Selectie van categorieen uit Bebouwingsindicator, Top10 Vlak en Top10 lijn
+SET BB_sel='bunker', 'kas, warenhuis', 'BAG-pand', 'open loods', 'opslagtank', 'windmolen', 'windmolen: korenmolen', 'windmolen: watermolen'
+SET T10Vlak_sel='fruitkwekerij', 'boomgaard', 'boomkwekerij', 'dodenakker met bos'
+SET T10Lijn_sel='muur', 'geluidswering'
+
+SET timestamp=%date:~0, 4%%date:~5,2%%date:~8,2%t%time:~0,2%%time:~3,2%%time:~6,2%
+
+call c:\Users\roelo008\Miniconda3\Scripts\activate.bat
+call conda activate mrt
+
+REM RASTERIZE Opgaand Groen
+gdal_rasterize -at -l Vlakken -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %OGDir% %scratch_dir%/opgaandgroen_vlak.tif
+gdal_rasterize -at -l Lijnen -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %OGDir% %scratch_dir%/opgaandgroen_lijn.tif
+
+REM RASTERIZE Bebouwing
+gdal_rasterize -at -l %BBfc% -where "OBJECT_TYPE IN (%BB_sel%)" -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -co COMPRESS=LZW -burn 1 %BBDir% %scratch_dir%/bebouwing_sel.tif
+ 
+REM RASTERIZE Top10 Vlak
+gdal_rasterize -where "TYPELANDGEBRUIK IN (%T10Vlak_sel%)" -at -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -l TERREIN_VLAK -co COMPRESS=LZW -burn 1 %T10Dir% %scratch_dir%/t10vlak_sel.tif  
+
+REM RASTERIZE Top10 Lijn
+gdal_rasterize -where "TYPEINRICHTINGSELEMENT IN (%T10Lijn_sel%)" -at -of GTiff -te 10000 300000 280000 625000 -tr 2.5 2.5 -ts 108000 130000 -ot Byte -a_srs epsg:28992 -l INRICHTINGSELEMENT_LIJN -co COMPRESS=LZW -burn 1 %T10Dir% %scratch_dir%/t10lijn_sel.tif
+
+REM COMBINE Add vlakvormige bronrasters together 
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/opgaandgroen_vlak.tif -B %scratch_dir%/bebouwing_sel.tif -C %scratch_dir%/t10vlak_sel.tif --outfile=%scratch_dir%/vlakken_combi.tif --calc="numpy.where((A+B+C)>=1, 1, 0)"
+
+REM COMBINE Add lijnvormige bronrasters together 
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/opgaandgroen_lijn.tif -B %scratch_dir%/t10lijn_sel.tif --outfile=%scratch_dir%/lijnen_combi.tif --calc="numpy.where((A+B)>=1, 1, 0)"
+
+REM AGGREGATE lijnen and vlakken to 25m with SUM aggregation method
+gdalwarp -co COMPRESS=LZW -tr 25 25 -te 10000 300000 280000 625000 -r sum %scratch_dir%/vlakken_combi.tif %scratch_dir%/vlakken_combi_25m.tif 
+gdalwarp -co COMPRESS=LZW -tr 25 25 -te 10000 300000 280000 625000 -r sum %scratch_dir%/lijnen_combi.tif %scratch_dir%/lijnen_combi_25m.tif 
+
+REM Combineer lijnen en vlakken om gebieden op te sporen waar lijnen of vlakken individueel niet voldoende zijn om de drempelwaarde(s) te overschrijden
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/vlakken_combi_25m.tif -B %scratch_dir%/lijnen_combi_25m.tif --outfile=%scratch_dir%/lijn_vlak_combi_25m.tif --calc="A+B"
+
+REM Apply treshold
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/vlakken_combi_25m.tif --outfile=%scratch_dir%/vlakken_gte_th.tif --calc="numpy.where(A >= %drempelwaarde_vlakken%, 1, 0)"
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/lijnen_combi_25m.tif --outfile=%scratch_dir%/lijnen_gte_th.tif --calc="numpy.where(A >= %drempelwaarde_lijnen%, 1, 0)"
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW -A %scratch_dir%/lijn_vlak_combi_25m.tif --outfile=%scratch_dir%/lijnen_vlakken_gte_th.tif --calc="numpy.where(A >= %drempelwaarde_combi%, 1, 0)"
+
+REM Combine. Output pxl value 2 means 'gesloten' 1 means 'open'.
+python "%gdal_dir%/gdal_calc.py" --co COMPRESS=LZW --type=Float32 -A %scratch_dir%/vlakken_gte_th.tif -B %scratch_dir%/lijnen_gte_th.tif -C %scratch_dir%/lijnen_vlakken_gte_th.tif --outfile=%out_dir%\opgaande_elementen_%jaar%_%timestamp%.tif --calc="numpy.where((A+B+C) >=1, 2, 1)"
+
+REM add metadata to output file
+python "%gdal_dir%/gdal_edit.py" -mo CREATEDBY=%USERNAME% -mo DATETIME=%timestamp% -mo TOP10SRC=%T10Dir% -mo BEBOUWINGSRC=%BBDIR%\%BBfc% -mo OGSRC=%OGDIR% -mo THvlak=%drempelwaarde_vlakken% -mo THlijn=%drempelwaarde_lijnen% -mo THcombi=%drempelwaarde_combi% %out_dir%\opgaande_elementen_%jaar%_%timestamp%.tif
+
+REM Translate to flt
+gdal_translate -of "EHdr" %out_dir%\opgaande_elementen_%jaar%_%timestamp%.tif %out_dir%\opgaande_elementen_%jaar%_%timestamp%.flt
+
+REM Write metadata file
+python create_readme.py %out_dir%\opgaande_elementen_%jaar%_%timestamp%.tif %T10Dir% %BBDir% %BBfc% %OGDir% %drempelwaarde_vlakken% %drempelwaarde_lijnen% %drempelwaarde_combi% "%BB_sel%" "%T10Vlak_sel%" "%T10Lijn_sel%"
+
+pause
\ No newline at end of file
diff --git a/sample/geslotenheid/Stap1_LM_Verraster_Basisdata_v4.py b/sample/geslotenheid/z_archief/Stap1_LM_Verraster_Basisdata_v4.py
similarity index 100%
rename from sample/geslotenheid/Stap1_LM_Verraster_Basisdata_v4.py
rename to sample/geslotenheid/z_archief/Stap1_LM_Verraster_Basisdata_v4.py
diff --git a/sample/geslotenheid/Stap1_LM_Verraster_Basisdata_v4_HDR.py b/sample/geslotenheid/z_archief/Stap1_LM_Verraster_Basisdata_v4_HDR.py
similarity index 100%
rename from sample/geslotenheid/Stap1_LM_Verraster_Basisdata_v4_HDR.py
rename to sample/geslotenheid/z_archief/Stap1_LM_Verraster_Basisdata_v4_HDR.py
diff --git a/sample/geslotenheid/Stap2_LM_OpenheidBasis_v3.py b/sample/geslotenheid/z_archief/Stap2_LM_OpenheidBasis_v3.py
similarity index 100%
rename from sample/geslotenheid/Stap2_LM_OpenheidBasis_v3.py
rename to sample/geslotenheid/z_archief/Stap2_LM_OpenheidBasis_v3.py
diff --git a/sample/geslotenheid/Stap2_LM_OpenheidBasis_v3_HDR.py b/sample/geslotenheid/z_archief/Stap2_LM_OpenheidBasis_v3_HDR.py
similarity index 100%
rename from sample/geslotenheid/Stap2_LM_OpenheidBasis_v3_HDR.py
rename to sample/geslotenheid/z_archief/Stap2_LM_OpenheidBasis_v3_HDR.py
diff --git a/sample/vs/ApplicationFiles/DriveConnectWURShare.ps1 b/sample/vs/ApplicationFiles/DriveConnectWURShare.ps1
new file mode 100644
index 0000000000000000000000000000000000000000..0332d48807d07de8e865c51b25b83d12a65dc457
--- /dev/null
+++ b/sample/vs/ApplicationFiles/DriveConnectWURShare.ps1
@@ -0,0 +1,9 @@
+$connectTestResult = Test-NetConnection -ComputerName larchmnpdiag.file.core.windows.net -Port 445
+if ($connectTestResult.TcpTestSucceeded) {
+    # Save the password so the drive will persist on reboot
+    cmd.exe /C "cmdkey /add:`"larchmnpdiag.file.core.windows.net`" /user:`"Azure\larchmnpdiag`" /pass:`"T/GJzYdRSE395mMy47WWS33uCvFRqaP0PM9WF4tSDZfC6YrNHBbrHZUdDI/xtE/AMnNjznN0svddZY0yx/EeQA==`""
+    # Mount the drive
+    New-PSDrive -Name Q -PSProvider FileSystem -Root "\\larchmnpdiag.file.core.windows.net\mnpmaindata"-Persist
+} else {
+    Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
+}
diff --git a/sample/vs/ApplicationFiles/task.bat b/sample/vs/ApplicationFiles/task.bat
index 2a1ec7b04e2be0435a89d29ee40496ee38a28431..3c31b6acdf201b01d07b9b912d7f7bb201f7bee6 100644
--- a/sample/vs/ApplicationFiles/task.bat
+++ b/sample/vs/ApplicationFiles/task.bat
@@ -7,6 +7,7 @@ fart -i -r %1 OUTPUT_NAME %2
 REM 7za.exe a -r -t7z -m0=LZMA2:d64k:fb32 -ms=8m -mmt=30 -mx=9 "%AZ_BATCH_TASK_WORKING_DIR%\%3" "%AZ_BATCH_TASK_WORKING_DIR%\*.*"
 ViewScapeCon.exe %AZ_BATCH_TASK_WORKING_DIR%\%1 
 PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'DriveConnect.ps1'"
+
 xcopy /e /i /y /q  %AZ_BATCH_TASK_WORKING_DIR%\*.* "\\viewscapediag.file.core.windows.net\viewscapedata\!Results\*.*"
 
 
diff --git a/sample/vs/batch_python_windows.py b/sample/vs/batch_python_windows.py
index 73cf57573d6f4aa536572c375dd79817d19dc73e..6cffd5c033d22f9a610966645e2617b7d8eda84a 100644
--- a/sample/vs/batch_python_windows.py
+++ b/sample/vs/batch_python_windows.py
@@ -242,7 +242,7 @@ def create_job(batch_service_client, job_id, pool_id):
     batch_service_client.job.add(job)
 
 
-def add_tasks(batch_service_client, job_id, run_files, output_container_sas_url):
+def add_tasks(batch_service_client, job_id, run_files, output_container_sas_url, output_id):
     """
     Adds a task for each input file in the collection to the specified job.
 
@@ -253,6 +253,7 @@ def add_tasks(batch_service_client, job_id, run_files, output_container_sas_url)
      created for each input file.
     :param output_container_sas_token: A SAS token granting write access to
     the specified Azure Blob storage container.
+    :param output_id: str identifyer in output file names
     """
 
     print('Adding {} tasks to job [{}]...'.format(len(run_files), job_id))
@@ -262,7 +263,7 @@ def add_tasks(batch_service_client, job_id, run_files, output_container_sas_url)
     for idx, input_file in enumerate(run_files):
         input_file_path = input_file.file_path        
         output_file_path = "VSOutFile{}.7z".format(idx)
-        output_id = "VSOutFile{}".format(idx)
+        output_id = "{}{:03}".format(output_id, idx)
         command = "cmd /c task.bat {} {} {}".format(input_file_path, output_id, output_file_path)
         tasks.append(batch.models.TaskAddParameter(
             id='Task{}'.format(idx),
@@ -321,6 +322,7 @@ if __name__ == '__main__':
     parser = argparse.ArgumentParser()
     parser.add_argument('--time', help='time out period in minutes', type=int, default=30)
     parser.add_argument('--id', help='job ID', type=str, default='Viewscape')
+    parser.add_argument('--output_id', help='output file identifier', type=str, default='VSOutFile')
     parser.add_argument('--rundir', help='directory with runfile *.ini', type=str, default='./RunFiles')
     parser.add_argument('--remove', help='remove batch pool, job and blob containers', action='store_true')
     args = parser.parse_args()
@@ -370,6 +372,12 @@ if __name__ == '__main__':
              if filename.endswith(".ini") and filename.startswith('ViewShed'):
                 run_file_paths.append(os.path.abspath(os.path.join(folder, filename)))
 
+    # Set pool parameters and subsequently create it
+    if config._DEDICATED_POOL_NODE_COUNT =="auto":
+        setattr(config, '_DEDICATED_POOL_NODE_COUNT',len(run_file_paths))
+    else:
+        pass 
+
     # Create a list of all application files in the ApplicationFiles directory.
     data_file_paths = []
 
@@ -423,7 +431,7 @@ if __name__ == '__main__':
 
         # Add the tasks to the job. Pass the input files and a SAS URL
         # to the storage container for output files.
-        add_tasks(batch_client, config._JOB_ID, run_files, output_container_sas_url)
+        add_tasks(batch_client, config._JOB_ID, run_files, output_container_sas_url, output_id=args.output_id)
 
         # Pause execution until tasks reach Completed state.
         wait_for_tasks_to_complete(batch_client,
@@ -454,6 +462,14 @@ if __name__ == '__main__':
             print_batch_exception(err)
         else:
             print(err)
+        if args.remove:        
+            # Delete run and data containers on blob client
+            delete_container(blob_client, run_container_name)
+            delete_container(blob_client, data_container_name)
+    
+            # Clean up Batch resources
+            batch_client.job.delete(config._JOB_ID)
+            batch_client.pool.delete(config._POOL_ID)      
         sys.exit(1)
 
     if args.remove:        
diff --git a/sample/vs/config.py b/sample/vs/config.py
index 9eab3e6db8c370fb12fa21c951db667fc6f772ad..99082e46668890086f9eedc59b67444ce1d4695b 100644
--- a/sample/vs/config.py
+++ b/sample/vs/config.py
@@ -21,9 +21,8 @@ _BATCH_ACCOUNT_URL = 'https://viewscapebatch.westeurope.batch.azure.com'  # Your
 _STORAGE_ACCOUNT_NAME = 'viewscapediag'  # Your storage account name
 _STORAGE_ACCOUNT_KEY = 'WaxZFarUCCOvJPdzH36uGroOMYwqOBzpEkk7vudY2K8dhryp0rihBPtNXgrIO8s4xChT8axaDVAWkRBdnbgohQ=='  # Your storage account key
 _POOL_ID = 'ViewscapePool'  # Your Pool ID
-_POOL_NODE_COUNT = 2  # Pool node count
-_POOL_VM_SIZE = 'STANDARD_A1_v2'  # VM Type/Size
+_POOL_VM_SIZE = 'STANDARD_DS2_v2'  # VM Type/Size
 _JOB_ID = 'Viewscape'  # Job ID
 _STANDARD_OUT_FILE_NAME = 'stdout.txt'  # Standard Output file
-_DEDICATED_POOL_NODE_COUNT = 1
+_DEDICATED_POOL_NODE_COUNT = 'auto'  # Moet eigenlijk gelijk zijn aan aantal *.ini files
 _LOW_PRIORITY_POOL_NODE_COUNT = 0