[saga] 01/05: Imported Upstream version 2.2.1+dfsg

Johan Van de Wauw johanvdw-guest at moszumanska.debian.org
Thu Sep 24 17:19:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

johanvdw-guest pushed a commit to branch master
in repository saga.

commit 0e8f2fcb8f657fa438c7a2018e9eeb5c9284ed75
Author: Johan Van de Wauw <johan at vandewauw.be>
Date:   Thu Sep 24 15:32:53 2015 +0200

    Imported Upstream version 2.2.1+dfsg
---
 README                                             |    2 +-
 configure                                          |   23 +-
 configure.ac                                       |    5 +-
 src/modules/grid/grid_analysis/MLB_Interface.cpp   |   16 +-
 src/modules/grid/grid_analysis/Makefile.am         |    4 +-
 src/modules/grid/grid_analysis/Makefile.in         |   15 +-
 .../grid/grid_analysis/diversity_analysis.cpp      |  291 ++
 .../grid_analysis/diversity_analysis.h}            |   39 +-
 .../grid/grid_calculus/Grid_Random_Terrain.cpp     |    4 +-
 src/modules/grid/grid_filter/MLB_Interface.cpp     |    6 +-
 src/modules/grid/grid_filter/Makefile.am           |    4 +-
 src/modules/grid/grid_filter/Makefile.in           |    7 +-
 src/modules/grid/grid_filter/wombling.cpp          |  368 +++
 .../grid_to_kml.h => grid/grid_filter/wombling.h}  |   38 +-
 src/modules/grid/grid_gridding/Interpolation.cpp   |    4 +-
 src/modules/grid/grid_gridding/Shapes2Grid.cpp     |   11 +-
 src/modules/grid/grid_gridding/kernel_density.cpp  |    4 +-
 .../grid/grid_spline/Gridding_Spline_Base.cpp      |    4 +-
 .../grid/grid_spline/MBASpline_for_Categories.cpp  |   10 +-
 src/modules/grid/grid_tools/Grid_Cut.cpp           |   26 +-
 src/modules/grid/grid_tools/Grid_Merge.cpp         |    4 +-
 src/modules/grid/grid_tools/Grid_Resample.cpp      |   16 +-
 src/modules/grid/grid_tools/Grid_SortRaster.cpp    |   25 +-
 .../grid_tools/Grid_Value_Replace_Interactive.cpp  |  158 +-
 .../grid_tools/Grid_Value_Replace_Interactive.h    |   62 +-
 src/modules/imagery/imagery_opencv/opencv_nnet.cpp |    4 +-
 src/modules/imagery/imagery_opencv/opencv_nnet.h   |    4 +-
 src/modules/imagery/imagery_svm/svm.cpp            | 3089 -------------------
 src/modules/imagery/imagery_svm/svm.h              |  101 -
 .../imagery/imagery_vigra/vigra_random_forest.cpp  |    2 +-
 src/modules/io/io_gdal/gdal_driver.cpp             |   67 +-
 src/modules/io/io_gdal/gdal_driver.h               |    3 +
 src/modules/io/io_gdal/gdal_import.cpp             |    8 +
 src/modules/io/io_grid_image/MLB_Interface.cpp     |   13 +-
 src/modules/io/io_grid_image/grid_export.cpp       |   43 +-
 src/modules/io/io_grid_image/grid_to_kml.cpp       |  217 +-
 src/modules/io/io_grid_image/grid_to_kml.h         |   31 +-
 .../pointcloud/pointcloud_tools/MLB_Interface.cpp  |   12 +-
 .../pointcloud/pointcloud_tools/Makefile.am        |    2 +
 .../pointcloud/pointcloud_tools/Makefile.in        |    8 +-
 .../pointcloud/pointcloud_tools/pc_from_shapes.cpp |   35 +-
 .../pointcloud/pointcloud_tools/pc_from_shapes.h   |    2 +-
 .../{pc_from_shapes.cpp => pc_from_table.cpp}      |  156 +-
 .../{pc_from_shapes.h => pc_from_table.h}          |   46 +-
 .../pointcloud_tools/pc_reclass_extract.cpp        |   36 +-
 .../pointcloud_tools/pc_reclass_extract.h          |    3 +-
 src/modules/shapes/shapes_lines/MLB_Interface.cpp  |    3 +-
 .../shapes/shapes_lines/line_split_with_lines.cpp  |  179 ++
 .../shapes/shapes_lines/line_split_with_lines.h    |   23 +
 .../shapes/shapes_points/Points_From_Lines.cpp     |  596 +++-
 .../shapes/shapes_points/Points_From_Lines.h       |    9 +-
 src/modules/simulation/Makefile.am                 |    2 +-
 src/modules/simulation/Makefile.in                 |    2 +-
 src/modules/simulation/sim_rivflow/DataTrans.cpp   |  179 ++
 .../sim_rivflow/DataTrans.h}                       |  188 +-
 src/modules/simulation/sim_rivflow/GridComb.cpp    |  405 +++
 .../sim_rivflow/GridComb.h}                        |  215 +-
 src/modules/simulation/sim_rivflow/LandFlow.cpp    | 3165 ++++++++++++++++++++
 src/modules/simulation/sim_rivflow/LandFlow.h      |  294 ++
 .../sim_rivflow}/MLB_Interface.cpp                 |  266 +-
 .../sim_rivflow/MLB_Interface.h}                   |  178 +-
 src/modules/simulation/sim_rivflow/Makefile.am     |   32 +
 .../sim_rivflow}/Makefile.in                       |   99 +-
 src/modules/simulation/sim_rivflow/RivBasin.cpp    |  594 ++++
 .../sim_rivflow/RivBasin.h}                        |  204 +-
 .../simulation/sim_rivflow/RivCourseImpr.cpp       |  192 ++
 .../sim_rivflow/RivCourseImpr.h}                   |  189 +-
 src/modules/simulation/sim_rivflow/RivGridPrep.cpp |  221 ++
 .../sim_rivflow/RivGridPrep.h}                     |  202 +-
 .../statistics/statistics_kriging/kriging_base.cpp |    2 +-
 .../statistics_kriging/kriging_regression.cpp      |   77 +-
 .../statistics_regression/gw_multi_regression.cpp  |    2 +-
 .../statistics_regression/gw_regression.cpp        |    2 +-
 .../point_multi_grid_regression.cpp                |   56 +-
 .../statistics_regression/point_trend_surface.cpp  |    2 +-
 .../ta_morphometry/ProtectionIndex.cpp             |   48 +-
 .../ta_morphometry/tc_iwahashi_pike.cpp            |  776 +++--
 .../ta_morphometry/tc_iwahashi_pike.h              |   58 +-
 src/saga_core/saga_api/Makefile.am                 |    5 +-
 src/saga_core/saga_api/Makefile.in                 |   31 +-
 src/saga_core/saga_api/api_core.h                  |   10 +-
 src/saga_core/saga_api/api_string.cpp              |   39 +-
 src/saga_core/saga_api/data_manager.cpp            |   30 +-
 src/saga_core/saga_api/data_manager.h              |    4 +-
 src/saga_core/saga_api/dataobject.cpp              |   24 +-
 src/saga_core/saga_api/dataobject.h                |   12 +-
 src/saga_core/saga_api/datetime.cpp                |  515 ++++
 src/saga_core/saga_api/datetime.h                  |  368 +++
 src/saga_core/saga_api/grid.cpp                    |   40 +-
 src/saga_core/saga_api/grid.h                      |   83 +-
 src/saga_core/saga_api/grid_io.cpp                 |  513 ++--
 src/saga_core/saga_api/grid_memory.cpp             |   82 +-
 src/saga_core/saga_api/mat_tools.cpp               |  161 +-
 src/saga_core/saga_api/mat_tools.h                 |  110 +-
 src/saga_core/saga_api/module_chain.cpp            |  142 +-
 src/saga_core/saga_api/parameter_data.cpp          |   21 +-
 src/saga_core/saga_api/pointcloud.cpp              |  101 +-
 src/saga_core/saga_api/pointcloud.h                |   34 +-
 src/saga_core/saga_api/quadtree.cpp                |    4 +-
 src/saga_core/saga_api/saga_api.h                  |    4 +-
 src/saga_core/saga_api/shapes.cpp                  |    8 +-
 src/saga_core/saga_api/table_io.cpp                |    6 +-
 src/saga_core/saga_api/tin.cpp                     |    6 +-
 src/saga_core/saga_cmd/module_library.cpp          |   32 +-
 src/saga_core/saga_cmd/module_library.h            |    4 +-
 src/saga_core/saga_gui/data_source.cpp             |    2 +-
 src/saga_core/saga_gui/project.cpp                 |   18 +-
 src/saga_core/saga_gui/res/saga.ger.txt            |  983 +++++-
 src/saga_core/saga_gui/res/saga.lng.txt            |  981 +++++-
 src/saga_core/saga_gui/saga.cpp                    |   24 +-
 src/saga_core/saga_gui/saga_frame.cpp              |   12 +-
 src/saga_core/saga_gui/view_histogram.cpp          |    6 +-
 src/saga_core/saga_gui/view_layout_info.cpp        |    4 +-
 src/saga_core/saga_gui/view_map_control.cpp        |    4 +-
 src/saga_core/saga_gui/wksp_base_item.h            |   13 +-
 src/saga_core/saga_gui/wksp_data_manager.cpp       |  123 +-
 src/saga_core/saga_gui/wksp_data_menu_file.cpp     |   38 +-
 src/saga_core/saga_gui/wksp_data_menu_file.h       |    3 +-
 src/saga_core/saga_gui/wksp_data_menu_files.cpp    |   13 +-
 src/saga_core/saga_gui/wksp_data_menu_files.h      |    3 +-
 src/saga_core/saga_gui/wksp_grid.cpp               |   17 +-
 src/saga_core/saga_gui/wksp_grid.h                 |    4 +-
 src/saga_core/saga_gui/wksp_layer.cpp              |    8 +-
 src/saga_core/saga_gui/wksp_layer.h                |    6 +-
 src/saga_core/saga_gui/wksp_map.cpp                |   28 +-
 src/saga_core/saga_gui/wksp_map.h                  |    6 +-
 src/saga_core/saga_gui/wksp_map_layer.cpp          |   80 +-
 src/saga_core/saga_gui/wksp_map_layer.h            |    7 +-
 src/saga_core/saga_gui/wksp_pointcloud.cpp         |    4 +-
 src/saga_core/saga_gui/wksp_pointcloud.h           |    4 +-
 src/saga_core/saga_gui/wksp_shapes.cpp             |    8 +-
 src/saga_core/saga_gui/wksp_shapes.h               |    4 +-
 src/saga_core/saga_gui/wksp_tin.cpp                |    8 +-
 src/saga_core/saga_gui/wksp_tin.h                  |    4 +-
 134 files changed, 12480 insertions(+), 5812 deletions(-)

diff --git a/README b/README
index 3a0421a..21371d7 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 _______________________________________________________________________________
 
-         SAGA 2.2.0 - System for Automated Geoscientific Analyses
+         SAGA 2.2.1 - System for Automated Geoscientific Analyses
 _______________________________________________________________________________
 
 * Introduction
diff --git a/configure b/configure
index 5fef9a7..9f94184 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for saga 2.2.0.
+# Generated by GNU Autoconf 2.69 for saga 2.2.1.
 #
 # Report bugs to <BUG-REPORT-ADDRESS>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='saga'
 PACKAGE_TARNAME='saga'
-PACKAGE_VERSION='2.2.0'
-PACKAGE_STRING='saga 2.2.0'
+PACKAGE_VERSION='2.2.1'
+PACKAGE_STRING='saga 2.2.1'
 PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
 PACKAGE_URL=''
 
@@ -1380,7 +1380,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures saga 2.2.0 to adapt to many kinds of systems.
+\`configure' configures saga 2.2.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1450,7 +1450,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of saga 2.2.0:";;
+     short | recursive ) echo "Configuration of saga 2.2.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1571,7 +1571,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-saga configure 2.2.0
+saga configure 2.2.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2115,7 +2115,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by saga $as_me 2.2.0, which was
+It was created by saga $as_me 2.2.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2982,7 +2982,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='saga'
- VERSION='2.2.0'
+ VERSION='2.2.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -18009,7 +18009,7 @@ $as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
 
 fi
 #AC_CONFIG_FILES([Makefile])
-ac_config_files="$ac_config_files Makefile src/Makefile src/saga_core/Makefile src/saga_core/saga_api/Makefile src/saga_core/saga_gdi/Makefile src/saga_core/saga_gui/Makefile src/saga_core/saga_gui/man/Makefile src/saga_core/saga_cmd/Makefile src/saga_core/saga_cmd/man/Makefile src/modules/Makefile src/modules/climate/Makefile src/modules/climate/climate_tools/Makefile src/modules/contrib/Makefile src/modules/contrib/contrib_peregro/Makefile src/modules/db/Makefile src/modules/db/db_odbc [...]
+ac_config_files="$ac_config_files Makefile src/Makefile src/saga_core/Makefile src/saga_core/saga_api/Makefile src/saga_core/saga_gdi/Makefile src/saga_core/saga_gui/Makefile src/saga_core/saga_gui/man/Makefile src/saga_core/saga_cmd/Makefile src/saga_core/saga_cmd/man/Makefile src/modules/Makefile src/modules/climate/Makefile src/modules/climate/climate_tools/Makefile src/modules/contrib/Makefile src/modules/contrib/contrib_peregro/Makefile src/modules/db/Makefile src/modules/db/db_odbc [...]
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -18590,7 +18590,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by saga $as_me 2.2.0, which was
+This file was extended by saga $as_me 2.2.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18656,7 +18656,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-saga config.status 2.2.0
+saga config.status 2.2.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -19239,6 +19239,7 @@ do
     "src/modules/simulation/sim_fire_spreading/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_fire_spreading/Makefile" ;;
     "src/modules/simulation/sim_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_hydrology/Makefile" ;;
     "src/modules/simulation/sim_ihacres/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_ihacres/Makefile" ;;
+    "src/modules/simulation/sim_rivflow/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/simulation/sim_rivflow/Makefile" ;;
     "src/modules/statistics/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/statistics/Makefile" ;;
     "src/modules/statistics/statistics_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/statistics/statistics_grid/Makefile" ;;
     "src/modules/statistics/statistics_kriging/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/statistics/statistics_kriging/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index 8c8b097..5bb0a9a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
-# $Id: configure.ac 2491 2015-05-18 06:48:00Z manfred-e $
+# $Id: configure.ac 2536 2015-07-02 14:57:02Z oconrad $
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(saga, 2.2.0, BUG-REPORT-ADDRESS)
+AC_INIT(saga, 2.2.1, BUG-REPORT-ADDRESS)
 AC_CONFIG_SRCDIR([src/saga_core/saga_gui/wksp_data_menu_files.cpp])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
@@ -279,6 +279,7 @@ AC_OUTPUT(Makefile \
 	src/modules/simulation/sim_fire_spreading/Makefile \
 	src/modules/simulation/sim_hydrology/Makefile \
 	src/modules/simulation/sim_ihacres/Makefile \
+	src/modules/simulation/sim_rivflow/Makefile \
 	src/modules/statistics/Makefile \
 	src/modules/statistics/statistics_grid/Makefile \
 	src/modules/statistics/statistics_kriging/Makefile \
diff --git a/src/modules/grid/grid_analysis/MLB_Interface.cpp b/src/modules/grid/grid_analysis/MLB_Interface.cpp
index 44b9c19..6958623 100644
--- a/src/modules/grid/grid_analysis/MLB_Interface.cpp
+++ b/src/modules/grid/grid_analysis/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2365 2015-01-09 15:12:03Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2584 2015-09-17 16:13:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -115,6 +115,9 @@ CSG_String Get_Info(int i)
 #include "Grid_Accumulation_Functions.h"
 #include "Grid_IMCORR.h"
 
+#include "diversity_analysis.h"
+
+
 //---------------------------------------------------------
 // 4. Allow your modules to be created here...
 
@@ -124,8 +127,6 @@ CSG_Module *		Create_Module(int i)
 	{
 	case  0:	return( new CCost_Isotropic );
 	case  1:	return( new CCost_Anisotropic );
-	case  2:	return( MLB_INTERFACE_SKIP_MODULE );	// removed: CCost_PolarToRect
-	case  3:	return( MLB_INTERFACE_SKIP_MODULE );	// removed: CCost_RectToPolar
 	case  4:	return( new CLeastCostPathProfile );
 	case  5:	return( new CLeastCostPathProfile_Points );
 
@@ -146,11 +147,14 @@ CSG_Module *		Create_Module(int i)
 	case 17:	return( new CFragmentation_Classify );
 
 	case 18:	return( new CGrid_Accumulation_Functions );
-	
+
 	case 19:	return( new CGrid_IMCORR );
-	}
 
-	return( NULL );
+	case 21:	return( new CDiversity_Analysis );
+
+	case 22:	return( NULL );
+	default:	return( MLB_INTERFACE_SKIP_MODULE );
+	}
 }
 
 
diff --git a/src/modules/grid/grid_analysis/Makefile.am b/src/modules/grid/grid_analysis/Makefile.am
index 5d481b6..1e12207 100644
--- a/src/modules/grid/grid_analysis/Makefile.am
+++ b/src/modules/grid/grid_analysis/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1597 2013-01-28 17:02:55Z reklov_w $
+# $Id: Makefile.am 2584 2015-09-17 16:13:56Z oconrad $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -17,6 +17,7 @@ Cost_Anisotropic.cpp\
 Cost_Isotropic.cpp\
 CoveredDistance.cpp\
 CrossClassification.cpp\
+diversity_analysis.cpp\
 fragmentation_base.cpp\
 fragmentation_classify.cpp\
 fragmentation_resampling.cpp\
@@ -38,6 +39,7 @@ Cost_Anisotropic.h\
 Cost_Isotropic.h\
 CoveredDistance.h\
 CrossClassification.h\
+diversity_analysis.h\
 fragmentation_base.h\
 fragmentation_classify.h\
 fragmentation_resampling.h\
diff --git a/src/modules/grid/grid_analysis/Makefile.in b/src/modules/grid/grid_analysis/Makefile.in
index 6ed48c2..4363487 100644
--- a/src/modules/grid/grid_analysis/Makefile.in
+++ b/src/modules/grid/grid_analysis/Makefile.in
@@ -129,11 +129,11 @@ libgrid_analysis_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 am_libgrid_analysis_la_OBJECTS = Cost_Anisotropic.lo Cost_Isotropic.lo \
 	CoveredDistance.lo CrossClassification.lo \
-	fragmentation_base.lo fragmentation_classify.lo \
-	fragmentation_resampling.lo fragmentation_standard.lo \
-	Grid_Accumulation_Functions.lo Grid_AggregationIndex.lo \
-	Grid_AHP.lo Grid_CVA.lo Grid_IMCORR.lo \
-	Grid_LayerOfMaximumValue.lo Grid_Pattern.lo \
+	diversity_analysis.lo fragmentation_base.lo \
+	fragmentation_classify.lo fragmentation_resampling.lo \
+	fragmentation_standard.lo Grid_Accumulation_Functions.lo \
+	Grid_AggregationIndex.lo Grid_AHP.lo Grid_CVA.lo \
+	Grid_IMCORR.lo Grid_LayerOfMaximumValue.lo Grid_Pattern.lo \
 	LeastCostPathProfile.lo LeastCostPathProfile_Points.lo \
 	MLB_Interface.lo owa.lo PointsEx.lo Soil_Texture.lo
 libgrid_analysis_la_OBJECTS = $(am_libgrid_analysis_la_OBJECTS)
@@ -369,7 +369,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1597 2013-01-28 17:02:55Z reklov_w $
+# $Id: Makefile.am 2584 2015-09-17 16:13:56Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
@@ -383,6 +383,7 @@ Cost_Anisotropic.cpp\
 Cost_Isotropic.cpp\
 CoveredDistance.cpp\
 CrossClassification.cpp\
+diversity_analysis.cpp\
 fragmentation_base.cpp\
 fragmentation_classify.cpp\
 fragmentation_resampling.cpp\
@@ -404,6 +405,7 @@ Cost_Anisotropic.h\
 Cost_Isotropic.h\
 CoveredDistance.h\
 CrossClassification.h\
+diversity_analysis.h\
 fragmentation_base.h\
 fragmentation_classify.h\
 fragmentation_resampling.h\
@@ -518,6 +520,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/PointsEx.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Soil_Texture.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/diversity_analysis.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragmentation_base.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragmentation_classify.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fragmentation_resampling.Plo at am__quote@
diff --git a/src/modules/grid/grid_analysis/diversity_analysis.cpp b/src/modules/grid/grid_analysis/diversity_analysis.cpp
new file mode 100644
index 0000000..66c46a9
--- /dev/null
+++ b/src/modules/grid/grid_analysis/diversity_analysis.cpp
@@ -0,0 +1,291 @@
+/**********************************************************
+ * Version $Id: diversity_analysis.cpp 2476 2015-04-22 18:41:38Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                 diversity_analysis.cpp                //
+//                                                       //
+//                 Copyright (C) 2015 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "diversity_analysis.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CDiversity_Analysis::CDiversity_Analysis(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Diversity of Categories"));
+
+	Set_Author		("O.Conrad (c) 2015");
+
+	Set_Description	(_TW(
+		"Grid based analysis of diversity. It is assumed that the "
+		"input grid provides a classification (i.e. not a contiuous field). "
+		"For each cell it counts the number of different categories (classes) "
+		"as well as the connectivity within the chosen search window. "
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "CATEGORIES"		, _TL("Categories"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "DIVERSITY"		, _TL("Number of Categories"),
+		_TL("number of different categories (unique values) within search area"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SIZE_MEAN"		, _TL("Average Size"),
+		_TL("average size of the area covered by each category that occurs within search area"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "SIZE_SKEW"		, _TL("Skewness"),
+		_TL("skewness of the area size per category distribution"),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL	, "CONNECTIVITY"	, _TL("Connectivity"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "SEARCH_MODE"		, _TL("Search Mode"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("Square"),
+			_TL("Circle")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "SEARCH_RADIUS"	, _TL("Search Distance"),
+		_TL("Search distance given as number cells."),
+		PARAMETER_TYPE_Int, 3, 1, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "NB_CASE"			, _TL("Connectivity Neighbourhood"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("Rook's case"),
+			_TL("Queen's case")
+		), 1
+	);
+
+	m_Search.Get_Weighting().Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Search.Get_Weighting().Set_BandWidth(0.7);
+	m_Search.Get_Weighting().Create_Parameters(&Parameters, false);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CDiversity_Analysis::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	m_Search.Get_Weighting().Enable_Parameters(pParameters);
+
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CDiversity_Analysis::On_Execute(void)
+{
+	//-----------------------------------------------------
+	m_pClasses		= Parameters("CATEGORIES"  )->asGrid();
+	m_pDiversity	= Parameters("DIVERSITY"   )->asGrid();
+	m_pSize_Mean	= Parameters("SIZE_MEAN"   )->asGrid();
+	m_pSize_Skew	= Parameters("SIZE_SKEW"   )->asGrid();
+	m_pConnectivity	= Parameters("CONNECTIVITY")->asGrid();
+
+	m_pDiversity	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Count"       )));
+	m_pSize_Mean	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Average"     )));
+	m_pSize_Skew	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Skewness"    )));
+	m_pConnectivity	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Connectivity")));
+
+	DataObject_Set_Colors(m_pDiversity   , 11, SG_COLORS_DEFAULT, false);
+	DataObject_Set_Colors(m_pSize_Mean   , 11, SG_COLORS_DEFAULT,  true);
+	DataObject_Set_Colors(m_pSize_Skew   , 11, SG_COLORS_DEFAULT,  true);
+	DataObject_Set_Colors(m_pConnectivity, 11, SG_COLORS_DEFAULT,  true);
+
+	//-----------------------------------------------------
+	m_Search.Get_Weighting().Set_Parameters(&Parameters);
+	m_Search.Get_Weighting().Set_BandWidth(Parameters("SEARCH_RADIUS")->asDouble() * m_Search.Get_Weighting().Get_BandWidth());
+	m_Search.Set_Radius(Parameters("SEARCH_RADIUS")->asInt(), Parameters("SEARCH_MODE")->asInt() == 0);
+
+	m_bWeighted	= m_Search.Get_Weighting().Get_Weighting() != SG_DISTWGHT_None;
+
+	m_NB_Step	= Parameters("NB_CASE")->asInt() == 0 ? 2 : 1;
+
+	//-----------------------------------------------------
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX(); x++)
+		{
+			if( m_pClasses->is_NoData(x, y) || !Get_Diversity(x, y) )
+			{
+				m_pDiversity   ->Set_NoData(x, y);
+				m_pSize_Mean   ->Set_NoData(x, y);
+				m_pSize_Skew   ->Set_NoData(x, y);
+				m_pConnectivity->Set_NoData(x, y);
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	m_Search.Destroy();
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CDiversity_Analysis::Get_Diversity(int x, int y)
+{
+	int		i, nCells = 0, nConnections = 0, nNeighbours = 0;
+
+	CSG_Class_Statistics_Weighted	Classes;
+
+	for(i=0; i<m_Search.Get_Count(); i++)
+	{
+		int	ix	= m_Search.Get_X(i, x);
+		int	iy	= m_Search.Get_Y(i, y);
+
+		if( m_pClasses->is_InGrid(ix, iy) )
+		{
+			double	iz	= m_pClasses->asDouble(ix, iy);
+
+			Classes.Add_Value(iz, m_bWeighted ? m_Search.Get_Weight(i) : 1.0);
+
+			nCells++;
+
+			for(int j=0; j<8; j+=m_NB_Step)
+			{
+				int	jx	= Get_xTo(j, ix);
+				int	jy	= Get_yTo(j, iy);
+
+				if( m_pClasses->is_InGrid(jx, jy) )
+				{
+					nNeighbours++;
+
+					if( m_pClasses->asDouble(jx, jy) == iz )
+					{
+						nConnections++;
+					}
+				}
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	if( Classes.Get_Count() > 1 )
+	{
+		CSG_Simple_Statistics	s(true);
+
+		for(i=0; i<Classes.Get_Count(); i++)
+		{
+			s.Add_Value(Classes.Get_Class_Count(i), m_bWeighted ? Classes.Get_Class_Weight(i) / Classes.Get_Class_Count(i) : 1.0);
+		}
+
+		m_pDiversity->Set_Value(x, y, s.Get_Sum() * s.Get_Weights());
+		m_pSize_Mean->Set_Value(x, y, s.Get_Mean() / (double)nCells);	// relative size !!!
+		m_pSize_Skew->Set_Value(x, y, s.Get_Skewness());	//	m_pSize_Skew->Set_Value(x, y, s.Get_SkewnessPearson());
+	}
+	else
+	{
+		m_pDiversity->Set_Value(x, y, 1.0);
+		m_pSize_Mean->Set_Value(x, y, 1.0);
+		m_pSize_Skew->Set_Value(x, y, 0.0);
+	}
+
+	m_pConnectivity->Set_Value(x, y, nNeighbours > 0 ? nConnections / (double)nNeighbours : 0.0);
+
+	return( nCells > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.h b/src/modules/grid/grid_analysis/diversity_analysis.h
similarity index 78%
copy from src/modules/shapes/shapes_lines/line_split_with_lines.h
copy to src/modules/grid/grid_analysis/diversity_analysis.h
index c4229fc..c03ea9e 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.h
+++ b/src/modules/grid/grid_analysis/diversity_analysis.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: line_split_with_lines.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: diversity_analysis.h 2476 2015-04-22 18:41:38Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                     shapes_lines                      //
+//                     grid_analysis                     //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                line_split_with_lines.h                //
+//                 diversity_analysis.h                  //
 //                                                       //
-//                 Copyright (C) 2014 by                 //
+//                 Copyright (C) 2015 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -59,13 +59,13 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__line_split_with_lines_H
-#define HEADER_INCLUDED__line_split_with_lines_H
+#ifndef HEADER_INCLUDED__diversity_analysis_H
+#define HEADER_INCLUDED__diversity_analysis_H
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
@@ -75,34 +75,45 @@
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CLine_Split_with_Lines : public CSG_Module  
+class CDiversity_Analysis : public CSG_Module_Grid
 {
 public:
-	CLine_Split_with_Lines(void);
+	CDiversity_Analysis(void);
 
 
 protected:
 
-	virtual bool			On_Execute			(void);
+	virtual int					On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	virtual bool				On_Execute				(void);
 
 
 private:
 
-	bool					Get_Intersection	(CSG_Shape *pLine, CSG_Shape_Part *pSplit);
+	bool						m_bWeighted;
+
+	int							m_NB_Step;
+
+	CSG_Grid					*m_pClasses, *m_pDiversity, *m_pSize_Mean, *m_pSize_Skew, *m_pConnectivity;
+
+	CSG_Grid_Cell_Addressor		m_Search;
+
+
+	bool						Get_Diversity			(int x, int y);
 
 };
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__line_split_with_lines_H
+#endif // #ifndef HEADER_INCLUDED__diversity_analysis_H
diff --git a/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp b/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
index 9d17b22..cb238c3 100644
--- a/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
+++ b/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Random_Terrain.cpp 2448 2015-03-19 14:44:48Z oconrad $
+ * Version $Id: Grid_Random_Terrain.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 /*******************************************************************************
     Grid_Random_Terrain.cpp
@@ -60,7 +60,7 @@ CGrid_Random_Terrain::CGrid_Random_Terrain(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/grid/grid_filter/MLB_Interface.cpp b/src/modules/grid/grid_filter/MLB_Interface.cpp
index 53dcd5e..a19509d 100644
--- a/src/modules/grid/grid_filter/MLB_Interface.cpp
+++ b/src/modules/grid/grid_filter/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2579 2015-09-16 18:48:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -113,6 +113,7 @@ CSG_String Get_Info(int i)
 #include "bin_erosion_reconst.h"
 #include "connect_analysis.h"
 #include "Filter_Sieve.h"
+#include "wombling.h"
 
 
 //---------------------------------------------------------
@@ -138,8 +139,9 @@ CSG_Module *		Create_Module(int i)
 	case 13:	return( new Cbin_erosion_reconst );
 	case 14:	return( new Cconnectivity_analysis );
 	case 15:	return( new CFilter_Sieve );
+	case 16:	return( new CWombling );
 
-	case 16:	return( NULL );
+	case 17:	return( NULL );
 	default:	return( MLB_INTERFACE_SKIP_MODULE );
 	}
 }
diff --git a/src/modules/grid/grid_filter/Makefile.am b/src/modules/grid/grid_filter/Makefile.am
index 0257b1f..594bc7a 100644
--- a/src/modules/grid/grid_filter/Makefile.am
+++ b/src/modules/grid/grid_filter/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 1991 2014-02-13 12:29:09Z oconrad $
+# $Id: Makefile.am 2579 2015-09-16 18:48:35Z oconrad $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -27,6 +27,7 @@ Filter_Resample.cpp\
 Filter_Sieve.cpp\
 Filter_Terrain_SlopeBased.cpp\
 FilterClumps.cpp\
+wombling.cpp\
 geomrec.cpp\
 ./geodesic_morph_rec/bin_geovinc.c\
 ./geodesic_morph_rec/combcontour.c\
@@ -48,6 +49,7 @@ Filter_Resample.h\
 Filter_Sieve.h\
 Filter_Terrain_SlopeBased.h\
 FilterClumps.h\
+wombling.h\
 geomrec.h\
 ./geodesic_morph_rec/bin_geovinc.h\
 ./geodesic_morph_rec/combcontour.h\
diff --git a/src/modules/grid/grid_filter/Makefile.in b/src/modules/grid/grid_filter/Makefile.in
index 75928eb..2aec985 100644
--- a/src/modules/grid/grid_filter/Makefile.in
+++ b/src/modules/grid/grid_filter/Makefile.in
@@ -133,7 +133,7 @@ am_libgrid_filter_la_OBJECTS = bin_erosion_reconst.lo \
 	Filter_LoG.lo Filter_Majority.lo Filter_Morphology.lo \
 	Filter_Multi_Dir_Lee.lo Filter_Rank.lo Filter_Resample.lo \
 	Filter_Sieve.lo Filter_Terrain_SlopeBased.lo FilterClumps.lo \
-	geomrec.lo ./geodesic_morph_rec/bin_geovinc.lo \
+	wombling.lo geomrec.lo ./geodesic_morph_rec/bin_geovinc.lo \
 	./geodesic_morph_rec/combcontour.lo \
 	./geodesic_morph_rec/geovinc.lo \
 	./geodesic_morph_rec/storeorg.lo mesh_denoise.lo \
@@ -371,7 +371,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 1991 2014-02-13 12:29:09Z oconrad $
+# $Id: Makefile.am 2579 2015-09-16 18:48:35Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
@@ -395,6 +395,7 @@ Filter_Resample.cpp\
 Filter_Sieve.cpp\
 Filter_Terrain_SlopeBased.cpp\
 FilterClumps.cpp\
+wombling.cpp\
 geomrec.cpp\
 ./geodesic_morph_rec/bin_geovinc.c\
 ./geodesic_morph_rec/combcontour.c\
@@ -416,6 +417,7 @@ Filter_Resample.h\
 Filter_Sieve.h\
 Filter_Terrain_SlopeBased.h\
 FilterClumps.h\
+wombling.h\
 geomrec.h\
 ./geodesic_morph_rec/bin_geovinc.h\
 ./geodesic_morph_rec/combcontour.h\
@@ -540,6 +542,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/connect_analysis.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geomrec.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mesh_denoise.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wombling.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./geodesic_morph_rec/$(DEPDIR)/bin_geovinc.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./geodesic_morph_rec/$(DEPDIR)/combcontour.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./geodesic_morph_rec/$(DEPDIR)/geovinc.Plo at am__quote@
diff --git a/src/modules/grid/grid_filter/wombling.cpp b/src/modules/grid/grid_filter/wombling.cpp
new file mode 100644
index 0000000..f21f3e2
--- /dev/null
+++ b/src/modules/grid/grid_filter/wombling.cpp
@@ -0,0 +1,368 @@
+/**********************************************************
+ * Version $Id: wombling.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                      Grid_Filter                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     wombling.cpp                      //
+//                                                       //
+//                 Copyright (C) 2015 by                 //
+//                      Olaf Conrad                      //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "wombling.h"
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CWombling::CWombling(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Wombling (Edge Detection)"));
+
+	Set_Author		("O.Conrad (c) 2015");
+
+	Set_Description	(_TW(
+		"Continuous Wombling for edge detection. Uses magnitude of gradient "
+		"to detect edges between adjacent cells. Edge segments connect such "
+		"edges, when the difference of their gradient directions is below given threshold.\n"
+		"\n"
+		"References:\n"
+		"- Fitzpatrick, M.C., Preisser, E.L., Porter, A., Elkinton, J., Waller, L.A., Carlin, B.P., Ellison, A.M. (2010):"
+		" Ecological boundary detection using Bayesian areal wombling. Ecology 91(12): 3448-3455. doi:10.1890/10-0807.1\n"
+		"- Fortin, M.-J. and Dale, M.R.T (2005):"
+		" Spatial Analysis - A Guide for Ecologists. Cambridge University Press.\n"
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Grid(
+		NULL	, "GRID"		, _TL("Grid"),
+		_TL(""),
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "EDGE_POINTS"	, _TL("Edge Points"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "EDGE_LINES"	, _TL("Edge Segments"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Line
+	);
+
+	Parameters.Add_Value(
+		NULL	, "TMAGNITUDE"	, _TL("Minimum Magnitude"),
+		_TL("Minimum magnitude as percentile."),
+		PARAMETER_TYPE_Double, 90.0, 0.0, true, 100.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "TDIRECTION"	, _TL("Maximum Angle"),
+		_TL("Maximum angular difference as degree between adjacent segment points."),
+		PARAMETER_TYPE_Double, 10.0, 0.0, true, 180.0, true
+	);
+
+	Parameters.Add_Value(
+		NULL	, "GRIDS_SHOW"	, _TL("Output of Grids"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_OUTPUT_OPTIONAL, false
+	);
+
+//	Parameters.Add_Choice(
+//		NULL	, "NEIGHBOUR"	, _TL("Segment Connection"),
+//		_TL(""),
+//		CSG_String::Format(SG_T("%s|%s|"),
+//			_TL("Rooke"),
+//			_TL("Queen")
+//		), 1
+//	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CWombling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWombling::On_Execute(void)
+{
+	//-----------------------------------------------------
+	CSG_Grid_System	System(Get_Cellsize(),
+		Get_XMin() + 0.5 * Get_Cellsize(),
+		Get_YMin() + 0.5 * Get_Cellsize(),
+		Get_NX() - 1, Get_NY() - 1
+	);
+
+	CSG_Grid	*pSlope, *pAspect, Slope, Aspect;
+
+	if( Parameters("GRIDS_SHOW")->asBool() )
+	{
+		CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS")->asGridList();
+
+		if( pGrids->asGrid(0) && pGrids->asGrid(0)->Get_System().is_Equal(System)
+		&&  pGrids->asGrid(1) && pGrids->asGrid(1)->Get_System().is_Equal(System) )
+		{
+			pSlope	= pGrids->asGrid(0);
+			pAspect	= pGrids->asGrid(1);
+		}
+		else
+		{
+			pGrids->Del_Items();
+
+			pGrids->Add_Item(pSlope  = SG_Create_Grid());
+			pGrids->Add_Item(pAspect = SG_Create_Grid());
+		}
+	}
+	else
+	{
+		pSlope	= &Slope;
+		pAspect	= &Aspect;
+	}
+
+	pSlope ->Create(System);
+	pAspect->Create(System);
+
+	pAspect->Set_NoData_Value(-1.0);
+
+	//-----------------------------------------------------
+	Lock_Create();
+
+	Get_Gradient   (pSlope, pAspect);
+	Get_Edge_Points(pSlope, pAspect);
+	Get_Edge_Lines (pSlope, pAspect);
+
+	Lock_Destroy();
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWombling::Get_Edge_Lines(CSG_Grid *pSlope, CSG_Grid *pAspect)
+{
+//	int		Neighbour	= Parameters("NEIGHBOUR" )->asInt();
+	double	Threshold	= Parameters("TDIRECTION")->asDouble() * M_DEG_TO_RAD;
+
+	CSG_Shapes	*pLines	= Parameters("EDGE_LINES")->asShapes();
+
+	pLines->Create(SHAPE_TYPE_Line, CSG_String::Format("%s %s", Parameters("GRID")->asGrid()->Get_Name(), _TL("Edges")));
+	pLines->Add_Field("ID"   , SG_DATATYPE_Int);
+	pLines->Add_Field("ANGLE", SG_DATATYPE_Double);
+
+	for(int y=0; y<Get_NY()-2 && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX()-2; x++)
+		{
+			Get_Edge_Lines(x, y, x + 1, y    , pSlope, pAspect, pLines, Threshold);
+			Get_Edge_Lines(x, y, x    , y + 1, pSlope, pAspect, pLines, Threshold);
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+inline void CWombling::Get_Edge_Lines(int ix, int iy, int jx, int jy, CSG_Grid *pSlope, CSG_Grid *pAspect, CSG_Shapes *pLines, double Threshold)
+{
+	if( !Lock_Get(ix, iy) && !Lock_Get(jx, jy) )
+	{
+		double	i	= pAspect->asDouble(ix, iy);	if( i < 0.0 )	i	+= M_PI_360;	i	= fmod(i, M_PI_360);
+		double	j	= pAspect->asDouble(jx, jy);	if( j < 0.0 )	j	+= M_PI_360;	j	= fmod(j, M_PI_360);
+
+		double	diff	= i > j ? i - j : j - i;
+
+		if( Threshold == 0.0 || diff <= Threshold )
+		{
+			CSG_Shape	*pLine	= pLines->Add_Shape();
+			pLine->Add_Point(pSlope->Get_System().Get_Grid_to_World(ix, iy));
+			pLine->Add_Point(pSlope->Get_System().Get_Grid_to_World(jx, jy));
+			pLine->Set_Value(0, pLines->Get_Count());
+			pLine->Set_Value(1, diff * M_RAD_TO_DEG);
+		}
+	}
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWombling::Get_Edge_Points(CSG_Grid *pSlope, CSG_Grid *pAspect)
+{
+	double	Threshold	= pSlope->Get_Percentile(Parameters("TMAGNITUDE")->asDouble());
+
+	CSG_Shapes	*pPoints	= Parameters("EDGE_POINTS")->asShapes();
+
+	pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format("%s %s", Parameters("GRID")->asGrid()->Get_Name(), _TL("Edges")));
+	pPoints->Add_Field("ID"       , SG_DATATYPE_Int);
+	pPoints->Add_Field("MAGNITUDE", SG_DATATYPE_Double);
+	pPoints->Add_Field("DIRECTION", SG_DATATYPE_Double);
+
+	for(int y=0; y<Get_NY()-1 && Set_Progress(y); y++)
+	{
+		for(int x=0; x<Get_NX()-1; x++)
+		{
+			if( pAspect->is_NoData(x, y) || pSlope->is_NoData(x, y) || pSlope->asDouble(x, y) < Threshold )
+			{
+				Lock_Set(x, y);
+			}
+			else
+			{
+				CSG_Shape	*pPoint	= pPoints->Add_Shape();
+				pPoint->Set_Point(pSlope->Get_System().Get_Grid_to_World(x, y), 0);
+				pPoint->Set_Value(0, pPoints->Get_Count());
+				pPoint->Set_Value(1, pSlope ->asDouble(x, y));
+				pPoint->Set_Value(2, pAspect->asDouble(x, y) * M_RAD_TO_DEG);
+			}
+		}
+	}
+
+	return( pPoints->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CWombling::Get_Gradient(CSG_Grid *pSlope, CSG_Grid *pAspect)
+{
+	CSG_Grid	*pGrid	= Parameters("GRID")->asGrid();
+
+	pSlope ->Set_Name(CSG_String::Format("%s [%s]", pGrid->Get_Name(), _TL("Wombling Magnitude")));
+	pAspect->Set_Name(CSG_String::Format("%s [%s]", pGrid->Get_Name(), _TL("Wombling Direction")));
+
+	for(int y=0; y<Get_NY()-1 && Set_Progress(y); y++)
+	{
+		#pragma omp parallel for
+		for(int x=0; x<Get_NX()-1; x++)
+		{
+			if( pGrid->is_NoData(x    , y    )
+			||  pGrid->is_NoData(x + 1, y    )
+			||  pGrid->is_NoData(x    , y + 1)
+			||  pGrid->is_NoData(x + 1, y + 1) )
+			{
+				pSlope ->Set_NoData(x, y);
+				pAspect->Set_NoData(x, y);
+			}
+			else
+			{
+				double	Slope, Aspect, z[4];
+
+				z[0]	= pGrid->asDouble(x    , y    );
+				z[1]	= pGrid->asDouble(x + 1, y    );
+				z[2]	= pGrid->asDouble(x    , y + 1);
+				z[3]	= pGrid->asDouble(x + 1, y + 1);
+
+				Get_Gradient(z, Slope, Aspect);
+
+				pSlope ->Set_Value(x, y, Slope );
+				pAspect->Set_Value(x, y, Aspect);
+			}
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+inline void CWombling::Get_Gradient(double z[4], double &Slope, double &Aspect)
+{
+	double	a	= (-z[2] + z[3] + z[0] - z[1]) * 0.5 / Get_Cellsize();
+	double	b	= ( z[2] + z[3] - z[0] - z[1]) * 0.5 / Get_Cellsize();
+
+	Slope	= sqrt(a*a + b*b);
+	Aspect	= a != 0.0 ? M_PI_180 + atan2(b, a)
+		: b >  0.0 ? M_PI_270
+		: b <  0.0 ? M_PI_090 : -1;
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_to_kml.h b/src/modules/grid/grid_filter/wombling.h
similarity index 77%
copy from src/modules/io/io_grid_image/grid_to_kml.h
copy to src/modules/grid/grid_filter/wombling.h
index cd444eb..f86187b 100644
--- a/src/modules/io/io_grid_image/grid_to_kml.h
+++ b/src/modules/grid/grid_filter/wombling.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_to_kml.h 2089 2014-04-04 12:37:27Z reklov_w $
+ * Version $Id: wombling.h 1921 2014-01-09 10:24:11Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -9,13 +9,13 @@
 //      System for Automated Geoscientific Analyses      //
 //                                                       //
 //                    Module Library:                    //
-//                     io_grid_image                     //
+//                      Grid_Filter                      //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                     grid_to_kml.h                     //
+//                       wombling.h                      //
 //                                                       //
-//                 Copyright (C) 2014 by                 //
+//                 Copyright (C) 2015 by                 //
 //                      Olaf Conrad                      //
 //                                                       //
 //-------------------------------------------------------//
@@ -54,18 +54,18 @@
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__grid_to_kml_H
-#define HEADER_INCLUDED__grid_to_kml_H
+#ifndef HEADER_INCLUDED__wombling_H
+#define HEADER_INCLUDED__wombling_H
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
@@ -75,17 +75,15 @@
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CGrid_to_KML : public CSG_Module_Grid
+class CWombling : public CSG_Module_Grid
 {
 public:
-	CGrid_to_KML(void);
-
-	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Export") );	}
+	CWombling(void);
 
 
 protected:
@@ -97,15 +95,25 @@ protected:
 
 private:
 
+	double					m_TMagnitude, m_TDirection;
+
+
+	void					Get_Gradient			(double z[4], double &Slope, double &Aspect);
+	bool					Get_Gradient			(CSG_Grid *pSlope, CSG_Grid *pAspect);
+
+	bool					Get_Edge_Points			(CSG_Grid *pSlope, CSG_Grid *pAspect);
+
+	void					Get_Edge_Lines			(int ix, int iy, int jx, int jy, CSG_Grid *pSlope, CSG_Grid *pAspect, CSG_Shapes *pLines, double Threshold);
+	bool					Get_Edge_Lines			(CSG_Grid *pSlope, CSG_Grid *pAspect);
 
 };
 
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__grid_to_kml_H
+#endif // #ifndef HEADER_INCLUDED__wombling_H
diff --git a/src/modules/grid/grid_gridding/Interpolation.cpp b/src/modules/grid/grid_gridding/Interpolation.cpp
index 55aaf17..7784fff 100644
--- a/src/modules/grid/grid_gridding/Interpolation.cpp
+++ b/src/modules/grid/grid_gridding/Interpolation.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Interpolation.cpp 2415 2015-02-18 14:27:34Z oconrad $
+ * Version $Id: Interpolation.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -84,7 +84,7 @@ CInterpolation::CInterpolation(void)
 		_TL("")
 	);
 
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/grid/grid_gridding/Shapes2Grid.cpp b/src/modules/grid/grid_gridding/Shapes2Grid.cpp
index 4b1ce8b..84c1fbd 100644
--- a/src/modules/grid/grid_gridding/Shapes2Grid.cpp
+++ b/src/modules/grid/grid_gridding/Shapes2Grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Shapes2Grid.cpp 2415 2015-02-18 14:27:34Z oconrad $
+ * Version $Id: Shapes2Grid.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -161,8 +161,9 @@ CShapes2Grid::CShapes2Grid(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, false, NULL, "TARGET_");
 
+	m_Grid_Target.Add_Grid("GRID" , _TL("Grid")            , false);
 	m_Grid_Target.Add_Grid("COUNT", _TL("Number of Values"), true);
 }
 
@@ -266,7 +267,7 @@ bool CShapes2Grid::On_Execute(void)
 	//-----------------------------------------------------
 	m_Grid_Target.Cmd_Update(m_pShapes);	// if called from saga_cmd
 
-	if( (m_pGrid = m_Grid_Target.Get_Grid(Get_Grid_Type(Parameters("GRID_TYPE")->asInt()))) == NULL )
+	if( (m_pGrid = m_Grid_Target.Get_Grid("GRID", Get_Grid_Type(Parameters("GRID_TYPE")->asInt()))) == NULL )
 	{
 		return( false );
 	}
@@ -276,7 +277,7 @@ bool CShapes2Grid::On_Execute(void)
 		m_pGrid->Set_NoData_Value(0.0);
 	}
 
-	m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pShapes->Get_Name(), iField < 0 ? _TL("ID") : m_pShapes->Get_Field_Name(iField)));
+	m_pGrid->Set_Name(CSG_String::Format("%s [%s]", m_pShapes->Get_Name(), iField < 0 ? _TL("ID") : m_pShapes->Get_Field_Name(iField)));
 	m_pGrid->Assign_NoData();
 
 	//-------------------------------------------------
@@ -289,7 +290,7 @@ bool CShapes2Grid::On_Execute(void)
 		m_pCount	= &m_Count;
 	}
 
-	m_pCount->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pShapes->Get_Name(), _TL("Count")));
+	m_pCount->Set_Name(CSG_String::Format("%s [%s]", m_pShapes->Get_Name(), _TL("Count")));
 	m_pCount->Set_NoData_Value(0.0);
 	m_pCount->Assign(0.0);
 
diff --git a/src/modules/grid/grid_gridding/kernel_density.cpp b/src/modules/grid/grid_gridding/kernel_density.cpp
index 394b910..5604f14 100644
--- a/src/modules/grid/grid_gridding/kernel_density.cpp
+++ b/src/modules/grid/grid_gridding/kernel_density.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: kernel_density.cpp 2415 2015-02-18 14:27:34Z oconrad $
+ * Version $Id: kernel_density.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -127,7 +127,7 @@ CKernel_Density::CKernel_Density(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp b/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
index 8a2602f..f630e02 100644
--- a/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
+++ b/src/modules/grid/grid_spline/Gridding_Spline_Base.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Gridding_Spline_Base.cpp 2412 2015-02-17 22:18:08Z oconrad $
+ * Version $Id: Gridding_Spline_Base.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -99,7 +99,7 @@ CGridding_Spline_Base::CGridding_Spline_Base(bool bGridPoints)
 	}
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/grid/grid_spline/MBASpline_for_Categories.cpp b/src/modules/grid/grid_spline/MBASpline_for_Categories.cpp
index 65b0d4a..73cfd47 100644
--- a/src/modules/grid/grid_spline/MBASpline_for_Categories.cpp
+++ b/src/modules/grid/grid_spline/MBASpline_for_Categories.cpp
@@ -92,7 +92,7 @@ CMBASpline_for_Categories::CMBASpline_for_Categories(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")), false);
+	m_Grid_Target.Create(&Parameters, false, NULL, "TARGET_");
 
 	m_Grid_Target.Add_Grid("CATEGORIES" , _TL("Categories" ), false);
 	m_Grid_Target.Add_Grid("PROPABILITY", _TL("Propability"), false);
@@ -200,10 +200,10 @@ bool CMBASpline_for_Categories::On_Execute(void)
 		SG_UI_Progress_Lock(true);
 
 		SG_RUN_MODULE_ExitOnError("grid_spline", 4,	// Multilevel B-Spline Interpolation
-				SG_MODULE_PARAMETER_SET("SHAPES"    , &Points)
-			&&	SG_MODULE_PARAMETER_SET("FIELD"     , 1 + i)	// indicator field
-			&&	SG_MODULE_PARAMETER_SET("DEFINITION", 1)		// grid or grid system
-			&&	SG_MODULE_PARAMETER_SET("OUT_GRID"  , &Prop)	// target grid
+				SG_MODULE_PARAMETER_SET("SHAPES"           , &Points)
+			&&	SG_MODULE_PARAMETER_SET("FIELD"            , 1 + i)	// indicator field
+			&&	SG_MODULE_PARAMETER_SET("TARGET_DEFINITION", 1)		// grid or grid system
+			&&	SG_MODULE_PARAMETER_SET("TARGET_OUT_GRID"  , &Prop)	// target grid
 		)
 
 		SG_UI_Progress_Lock(false);
diff --git a/src/modules/grid/grid_tools/Grid_Cut.cpp b/src/modules/grid/grid_tools/Grid_Cut.cpp
index 2b01da9..5d6ea7a 100644
--- a/src/modules/grid/grid_tools/Grid_Cut.cpp
+++ b/src/modules/grid/grid_tools/Grid_Cut.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Cut.cpp 2097 2014-04-11 12:50:55Z oconrad $
+ * Version $Id: Grid_Cut.cpp 2598 2015-09-23 14:12:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -375,7 +375,7 @@ int CGrid_Clip::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter
 
 	Fit_Extent(pParameters, pParameter, pSystem);
 
-	return( 1 );
+	return( CSG_Module_Grid::On_Parameter_Changed(pParameters, pParameter) );
 }
 
 //---------------------------------------------------------
@@ -383,19 +383,19 @@ int CGrid_Clip::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter
 {
 	if( !SG_STR_CMP(pParameter->Get_Identifier(), "EXTENT") )
 	{
-		pParameters->Get_Parameter("XMIN"      )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("XMAX"      )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("YMIN"      )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("YMAX"      )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("NX"        )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("NY"        )->Set_Enabled(pParameter->asInt() == 0);
-		pParameters->Get_Parameter("GRIDSYSTEM")->Set_Enabled(pParameter->asInt() == 1);
-		pParameters->Get_Parameter("SHAPES"    )->Set_Enabled(pParameter->asInt() == 2);
-		pParameters->Get_Parameter("POLYGONS"  )->Set_Enabled(pParameter->asInt() == 3);
-		pParameters->Get_Parameter("BUFFER"    )->Set_Enabled(pParameter->asInt() != 3);	// no buffering for polygon clip
+		pParameters->Set_Enabled("XMIN"      , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("XMAX"      , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("YMIN"      , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("YMAX"      , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("NX"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("NY"        , pParameter->asInt() == 0);
+		pParameters->Set_Enabled("GRIDSYSTEM", pParameter->asInt() == 1);
+		pParameters->Set_Enabled("SHAPES"    , pParameter->asInt() == 2);
+		pParameters->Set_Enabled("POLYGONS"  , pParameter->asInt() == 3);
+		pParameters->Set_Enabled("BUFFER"    , pParameter->asInt() != 3);	// no buffering for polygon clip
 	}
 
-	return( 1 );
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
 }
 
 
diff --git a/src/modules/grid/grid_tools/Grid_Merge.cpp b/src/modules/grid/grid_tools/Grid_Merge.cpp
index 58945ae..bdf5d25 100644
--- a/src/modules/grid/grid_tools/Grid_Merge.cpp
+++ b/src/modules/grid/grid_tools/Grid_Merge.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Merge.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id: Grid_Merge.cpp 2569 2015-09-02 10:42:56Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -148,7 +148,7 @@ CGrid_Merge::CGrid_Merge(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/grid/grid_tools/Grid_Resample.cpp b/src/modules/grid/grid_tools/Grid_Resample.cpp
index 958e3e3..a300b19 100644
--- a/src/modules/grid/grid_tools/Grid_Resample.cpp
+++ b/src/modules/grid/grid_tools/Grid_Resample.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Resample.cpp 2415 2015-02-18 14:27:34Z oconrad $
+ * Version $Id: Grid_Resample.cpp 2571 2015-09-03 14:31:44Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -133,7 +133,7 @@ CGrid_Resample::CGrid_Resample(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")), false);
+	m_Grid_Target.Create(&Parameters, false, NULL, "TARGET_");
 }
 
 
@@ -170,18 +170,18 @@ int CGrid_Resample::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parame
 		{
 			double	Input	= pParameters->Get_Parameter("INPUT")->asGridList()->asGrid(0)->Get_System().Get_Cellsize();
 
-			if( pParameters->Get_Parameter("DEFINITION")->asInt() == 0 )	// user defined
+			if( pParameters->Get_Parameter("TARGET_DEFINITION")->asInt() == 0 )	// user defined
 			{
-				Scaling	= Input - pParameters->Get_Parameter("USER_SIZE")->asDouble();
+				Scaling	= Input - pParameters->Get_Parameter("TARGET_USER_SIZE")->asDouble();
 			}
-			else if( pParameters->Get_Parameter("SYSTEM")->asGrid_System() && pParameters->Get_Parameter("SYSTEM")->asGrid_System()->Get_Cellsize() > 0.0 )
+			else if( pParameters->Get_Parameter("TARGET_SYSTEM")->asGrid_System() && pParameters->Get_Parameter("TARGET_SYSTEM")->asGrid_System()->Get_Cellsize() > 0.0 )
 			{
-				Scaling	= Input - pParameters->Get_Parameter("SYSTEM")->asGrid_System()->Get_Cellsize();
+				Scaling	= Input - pParameters->Get_Parameter("TARGET_SYSTEM")->asGrid_System()->Get_Cellsize();
 			}
 		}
 
-		pParameters->Set_Enabled("SCALE_UP"  , Scaling < 0.0);
-		pParameters->Set_Enabled("SCALE_DOWN", Scaling > 0.0);
+		pParameters->Set_Enabled("SCALE_UP"  , Scaling <  0.0);
+		pParameters->Set_Enabled("SCALE_DOWN", Scaling >= 0.0);
 	}
 
 	return( m_Grid_Target.On_Parameters_Enable(pParameters, pParameter) ? 1 : 0 );
diff --git a/src/modules/grid/grid_tools/Grid_SortRaster.cpp b/src/modules/grid/grid_tools/Grid_SortRaster.cpp
index c3226a0..b5072ab 100644
--- a/src/modules/grid/grid_tools/Grid_SortRaster.cpp
+++ b/src/modules/grid/grid_tools/Grid_SortRaster.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_SortRaster.cpp 2447 2015-03-19 14:43:42Z oconrad $
+ * Version $Id: Grid_SortRaster.cpp 2596 2015-09-23 12:33:11Z oconrad $
  *********************************************************/
 /*******************************************************************************
     SortRaster.cpp
@@ -67,14 +67,10 @@ bool CSortRaster::On_Execute(void)
 
 	CSG_Grid	*pIndex	= Parameters("INDEX")->asGrid();
 
-	bool	bDown	= Parameters("ORDER")->asInt() == 1;
-
-	if( pGrid == pIndex )
-	{
-		pIndex	= SG_Create_Grid(pGrid);
-	}
+	pIndex->Set_NoData_Value(-1.0);
+	pIndex->Assign_NoData();
 
-	pIndex->Set_NoData_Value(0.0);
+	bool	bDown	= Parameters("ORDER")->asInt() == 1;
 
 	for(sLong i=0, Index=0; i<Get_NCells() && Set_Progress_NCells(i); i++)
 	{
@@ -82,19 +78,8 @@ bool CSortRaster::On_Execute(void)
 
 		if( pGrid->Get_Sorted(i, ix, iy, bDown) )
 		{
-			pIndex->Set_Value(ix, iy, ++Index);
+			pIndex->Set_Value(ix, iy, Index++);
 		}
-		else
-		{
-			pIndex->Set_NoData(ix, iy);
-		}
-	}
-
-	if( pGrid == Parameters("INDEX")->asGrid() )
-	{
-		pGrid->Assign(pIndex);
-
-		delete(pIndex);
 	}
 
 	return( true );
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
index 1ad2287..58db38b 100644
--- a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace_Interactive.cpp 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id: Grid_Value_Replace_Interactive.cpp 2574 2015-09-04 12:30:31Z oconrad $
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.cpp
@@ -20,27 +20,46 @@
     Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #include "Grid_Value_Replace_Interactive.h"
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 CGrid_Value_Replace_Interactive::CGrid_Value_Replace_Interactive(void)
 {
-
+	//-----------------------------------------------------
 	Set_Name		(_TL("Change Cell Values"));
-	Set_Author		(_TL("Copyrights (c) 2004 by Victor Olaya"));
-	Set_Description	(_TW("The module allows to interactively change cell values of the input grid. "
-						"Once the module is executed and running, you can use the Action tool to select "
-						"grid cells. While working on a grid, you can change (and apply) the 'New Value' "
-						"and the 'Method' parameters without stopping and re-starting the module.\n\n"
-						));
 
+	Set_Author		("Victor Olaya (c) 2004");
+
+	Set_Description	(_TW(
+		"The module allows to interactively change cell values of the input grid. "
+		"Once the module is executed and running, you can use the Action tool to select "
+		"grid cells. While working on a grid, you can change (and apply) the 'New Value' "
+		"and the 'Method' parameters without stopping and re-starting the module.\n"
+	));
+
+	//-----------------------------------------------------
 	Parameters.Add_Grid(
-		NULL,	"GRID",	_TL("Grid"), 
+		NULL	, "GRID"	, _TL("Grid"), 
 		_TL("The grid to modify."), 
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Value(
-		NULL,	"NEWVALUE",	_TL("New Value"), 
+		NULL	, "VALUE"	, _TL("Value"), 
 		_TL("The value to apply."), 
 		PARAMETER_TYPE_Double, 0.0
 	);
@@ -48,59 +67,118 @@ CGrid_Value_Replace_Interactive::CGrid_Value_Replace_Interactive(void)
 	Parameters.Add_Choice(
 		NULL	, "METHOD"	, _TL("Method"),
 		_TL("Choose how to apply the new value."),
-		CSG_String::Format(SG_T("%s|%s|%s|"),
-			_TL("set constant value"),
-			_TL("add value"),
-			_TL("subtract value")
+		CSG_String::Format("%s|%s|%s|",
+			_TL("set"),
+			_TL("add"),
+			_TL("subtract")
 		), 0
 	);
 
-}//constructor
-
+	Parameters.Add_Value(
+		NULL	, "RADIUS"	, _TL("Radius"), 
+		_TL("Change all values within radius."), 
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
 
-CGrid_Value_Replace_Interactive::~CGrid_Value_Replace_Interactive(void)
-{
-	On_Execute_Finish();
+	//-----------------------------------------------------
+	Set_Drag_Mode(MODULE_INTERACTIVE_DRAG_NONE);
 }
 
 
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CGrid_Value_Replace_Interactive::On_Execute(void)
 {
-	m_pGrid		= Parameters("GRID")->asGrid();
+	m_pGrid		= Parameters("GRID"  )->asGrid  ();
+	m_Value		= Parameters("VALUE" )->asDouble();
+	m_Method	= Parameters("METHOD")->asInt   ();
 
-	return( true );
-}//method
+	m_Kernel.Set_Radius(Parameters("RADIUS")->asDouble());
 
+	return( true );
+}
 
+//---------------------------------------------------------
 bool CGrid_Value_Replace_Interactive::On_Execute_Finish(void)
 {
+	m_Kernel.Destroy();
+
 	return( true );
 }
 
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CGrid_Value_Replace_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
-{	
-	int iX, iY;		
+{
+	switch( Mode )
+	{
+	//-----------------------------------------------------
+	case MODULE_INTERACTIVE_LDOWN:
+	case MODULE_INTERACTIVE_MOVE_LDOWN:
+		{
+			TSG_Point_Int	Point;
+
+			if( !Get_Grid_Pos(Point.x, Point.y) )
+			{
+				return( false );
+			}
+
+			if( Mode == MODULE_INTERACTIVE_LDOWN )
+			{
+				m_Last	= Point;
+			}
+			else if( m_Last.x == Point.x && m_Last.y == Point.y )	// don't do it twice for the same point
+			{
+				return( false );
+			}
+
+			if( m_Kernel.Get_Count() <= 1 )
+			{
+				Set_Value(Point.x, Point.y);
+			}
+			else
+			{
+				for(int i=0; i<m_Kernel.Get_Count(); i++)
+				{
+					Set_Value(m_Kernel.Get_X(i, Point.x), m_Kernel.Get_Y(i, Point.y));
+				}
+			}
+
+			DataObject_Update(m_pGrid, SG_UI_DATAOBJECT_UPDATE_ONLY);
+		}
 
 	//-----------------------------------------------------
-	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iX, iY) )
-	{
-		return( false );
+	default:
+		return( true );
 	}
+}
 
-	double	dNewValue	= Parameters("NEWVALUE")->asDouble();
-	int		iMethod		= Parameters("METHOD")->asInt();
-
-	double	dValue		= m_pGrid->asDouble(iX, iY);
-
-	switch( iMethod )
+//---------------------------------------------------------
+inline void CGrid_Value_Replace_Interactive::Set_Value(int x, int y)
+{
+	if( is_InGrid(x, y) )
 	{
-	default:
-	case 0:				m_pGrid->Set_Value(iX, iY, dNewValue);				break;
-	case 1:				m_pGrid->Set_Value(iX, iY, dValue + dNewValue);		break;
-	case 2:				m_pGrid->Set_Value(iX, iY, dValue - dNewValue);		break;
+		switch( m_Method )
+		{
+		default:	m_pGrid->Set_Value(x, y,  m_Value);	break;
+		case  1:	m_pGrid->Add_Value(x, y,  m_Value);	break;
+		case  2:	m_pGrid->Add_Value(x, y, -m_Value);	break;
+		}
 	}
+}
 
-	DataObject_Update(m_pGrid, SG_UI_DATAOBJECT_UPDATE_ONLY);
 
-	return( true );
-}//method
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
index 5b1ee54..03eed64 100644
--- a/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
+++ b/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Grid_Value_Replace_Interactive.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id: Grid_Value_Replace_Interactive.h 2574 2015-09-04 12:30:31Z oconrad $
  *********************************************************/
 /*******************************************************************************
     Grid_Value_Replace_Interactive.h
@@ -20,31 +20,73 @@
     Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
 *******************************************************************************/ 
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #ifndef HEADER_INCLUDED__Grid_Value_Replace_Interactive_H
 #define HEADER_INCLUDED__Grid_Value_Replace_Interactive_H
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
 //---------------------------------------------------------
 #include "MLB_Interface.h"
 
-//---------------------------------------------------------
-class CGrid_Value_Replace_Interactive : public CSG_Module_Grid_Interactive {
 
-private:
-	CSG_Grid	*m_pGrid;
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
 
+//---------------------------------------------------------
+class CGrid_Value_Replace_Interactive : public CSG_Module_Grid_Interactive
+{
 public:
 	CGrid_Value_Replace_Interactive(void);
-	virtual ~CGrid_Value_Replace_Interactive(void);
 
-	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("A:Grid|Values") );	}
+	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("A:Grid|Values") );	}
 
 
 protected:
-	virtual bool On_Execute(void);
-	virtual bool On_Execute_Finish(void);
-	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+	virtual bool			On_Execute			(void);
+	virtual bool			On_Execute_Finish	(void);
+	virtual bool			On_Execute_Position	(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+
+private:
+
+	int						m_Method;
+
+	double					m_Value;
+
+	TSG_Point_Int			m_Last;
+
+	CSG_Grid				*m_pGrid;
+
+	CSG_Grid_Cell_Addressor	m_Kernel;
+
+
+	void					Set_Value			(int x, int y);
 
 };
 
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 #endif // #ifndef HEADER_INCLUDED__Grid_Value_Replace_Interactive_H
diff --git a/src/modules/imagery/imagery_opencv/opencv_nnet.cpp b/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
index f123d16..f5cbf3c 100644
--- a/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
+++ b/src/modules/imagery/imagery_opencv/opencv_nnet.cpp
@@ -60,8 +60,8 @@
 
 //---------------------------------------------------------
 #include "opencv_nnet.h"
-#include "opencv\cxcore.h"
-#include "opencv\ml.h"
+#include <opencv/cxcore.h>
+#include <opencv/ml.h>
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/modules/imagery/imagery_opencv/opencv_nnet.h b/src/modules/imagery/imagery_opencv/opencv_nnet.h
index ed22567..276530b 100644
--- a/src/modules/imagery/imagery_opencv/opencv_nnet.h
+++ b/src/modules/imagery/imagery_opencv/opencv_nnet.h
@@ -64,8 +64,8 @@
 
 //---------------------------------------------------------
 #include "MLB_Interface.h"
-#include "opencv\cxcore.h"
-#include "opencv\ml.h"
+#include <opencv/cxcore.h>
+#include <opencv/ml.h>
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/modules/imagery/imagery_svm/svm.cpp b/src/modules/imagery/imagery_svm/svm.cpp
deleted file mode 100644
index 1ecb291..0000000
--- a/src/modules/imagery/imagery_svm/svm.cpp
+++ /dev/null
@@ -1,3089 +0,0 @@
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <float.h>
-#include <string.h>
-#include <stdarg.h>
-#include <limits.h>
-#include "svm.h"
-int libsvm_version = LIBSVM_VERSION;
-typedef float Qfloat;
-typedef signed char schar;
-#ifndef min
-template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
-#endif
-#ifndef max
-template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
-#endif
-template <class T> static inline void swap(T& x, T& y) { T t=x; x=y; y=t; }
-template <class S, class T> static inline void clone(T*& dst, S* src, int n)
-{
-	dst = new T[n];
-	memcpy((void *)dst,(void *)src,sizeof(T)*n);
-}
-static inline double powi(double base, int times)
-{
-	double tmp = base, ret = 1.0;
-
-	for(int t=times; t>0; t/=2)
-	{
-		if(t%2==1) ret*=tmp;
-		tmp = tmp * tmp;
-	}
-	return ret;
-}
-#define INF HUGE_VAL
-#define TAU 1e-12
-#define Malloc(type,n) (type *)malloc((n)*sizeof(type))
-
-static void print_string_stdout(const char *s)
-{
-	fputs(s,stdout);
-	fflush(stdout);
-}
-static void (*svm_print_string) (const char *) = &print_string_stdout;
-#if 1
-static void info(const char *fmt,...)
-{
-	char buf[BUFSIZ];
-	va_list ap;
-	va_start(ap,fmt);
-	vsprintf(buf,fmt,ap);
-	va_end(ap);
-	(*svm_print_string)(buf);
-}
-#else
-static void info(const char *fmt,...) {}
-#endif
-
-//
-// Kernel Cache
-//
-// l is the number of total data items
-// size is the cache size limit in bytes
-//
-class Cache
-{
-public:
-	Cache(int l,long int size);
-	~Cache();
-
-	// request data [0,len)
-	// return some position p where [p,len) need to be filled
-	// (p >= len if nothing needs to be filled)
-	int get_data(const int index, Qfloat **data, int len);
-	void swap_index(int i, int j);	
-private:
-	int l;
-	long int size;
-	struct head_t
-	{
-		head_t *prev, *next;	// a circular list
-		Qfloat *data;
-		int len;		// data[0,len) is cached in this entry
-	};
-
-	head_t *head;
-	head_t lru_head;
-	void lru_delete(head_t *h);
-	void lru_insert(head_t *h);
-};
-
-Cache::Cache(int l_,long int size_):l(l_),size(size_)
-{
-	head = (head_t *)calloc(l,sizeof(head_t));	// initialized to 0
-	size /= sizeof(Qfloat);
-	size -= l * sizeof(head_t) / sizeof(Qfloat);
-	size = max(size, 2 * (long int) l);	// cache must be large enough for two columns
-	lru_head.next = lru_head.prev = &lru_head;
-}
-
-Cache::~Cache()
-{
-	for(head_t *h = lru_head.next; h != &lru_head; h=h->next)
-		free(h->data);
-	free(head);
-}
-
-void Cache::lru_delete(head_t *h)
-{
-	// delete from current location
-	h->prev->next = h->next;
-	h->next->prev = h->prev;
-}
-
-void Cache::lru_insert(head_t *h)
-{
-	// insert to last position
-	h->next = &lru_head;
-	h->prev = lru_head.prev;
-	h->prev->next = h;
-	h->next->prev = h;
-}
-
-int Cache::get_data(const int index, Qfloat **data, int len)
-{
-	head_t *h = &head[index];
-	if(h->len) lru_delete(h);
-	int more = len - h->len;
-
-	if(more > 0)
-	{
-		// free old space
-		while(size < more)
-		{
-			head_t *old = lru_head.next;
-			lru_delete(old);
-			free(old->data);
-			size += old->len;
-			old->data = 0;
-			old->len = 0;
-		}
-
-		// allocate new space
-		h->data = (Qfloat *)realloc(h->data,sizeof(Qfloat)*len);
-		size -= more;
-		swap(h->len,len);
-	}
-
-	lru_insert(h);
-	*data = h->data;
-	return len;
-}
-
-void Cache::swap_index(int i, int j)
-{
-	if(i==j) return;
-
-	if(head[i].len) lru_delete(&head[i]);
-	if(head[j].len) lru_delete(&head[j]);
-	swap(head[i].data,head[j].data);
-	swap(head[i].len,head[j].len);
-	if(head[i].len) lru_insert(&head[i]);
-	if(head[j].len) lru_insert(&head[j]);
-
-	if(i>j) swap(i,j);
-	for(head_t *h = lru_head.next; h!=&lru_head; h=h->next)
-	{
-		if(h->len > i)
-		{
-			if(h->len > j)
-				swap(h->data[i],h->data[j]);
-			else
-			{
-				// give up
-				lru_delete(h);
-				free(h->data);
-				size += h->len;
-				h->data = 0;
-				h->len = 0;
-			}
-		}
-	}
-}
-
-//
-// Kernel evaluation
-//
-// the static method k_function is for doing single kernel evaluation
-// the constructor of Kernel prepares to calculate the l*l kernel matrix
-// the member function get_Q is for getting one column from the Q Matrix
-//
-class QMatrix {
-public:
-	virtual Qfloat *get_Q(int column, int len) const = 0;
-	virtual double *get_QD() const = 0;
-	virtual void swap_index(int i, int j) const = 0;
-	virtual ~QMatrix() {}
-};
-
-class Kernel: public QMatrix {
-public:
-	Kernel(int l, svm_node * const * x, const svm_parameter& param);
-	virtual ~Kernel();
-
-	static double k_function(const svm_node *x, const svm_node *y,
-				 const svm_parameter& param);
-	virtual Qfloat *get_Q(int column, int len) const = 0;
-	virtual double *get_QD() const = 0;
-	virtual void swap_index(int i, int j) const	// no so const...
-	{
-		swap(x[i],x[j]);
-		if(x_square) swap(x_square[i],x_square[j]);
-	}
-protected:
-
-	double (Kernel::*kernel_function)(int i, int j) const;
-
-private:
-	const svm_node **x;
-	double *x_square;
-
-	// svm_parameter
-	const int kernel_type;
-	const int degree;
-	const double gamma;
-	const double coef0;
-
-	static double dot(const svm_node *px, const svm_node *py);
-	double kernel_linear(int i, int j) const
-	{
-		return dot(x[i],x[j]);
-	}
-	double kernel_poly(int i, int j) const
-	{
-		return powi(gamma*dot(x[i],x[j])+coef0,degree);
-	}
-	double kernel_rbf(int i, int j) const
-	{
-		return exp(-gamma*(x_square[i]+x_square[j]-2*dot(x[i],x[j])));
-	}
-	double kernel_sigmoid(int i, int j) const
-	{
-		return tanh(gamma*dot(x[i],x[j])+coef0);
-	}
-	double kernel_precomputed(int i, int j) const
-	{
-		return x[i][(int)(x[j][0].value)].value;
-	}
-};
-
-Kernel::Kernel(int l, svm_node * const * x_, const svm_parameter& param)
-:kernel_type(param.kernel_type), degree(param.degree),
- gamma(param.gamma), coef0(param.coef0)
-{
-	switch(kernel_type)
-	{
-		case LINEAR:
-			kernel_function = &Kernel::kernel_linear;
-			break;
-		case POLY:
-			kernel_function = &Kernel::kernel_poly;
-			break;
-		case RBF:
-			kernel_function = &Kernel::kernel_rbf;
-			break;
-		case SIGMOID:
-			kernel_function = &Kernel::kernel_sigmoid;
-			break;
-		case PRECOMPUTED:
-			kernel_function = &Kernel::kernel_precomputed;
-			break;
-	}
-
-	clone(x,x_,l);
-
-	if(kernel_type == RBF)
-	{
-		x_square = new double[l];
-		for(int i=0;i<l;i++)
-			x_square[i] = dot(x[i],x[i]);
-	}
-	else
-		x_square = 0;
-}
-
-Kernel::~Kernel()
-{
-	delete[] x;
-	delete[] x_square;
-}
-
-double Kernel::dot(const svm_node *px, const svm_node *py)
-{
-	double sum = 0;
-	while(px->index != -1 && py->index != -1)
-	{
-		if(px->index == py->index)
-		{
-			sum += px->value * py->value;
-			++px;
-			++py;
-		}
-		else
-		{
-			if(px->index > py->index)
-				++py;
-			else
-				++px;
-		}			
-	}
-	return sum;
-}
-
-double Kernel::k_function(const svm_node *x, const svm_node *y,
-			  const svm_parameter& param)
-{
-	switch(param.kernel_type)
-	{
-		case LINEAR:
-			return dot(x,y);
-		case POLY:
-			return powi(param.gamma*dot(x,y)+param.coef0,param.degree);
-		case RBF:
-		{
-			double sum = 0;
-			while(x->index != -1 && y->index !=-1)
-			{
-				if(x->index == y->index)
-				{
-					double d = x->value - y->value;
-					sum += d*d;
-					++x;
-					++y;
-				}
-				else
-				{
-					if(x->index > y->index)
-					{	
-						sum += y->value * y->value;
-						++y;
-					}
-					else
-					{
-						sum += x->value * x->value;
-						++x;
-					}
-				}
-			}
-
-			while(x->index != -1)
-			{
-				sum += x->value * x->value;
-				++x;
-			}
-
-			while(y->index != -1)
-			{
-				sum += y->value * y->value;
-				++y;
-			}
-			
-			return exp(-param.gamma*sum);
-		}
-		case SIGMOID:
-			return tanh(param.gamma*dot(x,y)+param.coef0);
-		case PRECOMPUTED:  //x: test (validation), y: SV
-			return x[(int)(y->value)].value;
-		default:
-			return 0;  // Unreachable 
-	}
-}
-
-// An SMO algorithm in Fan et al., JMLR 6(2005), p. 1889--1918
-// Solves:
-//
-//	min 0.5(\alpha^T Q \alpha) + p^T \alpha
-//
-//		y^T \alpha = \delta
-//		y_i = +1 or -1
-//		0 <= alpha_i <= Cp for y_i = 1
-//		0 <= alpha_i <= Cn for y_i = -1
-//
-// Given:
-//
-//	Q, p, y, Cp, Cn, and an initial feasible point \alpha
-//	l is the size of vectors and matrices
-//	eps is the stopping tolerance
-//
-// solution will be put in \alpha, objective value will be put in obj
-//
-class Solver {
-public:
-	Solver() {};
-	virtual ~Solver() {};
-
-	struct SolutionInfo {
-		double obj;
-		double rho;
-		double upper_bound_p;
-		double upper_bound_n;
-		double r;	// for Solver_NU
-	};
-
-	void Solve(int l, const QMatrix& Q, const double *p_, const schar *y_,
-		   double *alpha_, double Cp, double Cn, double eps,
-		   SolutionInfo* si, int shrinking);
-protected:
-	int active_size;
-	schar *y;
-	double *G;		// gradient of objective function
-	enum { LOWER_BOUND, UPPER_BOUND, FREE };
-	char *alpha_status;	// LOWER_BOUND, UPPER_BOUND, FREE
-	double *alpha;
-	const QMatrix *Q;
-	const double *QD;
-	double eps;
-	double Cp,Cn;
-	double *p;
-	int *active_set;
-	double *G_bar;		// gradient, if we treat free variables as 0
-	int l;
-	bool unshrink;	// XXX
-
-	double get_C(int i)
-	{
-		return (y[i] > 0)? Cp : Cn;
-	}
-	void update_alpha_status(int i)
-	{
-		if(alpha[i] >= get_C(i))
-			alpha_status[i] = UPPER_BOUND;
-		else if(alpha[i] <= 0)
-			alpha_status[i] = LOWER_BOUND;
-		else alpha_status[i] = FREE;
-	}
-	bool is_upper_bound(int i) { return alpha_status[i] == UPPER_BOUND; }
-	bool is_lower_bound(int i) { return alpha_status[i] == LOWER_BOUND; }
-	bool is_free(int i) { return alpha_status[i] == FREE; }
-	void swap_index(int i, int j);
-	void reconstruct_gradient();
-	virtual int select_working_set(int &i, int &j);
-	virtual double calculate_rho();
-	virtual void do_shrinking();
-private:
-	bool be_shrunk(int i, double Gmax1, double Gmax2);	
-};
-
-void Solver::swap_index(int i, int j)
-{
-	Q->swap_index(i,j);
-	swap(y[i],y[j]);
-	swap(G[i],G[j]);
-	swap(alpha_status[i],alpha_status[j]);
-	swap(alpha[i],alpha[j]);
-	swap(p[i],p[j]);
-	swap(active_set[i],active_set[j]);
-	swap(G_bar[i],G_bar[j]);
-}
-
-void Solver::reconstruct_gradient()
-{
-	// reconstruct inactive elements of G from G_bar and free variables
-
-	if(active_size == l) return;
-
-	int i,j;
-	int nr_free = 0;
-
-	for(j=active_size;j<l;j++)
-		G[j] = G_bar[j] + p[j];
-
-	for(j=0;j<active_size;j++)
-		if(is_free(j))
-			nr_free++;
-
-	if(2*nr_free < active_size)
-		info("\nWARNING: using -h 0 may be faster\n");
-
-	if (nr_free*l > 2*active_size*(l-active_size))
-	{
-		for(i=active_size;i<l;i++)
-		{
-			const Qfloat *Q_i = Q->get_Q(i,active_size);
-			for(j=0;j<active_size;j++)
-				if(is_free(j))
-					G[i] += alpha[j] * Q_i[j];
-		}
-	}
-	else
-	{
-		for(i=0;i<active_size;i++)
-			if(is_free(i))
-			{
-				const Qfloat *Q_i = Q->get_Q(i,l);
-				double alpha_i = alpha[i];
-				for(j=active_size;j<l;j++)
-					G[j] += alpha_i * Q_i[j];
-			}
-	}
-}
-
-void Solver::Solve(int l, const QMatrix& Q, const double *p_, const schar *y_,
-		   double *alpha_, double Cp, double Cn, double eps,
-		   SolutionInfo* si, int shrinking)
-{
-	this->l = l;
-	this->Q = &Q;
-	QD=Q.get_QD();
-	clone(p, p_,l);
-	clone(y, y_,l);
-	clone(alpha,alpha_,l);
-	this->Cp = Cp;
-	this->Cn = Cn;
-	this->eps = eps;
-	unshrink = false;
-
-	// initialize alpha_status
-	{
-		alpha_status = new char[l];
-		for(int i=0;i<l;i++)
-			update_alpha_status(i);
-	}
-
-	// initialize active set (for shrinking)
-	{
-		active_set = new int[l];
-		for(int i=0;i<l;i++)
-			active_set[i] = i;
-		active_size = l;
-	}
-
-	// initialize gradient
-	{
-		G = new double[l];
-		G_bar = new double[l];
-		int i;
-		for(i=0;i<l;i++)
-		{
-			G[i] = p[i];
-			G_bar[i] = 0;
-		}
-		for(i=0;i<l;i++)
-			if(!is_lower_bound(i))
-			{
-				const Qfloat *Q_i = Q.get_Q(i,l);
-				double alpha_i = alpha[i];
-				int j;
-				for(j=0;j<l;j++)
-					G[j] += alpha_i*Q_i[j];
-				if(is_upper_bound(i))
-					for(j=0;j<l;j++)
-						G_bar[j] += get_C(i) * Q_i[j];
-			}
-	}
-
-	// optimization step
-
-	int iter = 0;
-	int max_iter = max(10000000, l>INT_MAX/100 ? INT_MAX : 100*l);
-	int counter = min(l,1000)+1;
-	
-	while(iter < max_iter)
-	{
-		// show progress and do shrinking
-
-		if(--counter == 0)
-		{
-			counter = min(l,1000);
-			if(shrinking) do_shrinking();
-			info(".");
-		}
-
-		int i,j;
-		if(select_working_set(i,j)!=0)
-		{
-			// reconstruct the whole gradient
-			reconstruct_gradient();
-			// reset active set size and check
-			active_size = l;
-			info("*");
-			if(select_working_set(i,j)!=0)
-				break;
-			else
-				counter = 1;	// do shrinking next iteration
-		}
-		
-		++iter;
-
-		// update alpha[i] and alpha[j], handle bounds carefully
-		
-		const Qfloat *Q_i = Q.get_Q(i,active_size);
-		const Qfloat *Q_j = Q.get_Q(j,active_size);
-
-		double C_i = get_C(i);
-		double C_j = get_C(j);
-
-		double old_alpha_i = alpha[i];
-		double old_alpha_j = alpha[j];
-
-		if(y[i]!=y[j])
-		{
-			double quad_coef = QD[i]+QD[j]+2*Q_i[j];
-			if (quad_coef <= 0)
-				quad_coef = TAU;
-			double delta = (-G[i]-G[j])/quad_coef;
-			double diff = alpha[i] - alpha[j];
-			alpha[i] += delta;
-			alpha[j] += delta;
-			
-			if(diff > 0)
-			{
-				if(alpha[j] < 0)
-				{
-					alpha[j] = 0;
-					alpha[i] = diff;
-				}
-			}
-			else
-			{
-				if(alpha[i] < 0)
-				{
-					alpha[i] = 0;
-					alpha[j] = -diff;
-				}
-			}
-			if(diff > C_i - C_j)
-			{
-				if(alpha[i] > C_i)
-				{
-					alpha[i] = C_i;
-					alpha[j] = C_i - diff;
-				}
-			}
-			else
-			{
-				if(alpha[j] > C_j)
-				{
-					alpha[j] = C_j;
-					alpha[i] = C_j + diff;
-				}
-			}
-		}
-		else
-		{
-			double quad_coef = QD[i]+QD[j]-2*Q_i[j];
-			if (quad_coef <= 0)
-				quad_coef = TAU;
-			double delta = (G[i]-G[j])/quad_coef;
-			double sum = alpha[i] + alpha[j];
-			alpha[i] -= delta;
-			alpha[j] += delta;
-
-			if(sum > C_i)
-			{
-				if(alpha[i] > C_i)
-				{
-					alpha[i] = C_i;
-					alpha[j] = sum - C_i;
-				}
-			}
-			else
-			{
-				if(alpha[j] < 0)
-				{
-					alpha[j] = 0;
-					alpha[i] = sum;
-				}
-			}
-			if(sum > C_j)
-			{
-				if(alpha[j] > C_j)
-				{
-					alpha[j] = C_j;
-					alpha[i] = sum - C_j;
-				}
-			}
-			else
-			{
-				if(alpha[i] < 0)
-				{
-					alpha[i] = 0;
-					alpha[j] = sum;
-				}
-			}
-		}
-
-		// update G
-
-		double delta_alpha_i = alpha[i] - old_alpha_i;
-		double delta_alpha_j = alpha[j] - old_alpha_j;
-		
-		for(int k=0;k<active_size;k++)
-		{
-			G[k] += Q_i[k]*delta_alpha_i + Q_j[k]*delta_alpha_j;
-		}
-
-		// update alpha_status and G_bar
-
-		{
-			bool ui = is_upper_bound(i);
-			bool uj = is_upper_bound(j);
-			update_alpha_status(i);
-			update_alpha_status(j);
-			int k;
-			if(ui != is_upper_bound(i))
-			{
-				Q_i = Q.get_Q(i,l);
-				if(ui)
-					for(k=0;k<l;k++)
-						G_bar[k] -= C_i * Q_i[k];
-				else
-					for(k=0;k<l;k++)
-						G_bar[k] += C_i * Q_i[k];
-			}
-
-			if(uj != is_upper_bound(j))
-			{
-				Q_j = Q.get_Q(j,l);
-				if(uj)
-					for(k=0;k<l;k++)
-						G_bar[k] -= C_j * Q_j[k];
-				else
-					for(k=0;k<l;k++)
-						G_bar[k] += C_j * Q_j[k];
-			}
-		}
-	}
-
-	if(iter >= max_iter)
-	{
-		if(active_size < l)
-		{
-			// reconstruct the whole gradient to calculate objective value
-			reconstruct_gradient();
-			active_size = l;
-			info("*");
-		}
-		info("\nWARNING: reaching max number of iterations");
-	}
-
-	// calculate rho
-
-	si->rho = calculate_rho();
-
-	// calculate objective value
-	{
-		double v = 0;
-		int i;
-		for(i=0;i<l;i++)
-			v += alpha[i] * (G[i] + p[i]);
-
-		si->obj = v/2;
-	}
-
-	// put back the solution
-	{
-		for(int i=0;i<l;i++)
-			alpha_[active_set[i]] = alpha[i];
-	}
-
-	// juggle everything back
-	/*{
-		for(int i=0;i<l;i++)
-			while(active_set[i] != i)
-				swap_index(i,active_set[i]);
-				// or Q.swap_index(i,active_set[i]);
-	}*/
-
-	si->upper_bound_p = Cp;
-	si->upper_bound_n = Cn;
-
-	info("\noptimization finished, #iter = %d\n",iter);
-
-	delete[] p;
-	delete[] y;
-	delete[] alpha;
-	delete[] alpha_status;
-	delete[] active_set;
-	delete[] G;
-	delete[] G_bar;
-}
-
-// return 1 if already optimal, return 0 otherwise
-int Solver::select_working_set(int &out_i, int &out_j)
-{
-	// return i,j such that
-	// i: maximizes -y_i * grad(f)_i, i in I_up(\alpha)
-	// j: minimizes the decrease of obj value
-	//    (if quadratic coefficeint <= 0, replace it with tau)
-	//    -y_j*grad(f)_j < -y_i*grad(f)_i, j in I_low(\alpha)
-	
-	double Gmax = -INF;
-	double Gmax2 = -INF;
-	int Gmax_idx = -1;
-	int Gmin_idx = -1;
-	double obj_diff_min = INF;
-
-	for(int t=0;t<active_size;t++)
-		if(y[t]==+1)	
-		{
-			if(!is_upper_bound(t))
-				if(-G[t] >= Gmax)
-				{
-					Gmax = -G[t];
-					Gmax_idx = t;
-				}
-		}
-		else
-		{
-			if(!is_lower_bound(t))
-				if(G[t] >= Gmax)
-				{
-					Gmax = G[t];
-					Gmax_idx = t;
-				}
-		}
-
-	int i = Gmax_idx;
-	const Qfloat *Q_i = NULL;
-	if(i != -1) // NULL Q_i not accessed: Gmax=-INF if i=-1
-		Q_i = Q->get_Q(i,active_size);
-
-	for(int j=0;j<active_size;j++)
-	{
-		if(y[j]==+1)
-		{
-			if (!is_lower_bound(j))
-			{
-				double grad_diff=Gmax+G[j];
-				if (G[j] >= Gmax2)
-					Gmax2 = G[j];
-				if (grad_diff > 0)
-				{
-					double obj_diff; 
-					double quad_coef = QD[i]+QD[j]-2.0*y[i]*Q_i[j];
-					if (quad_coef > 0)
-						obj_diff = -(grad_diff*grad_diff)/quad_coef;
-					else
-						obj_diff = -(grad_diff*grad_diff)/TAU;
-
-					if (obj_diff <= obj_diff_min)
-					{
-						Gmin_idx=j;
-						obj_diff_min = obj_diff;
-					}
-				}
-			}
-		}
-		else
-		{
-			if (!is_upper_bound(j))
-			{
-				double grad_diff= Gmax-G[j];
-				if (-G[j] >= Gmax2)
-					Gmax2 = -G[j];
-				if (grad_diff > 0)
-				{
-					double obj_diff; 
-					double quad_coef = QD[i]+QD[j]+2.0*y[i]*Q_i[j];
-					if (quad_coef > 0)
-						obj_diff = -(grad_diff*grad_diff)/quad_coef;
-					else
-						obj_diff = -(grad_diff*grad_diff)/TAU;
-
-					if (obj_diff <= obj_diff_min)
-					{
-						Gmin_idx=j;
-						obj_diff_min = obj_diff;
-					}
-				}
-			}
-		}
-	}
-
-	if(Gmax+Gmax2 < eps)
-		return 1;
-
-	out_i = Gmax_idx;
-	out_j = Gmin_idx;
-	return 0;
-}
-
-bool Solver::be_shrunk(int i, double Gmax1, double Gmax2)
-{
-	if(is_upper_bound(i))
-	{
-		if(y[i]==+1)
-			return(-G[i] > Gmax1);
-		else
-			return(-G[i] > Gmax2);
-	}
-	else if(is_lower_bound(i))
-	{
-		if(y[i]==+1)
-			return(G[i] > Gmax2);
-		else	
-			return(G[i] > Gmax1);
-	}
-	else
-		return(false);
-}
-
-void Solver::do_shrinking()
-{
-	int i;
-	double Gmax1 = -INF;		// max { -y_i * grad(f)_i | i in I_up(\alpha) }
-	double Gmax2 = -INF;		// max { y_i * grad(f)_i | i in I_low(\alpha) }
-
-	// find maximal violating pair first
-	for(i=0;i<active_size;i++)
-	{
-		if(y[i]==+1)	
-		{
-			if(!is_upper_bound(i))	
-			{
-				if(-G[i] >= Gmax1)
-					Gmax1 = -G[i];
-			}
-			if(!is_lower_bound(i))	
-			{
-				if(G[i] >= Gmax2)
-					Gmax2 = G[i];
-			}
-		}
-		else	
-		{
-			if(!is_upper_bound(i))	
-			{
-				if(-G[i] >= Gmax2)
-					Gmax2 = -G[i];
-			}
-			if(!is_lower_bound(i))	
-			{
-				if(G[i] >= Gmax1)
-					Gmax1 = G[i];
-			}
-		}
-	}
-
-	if(unshrink == false && Gmax1 + Gmax2 <= eps*10) 
-	{
-		unshrink = true;
-		reconstruct_gradient();
-		active_size = l;
-		info("*");
-	}
-
-	for(i=0;i<active_size;i++)
-		if (be_shrunk(i, Gmax1, Gmax2))
-		{
-			active_size--;
-			while (active_size > i)
-			{
-				if (!be_shrunk(active_size, Gmax1, Gmax2))
-				{
-					swap_index(i,active_size);
-					break;
-				}
-				active_size--;
-			}
-		}
-}
-
-double Solver::calculate_rho()
-{
-	double r;
-	int nr_free = 0;
-	double ub = INF, lb = -INF, sum_free = 0;
-	for(int i=0;i<active_size;i++)
-	{
-		double yG = y[i]*G[i];
-
-		if(is_upper_bound(i))
-		{
-			if(y[i]==-1)
-				ub = min(ub,yG);
-			else
-				lb = max(lb,yG);
-		}
-		else if(is_lower_bound(i))
-		{
-			if(y[i]==+1)
-				ub = min(ub,yG);
-			else
-				lb = max(lb,yG);
-		}
-		else
-		{
-			++nr_free;
-			sum_free += yG;
-		}
-	}
-
-	if(nr_free>0)
-		r = sum_free/nr_free;
-	else
-		r = (ub+lb)/2;
-
-	return r;
-}
-
-//
-// Solver for nu-svm classification and regression
-//
-// additional constraint: e^T \alpha = constant
-//
-class Solver_NU : public Solver
-{
-public:
-	Solver_NU() {}
-	void Solve(int l, const QMatrix& Q, const double *p, const schar *y,
-		   double *alpha, double Cp, double Cn, double eps,
-		   SolutionInfo* si, int shrinking)
-	{
-		this->si = si;
-		Solver::Solve(l,Q,p,y,alpha,Cp,Cn,eps,si,shrinking);
-	}
-private:
-	SolutionInfo *si;
-	int select_working_set(int &i, int &j);
-	double calculate_rho();
-	bool be_shrunk(int i, double Gmax1, double Gmax2, double Gmax3, double Gmax4);
-	void do_shrinking();
-};
-
-// return 1 if already optimal, return 0 otherwise
-int Solver_NU::select_working_set(int &out_i, int &out_j)
-{
-	// return i,j such that y_i = y_j and
-	// i: maximizes -y_i * grad(f)_i, i in I_up(\alpha)
-	// j: minimizes the decrease of obj value
-	//    (if quadratic coefficeint <= 0, replace it with tau)
-	//    -y_j*grad(f)_j < -y_i*grad(f)_i, j in I_low(\alpha)
-
-	double Gmaxp = -INF;
-	double Gmaxp2 = -INF;
-	int Gmaxp_idx = -1;
-
-	double Gmaxn = -INF;
-	double Gmaxn2 = -INF;
-	int Gmaxn_idx = -1;
-
-	int Gmin_idx = -1;
-	double obj_diff_min = INF;
-
-	for(int t=0;t<active_size;t++)
-		if(y[t]==+1)
-		{
-			if(!is_upper_bound(t))
-				if(-G[t] >= Gmaxp)
-				{
-					Gmaxp = -G[t];
-					Gmaxp_idx = t;
-				}
-		}
-		else
-		{
-			if(!is_lower_bound(t))
-				if(G[t] >= Gmaxn)
-				{
-					Gmaxn = G[t];
-					Gmaxn_idx = t;
-				}
-		}
-
-	int ip = Gmaxp_idx;
-	int in = Gmaxn_idx;
-	const Qfloat *Q_ip = NULL;
-	const Qfloat *Q_in = NULL;
-	if(ip != -1) // NULL Q_ip not accessed: Gmaxp=-INF if ip=-1
-		Q_ip = Q->get_Q(ip,active_size);
-	if(in != -1)
-		Q_in = Q->get_Q(in,active_size);
-
-	for(int j=0;j<active_size;j++)
-	{
-		if(y[j]==+1)
-		{
-			if (!is_lower_bound(j))	
-			{
-				double grad_diff=Gmaxp+G[j];
-				if (G[j] >= Gmaxp2)
-					Gmaxp2 = G[j];
-				if (grad_diff > 0)
-				{
-					double obj_diff; 
-					double quad_coef = QD[ip]+QD[j]-2*Q_ip[j];
-					if (quad_coef > 0)
-						obj_diff = -(grad_diff*grad_diff)/quad_coef;
-					else
-						obj_diff = -(grad_diff*grad_diff)/TAU;
-
-					if (obj_diff <= obj_diff_min)
-					{
-						Gmin_idx=j;
-						obj_diff_min = obj_diff;
-					}
-				}
-			}
-		}
-		else
-		{
-			if (!is_upper_bound(j))
-			{
-				double grad_diff=Gmaxn-G[j];
-				if (-G[j] >= Gmaxn2)
-					Gmaxn2 = -G[j];
-				if (grad_diff > 0)
-				{
-					double obj_diff; 
-					double quad_coef = QD[in]+QD[j]-2*Q_in[j];
-					if (quad_coef > 0)
-						obj_diff = -(grad_diff*grad_diff)/quad_coef;
-					else
-						obj_diff = -(grad_diff*grad_diff)/TAU;
-
-					if (obj_diff <= obj_diff_min)
-					{
-						Gmin_idx=j;
-						obj_diff_min = obj_diff;
-					}
-				}
-			}
-		}
-	}
-
-	if(max(Gmaxp+Gmaxp2,Gmaxn+Gmaxn2) < eps)
-		return 1;
-
-	if (y[Gmin_idx] == +1)
-		out_i = Gmaxp_idx;
-	else
-		out_i = Gmaxn_idx;
-	out_j = Gmin_idx;
-
-	return 0;
-}
-
-bool Solver_NU::be_shrunk(int i, double Gmax1, double Gmax2, double Gmax3, double Gmax4)
-{
-	if(is_upper_bound(i))
-	{
-		if(y[i]==+1)
-			return(-G[i] > Gmax1);
-		else	
-			return(-G[i] > Gmax4);
-	}
-	else if(is_lower_bound(i))
-	{
-		if(y[i]==+1)
-			return(G[i] > Gmax2);
-		else	
-			return(G[i] > Gmax3);
-	}
-	else
-		return(false);
-}
-
-void Solver_NU::do_shrinking()
-{
-	double Gmax1 = -INF;	// max { -y_i * grad(f)_i | y_i = +1, i in I_up(\alpha) }
-	double Gmax2 = -INF;	// max { y_i * grad(f)_i | y_i = +1, i in I_low(\alpha) }
-	double Gmax3 = -INF;	// max { -y_i * grad(f)_i | y_i = -1, i in I_up(\alpha) }
-	double Gmax4 = -INF;	// max { y_i * grad(f)_i | y_i = -1, i in I_low(\alpha) }
-
-	// find maximal violating pair first
-	int i;
-	for(i=0;i<active_size;i++)
-	{
-		if(!is_upper_bound(i))
-		{
-			if(y[i]==+1)
-			{
-				if(-G[i] > Gmax1) Gmax1 = -G[i];
-			}
-			else	if(-G[i] > Gmax4) Gmax4 = -G[i];
-		}
-		if(!is_lower_bound(i))
-		{
-			if(y[i]==+1)
-			{	
-				if(G[i] > Gmax2) Gmax2 = G[i];
-			}
-			else	if(G[i] > Gmax3) Gmax3 = G[i];
-		}
-	}
-
-	if(unshrink == false && max(Gmax1+Gmax2,Gmax3+Gmax4) <= eps*10) 
-	{
-		unshrink = true;
-		reconstruct_gradient();
-		active_size = l;
-	}
-
-	for(i=0;i<active_size;i++)
-		if (be_shrunk(i, Gmax1, Gmax2, Gmax3, Gmax4))
-		{
-			active_size--;
-			while (active_size > i)
-			{
-				if (!be_shrunk(active_size, Gmax1, Gmax2, Gmax3, Gmax4))
-				{
-					swap_index(i,active_size);
-					break;
-				}
-				active_size--;
-			}
-		}
-}
-
-double Solver_NU::calculate_rho()
-{
-	int nr_free1 = 0,nr_free2 = 0;
-	double ub1 = INF, ub2 = INF;
-	double lb1 = -INF, lb2 = -INF;
-	double sum_free1 = 0, sum_free2 = 0;
-
-	for(int i=0;i<active_size;i++)
-	{
-		if(y[i]==+1)
-		{
-			if(is_upper_bound(i))
-				lb1 = max(lb1,G[i]);
-			else if(is_lower_bound(i))
-				ub1 = min(ub1,G[i]);
-			else
-			{
-				++nr_free1;
-				sum_free1 += G[i];
-			}
-		}
-		else
-		{
-			if(is_upper_bound(i))
-				lb2 = max(lb2,G[i]);
-			else if(is_lower_bound(i))
-				ub2 = min(ub2,G[i]);
-			else
-			{
-				++nr_free2;
-				sum_free2 += G[i];
-			}
-		}
-	}
-
-	double r1,r2;
-	if(nr_free1 > 0)
-		r1 = sum_free1/nr_free1;
-	else
-		r1 = (ub1+lb1)/2;
-	
-	if(nr_free2 > 0)
-		r2 = sum_free2/nr_free2;
-	else
-		r2 = (ub2+lb2)/2;
-	
-	si->r = (r1+r2)/2;
-	return (r1-r2)/2;
-}
-
-//
-// Q matrices for various formulations
-//
-class SVC_Q: public Kernel
-{ 
-public:
-	SVC_Q(const svm_problem& prob, const svm_parameter& param, const schar *y_)
-	:Kernel(prob.l, prob.x, param)
-	{
-		clone(y,y_,prob.l);
-		cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20)));
-		QD = new double[prob.l];
-		for(int i=0;i<prob.l;i++)
-			QD[i] = (this->*kernel_function)(i,i);
-	}
-	
-	Qfloat *get_Q(int i, int len) const
-	{
-		Qfloat *data;
-		int start, j;
-		if((start = cache->get_data(i,&data,len)) < len)
-		{
-			for(j=start;j<len;j++)
-				data[j] = (Qfloat)(y[i]*y[j]*(this->*kernel_function)(i,j));
-		}
-		return data;
-	}
-
-	double *get_QD() const
-	{
-		return QD;
-	}
-
-	void swap_index(int i, int j) const
-	{
-		cache->swap_index(i,j);
-		Kernel::swap_index(i,j);
-		swap(y[i],y[j]);
-		swap(QD[i],QD[j]);
-	}
-
-	~SVC_Q()
-	{
-		delete[] y;
-		delete cache;
-		delete[] QD;
-	}
-private:
-	schar *y;
-	Cache *cache;
-	double *QD;
-};
-
-class ONE_CLASS_Q: public Kernel
-{
-public:
-	ONE_CLASS_Q(const svm_problem& prob, const svm_parameter& param)
-	:Kernel(prob.l, prob.x, param)
-	{
-		cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20)));
-		QD = new double[prob.l];
-		for(int i=0;i<prob.l;i++)
-			QD[i] = (this->*kernel_function)(i,i);
-	}
-	
-	Qfloat *get_Q(int i, int len) const
-	{
-		Qfloat *data;
-		int start, j;
-		if((start = cache->get_data(i,&data,len)) < len)
-		{
-			for(j=start;j<len;j++)
-				data[j] = (Qfloat)(this->*kernel_function)(i,j);
-		}
-		return data;
-	}
-
-	double *get_QD() const
-	{
-		return QD;
-	}
-
-	void swap_index(int i, int j) const
-	{
-		cache->swap_index(i,j);
-		Kernel::swap_index(i,j);
-		swap(QD[i],QD[j]);
-	}
-
-	~ONE_CLASS_Q()
-	{
-		delete cache;
-		delete[] QD;
-	}
-private:
-	Cache *cache;
-	double *QD;
-};
-
-class SVR_Q: public Kernel
-{ 
-public:
-	SVR_Q(const svm_problem& prob, const svm_parameter& param)
-	:Kernel(prob.l, prob.x, param)
-	{
-		l = prob.l;
-		cache = new Cache(l,(long int)(param.cache_size*(1<<20)));
-		QD = new double[2*l];
-		sign = new schar[2*l];
-		index = new int[2*l];
-		for(int k=0;k<l;k++)
-		{
-			sign[k] = 1;
-			sign[k+l] = -1;
-			index[k] = k;
-			index[k+l] = k;
-			QD[k] = (this->*kernel_function)(k,k);
-			QD[k+l] = QD[k];
-		}
-		buffer[0] = new Qfloat[2*l];
-		buffer[1] = new Qfloat[2*l];
-		next_buffer = 0;
-	}
-
-	void swap_index(int i, int j) const
-	{
-		swap(sign[i],sign[j]);
-		swap(index[i],index[j]);
-		swap(QD[i],QD[j]);
-	}
-	
-	Qfloat *get_Q(int i, int len) const
-	{
-		Qfloat *data;
-		int j, real_i = index[i];
-		if(cache->get_data(real_i,&data,l) < l)
-		{
-			for(j=0;j<l;j++)
-				data[j] = (Qfloat)(this->*kernel_function)(real_i,j);
-		}
-
-		// reorder and copy
-		Qfloat *buf = buffer[next_buffer];
-		next_buffer = 1 - next_buffer;
-		schar si = sign[i];
-		for(j=0;j<len;j++)
-			buf[j] = (Qfloat) si * (Qfloat) sign[j] * data[index[j]];
-		return buf;
-	}
-
-	double *get_QD() const
-	{
-		return QD;
-	}
-
-	~SVR_Q()
-	{
-		delete cache;
-		delete[] sign;
-		delete[] index;
-		delete[] buffer[0];
-		delete[] buffer[1];
-		delete[] QD;
-	}
-private:
-	int l;
-	Cache *cache;
-	schar *sign;
-	int *index;
-	mutable int next_buffer;
-	Qfloat *buffer[2];
-	double *QD;
-};
-
-//
-// construct and solve various formulations
-//
-static void solve_c_svc(
-	const svm_problem *prob, const svm_parameter* param,
-	double *alpha, Solver::SolutionInfo* si, double Cp, double Cn)
-{
-	int l = prob->l;
-	double *minus_ones = new double[l];
-	schar *y = new schar[l];
-
-	int i;
-
-	for(i=0;i<l;i++)
-	{
-		alpha[i] = 0;
-		minus_ones[i] = -1;
-		if(prob->y[i] > 0) y[i] = +1; else y[i] = -1;
-	}
-
-	Solver s;
-	s.Solve(l, SVC_Q(*prob,*param,y), minus_ones, y,
-		alpha, Cp, Cn, param->eps, si, param->shrinking);
-
-	double sum_alpha=0;
-	for(i=0;i<l;i++)
-		sum_alpha += alpha[i];
-
-	if (Cp==Cn)
-		info("nu = %f\n", sum_alpha/(Cp*prob->l));
-
-	for(i=0;i<l;i++)
-		alpha[i] *= y[i];
-
-	delete[] minus_ones;
-	delete[] y;
-}
-
-static void solve_nu_svc(
-	const svm_problem *prob, const svm_parameter *param,
-	double *alpha, Solver::SolutionInfo* si)
-{
-	int i;
-	int l = prob->l;
-	double nu = param->nu;
-
-	schar *y = new schar[l];
-
-	for(i=0;i<l;i++)
-		if(prob->y[i]>0)
-			y[i] = +1;
-		else
-			y[i] = -1;
-
-	double sum_pos = nu*l/2;
-	double sum_neg = nu*l/2;
-
-	for(i=0;i<l;i++)
-		if(y[i] == +1)
-		{
-			alpha[i] = min(1.0,sum_pos);
-			sum_pos -= alpha[i];
-		}
-		else
-		{
-			alpha[i] = min(1.0,sum_neg);
-			sum_neg -= alpha[i];
-		}
-
-	double *zeros = new double[l];
-
-	for(i=0;i<l;i++)
-		zeros[i] = 0;
-
-	Solver_NU s;
-	s.Solve(l, SVC_Q(*prob,*param,y), zeros, y,
-		alpha, 1.0, 1.0, param->eps, si,  param->shrinking);
-	double r = si->r;
-
-	info("C = %f\n",1/r);
-
-	for(i=0;i<l;i++)
-		alpha[i] *= y[i]/r;
-
-	si->rho /= r;
-	si->obj /= (r*r);
-	si->upper_bound_p = 1/r;
-	si->upper_bound_n = 1/r;
-
-	delete[] y;
-	delete[] zeros;
-}
-
-static void solve_one_class(
-	const svm_problem *prob, const svm_parameter *param,
-	double *alpha, Solver::SolutionInfo* si)
-{
-	int l = prob->l;
-	double *zeros = new double[l];
-	schar *ones = new schar[l];
-	int i;
-
-	int n = (int)(param->nu*prob->l);	// # of alpha's at upper bound
-
-	for(i=0;i<n;i++)
-		alpha[i] = 1;
-	if(n<prob->l)
-		alpha[n] = param->nu * prob->l - n;
-	for(i=n+1;i<l;i++)
-		alpha[i] = 0;
-
-	for(i=0;i<l;i++)
-	{
-		zeros[i] = 0;
-		ones[i] = 1;
-	}
-
-	Solver s;
-	s.Solve(l, ONE_CLASS_Q(*prob,*param), zeros, ones,
-		alpha, 1.0, 1.0, param->eps, si, param->shrinking);
-
-	delete[] zeros;
-	delete[] ones;
-}
-
-static void solve_epsilon_svr(
-	const svm_problem *prob, const svm_parameter *param,
-	double *alpha, Solver::SolutionInfo* si)
-{
-	int l = prob->l;
-	double *alpha2 = new double[2*l];
-	double *linear_term = new double[2*l];
-	schar *y = new schar[2*l];
-	int i;
-
-	for(i=0;i<l;i++)
-	{
-		alpha2[i] = 0;
-		linear_term[i] = param->p - prob->y[i];
-		y[i] = 1;
-
-		alpha2[i+l] = 0;
-		linear_term[i+l] = param->p + prob->y[i];
-		y[i+l] = -1;
-	}
-
-	Solver s;
-	s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y,
-		alpha2, param->C, param->C, param->eps, si, param->shrinking);
-
-	double sum_alpha = 0;
-	for(i=0;i<l;i++)
-	{
-		alpha[i] = alpha2[i] - alpha2[i+l];
-		sum_alpha += fabs(alpha[i]);
-	}
-	info("nu = %f\n",sum_alpha/(param->C*l));
-
-	delete[] alpha2;
-	delete[] linear_term;
-	delete[] y;
-}
-
-static void solve_nu_svr(
-	const svm_problem *prob, const svm_parameter *param,
-	double *alpha, Solver::SolutionInfo* si)
-{
-	int l = prob->l;
-	double C = param->C;
-	double *alpha2 = new double[2*l];
-	double *linear_term = new double[2*l];
-	schar *y = new schar[2*l];
-	int i;
-
-	double sum = C * param->nu * l / 2;
-	for(i=0;i<l;i++)
-	{
-		alpha2[i] = alpha2[i+l] = min(sum,C);
-		sum -= alpha2[i];
-
-		linear_term[i] = - prob->y[i];
-		y[i] = 1;
-
-		linear_term[i+l] = prob->y[i];
-		y[i+l] = -1;
-	}
-
-	Solver_NU s;
-	s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y,
-		alpha2, C, C, param->eps, si, param->shrinking);
-
-	info("epsilon = %f\n",-si->r);
-
-	for(i=0;i<l;i++)
-		alpha[i] = alpha2[i] - alpha2[i+l];
-
-	delete[] alpha2;
-	delete[] linear_term;
-	delete[] y;
-}
-
-//
-// decision_function
-//
-struct decision_function
-{
-	double *alpha;
-	double rho;	
-};
-
-static decision_function svm_train_one(
-	const svm_problem *prob, const svm_parameter *param,
-	double Cp, double Cn)
-{
-	double *alpha = Malloc(double,prob->l);
-	Solver::SolutionInfo si;
-	switch(param->svm_type)
-	{
-		case C_SVC:
-			solve_c_svc(prob,param,alpha,&si,Cp,Cn);
-			break;
-		case NU_SVC:
-			solve_nu_svc(prob,param,alpha,&si);
-			break;
-		case ONE_CLASS:
-			solve_one_class(prob,param,alpha,&si);
-			break;
-		case EPSILON_SVR:
-			solve_epsilon_svr(prob,param,alpha,&si);
-			break;
-		case NU_SVR:
-			solve_nu_svr(prob,param,alpha,&si);
-			break;
-	}
-
-	info("obj = %f, rho = %f\n",si.obj,si.rho);
-
-	// output SVs
-
-	int nSV = 0;
-	int nBSV = 0;
-	for(int i=0;i<prob->l;i++)
-	{
-		if(fabs(alpha[i]) > 0)
-		{
-			++nSV;
-			if(prob->y[i] > 0)
-			{
-				if(fabs(alpha[i]) >= si.upper_bound_p)
-					++nBSV;
-			}
-			else
-			{
-				if(fabs(alpha[i]) >= si.upper_bound_n)
-					++nBSV;
-			}
-		}
-	}
-
-	info("nSV = %d, nBSV = %d\n",nSV,nBSV);
-
-	decision_function f;
-	f.alpha = alpha;
-	f.rho = si.rho;
-	return f;
-}
-
-// Platt's binary SVM Probablistic Output: an improvement from Lin et al.
-static void sigmoid_train(
-	int l, const double *dec_values, const double *labels, 
-	double& A, double& B)
-{
-	double prior1=0, prior0 = 0;
-	int i;
-
-	for (i=0;i<l;i++)
-		if (labels[i] > 0) prior1+=1;
-		else prior0+=1;
-	
-	int max_iter=100;	// Maximal number of iterations
-	double min_step=1e-10;	// Minimal step taken in line search
-	double sigma=1e-12;	// For numerically strict PD of Hessian
-	double eps=1e-5;
-	double hiTarget=(prior1+1.0)/(prior1+2.0);
-	double loTarget=1/(prior0+2.0);
-	double *t=Malloc(double,l);
-	double fApB,p,q,h11,h22,h21,g1,g2,det,dA,dB,gd,stepsize;
-	double newA,newB,newf,d1,d2;
-	int iter; 
-	
-	// Initial Point and Initial Fun Value
-	A=0.0; B=log((prior0+1.0)/(prior1+1.0));
-	double fval = 0.0;
-
-	for (i=0;i<l;i++)
-	{
-		if (labels[i]>0) t[i]=hiTarget;
-		else t[i]=loTarget;
-		fApB = dec_values[i]*A+B;
-		if (fApB>=0)
-			fval += t[i]*fApB + log(1+exp(-fApB));
-		else
-			fval += (t[i] - 1)*fApB +log(1+exp(fApB));
-	}
-	for (iter=0;iter<max_iter;iter++)
-	{
-		// Update Gradient and Hessian (use H' = H + sigma I)
-		h11=sigma; // numerically ensures strict PD
-		h22=sigma;
-		h21=0.0;g1=0.0;g2=0.0;
-		for (i=0;i<l;i++)
-		{
-			fApB = dec_values[i]*A+B;
-			if (fApB >= 0)
-			{
-				p=exp(-fApB)/(1.0+exp(-fApB));
-				q=1.0/(1.0+exp(-fApB));
-			}
-			else
-			{
-				p=1.0/(1.0+exp(fApB));
-				q=exp(fApB)/(1.0+exp(fApB));
-			}
-			d2=p*q;
-			h11+=dec_values[i]*dec_values[i]*d2;
-			h22+=d2;
-			h21+=dec_values[i]*d2;
-			d1=t[i]-p;
-			g1+=dec_values[i]*d1;
-			g2+=d1;
-		}
-
-		// Stopping Criteria
-		if (fabs(g1)<eps && fabs(g2)<eps)
-			break;
-
-		// Finding Newton direction: -inv(H') * g
-		det=h11*h22-h21*h21;
-		dA=-(h22*g1 - h21 * g2) / det;
-		dB=-(-h21*g1+ h11 * g2) / det;
-		gd=g1*dA+g2*dB;
-
-
-		stepsize = 1;		// Line Search
-		while (stepsize >= min_step)
-		{
-			newA = A + stepsize * dA;
-			newB = B + stepsize * dB;
-
-			// New function value
-			newf = 0.0;
-			for (i=0;i<l;i++)
-			{
-				fApB = dec_values[i]*newA+newB;
-				if (fApB >= 0)
-					newf += t[i]*fApB + log(1+exp(-fApB));
-				else
-					newf += (t[i] - 1)*fApB +log(1+exp(fApB));
-			}
-			// Check sufficient decrease
-			if (newf<fval+0.0001*stepsize*gd)
-			{
-				A=newA;B=newB;fval=newf;
-				break;
-			}
-			else
-				stepsize = stepsize / 2.0;
-		}
-
-		if (stepsize < min_step)
-		{
-			info("Line search fails in two-class probability estimates\n");
-			break;
-		}
-	}
-
-	if (iter>=max_iter)
-		info("Reaching maximal iterations in two-class probability estimates\n");
-	free(t);
-}
-
-static double sigmoid_predict(double decision_value, double A, double B)
-{
-	double fApB = decision_value*A+B;
-	// 1-p used later; avoid catastrophic cancellation
-	if (fApB >= 0)
-		return exp(-fApB)/(1.0+exp(-fApB));
-	else
-		return 1.0/(1+exp(fApB)) ;
-}
-
-// Method 2 from the multiclass_prob paper by Wu, Lin, and Weng
-static void multiclass_probability(int k, double **r, double *p)
-{
-	int t,j;
-	int iter = 0, max_iter=max(100,k);
-	double **Q=Malloc(double *,k);
-	double *Qp=Malloc(double,k);
-	double pQp, eps=0.005/k;
-	
-	for (t=0;t<k;t++)
-	{
-		p[t]=1.0/k;  // Valid if k = 1
-		Q[t]=Malloc(double,k);
-		Q[t][t]=0;
-		for (j=0;j<t;j++)
-		{
-			Q[t][t]+=r[j][t]*r[j][t];
-			Q[t][j]=Q[j][t];
-		}
-		for (j=t+1;j<k;j++)
-		{
-			Q[t][t]+=r[j][t]*r[j][t];
-			Q[t][j]=-r[j][t]*r[t][j];
-		}
-	}
-	for (iter=0;iter<max_iter;iter++)
-	{
-		// stopping condition, recalculate QP,pQP for numerical accuracy
-		pQp=0;
-		for (t=0;t<k;t++)
-		{
-			Qp[t]=0;
-			for (j=0;j<k;j++)
-				Qp[t]+=Q[t][j]*p[j];
-			pQp+=p[t]*Qp[t];
-		}
-		double max_error=0;
-		for (t=0;t<k;t++)
-		{
-			double error=fabs(Qp[t]-pQp);
-			if (error>max_error)
-				max_error=error;
-		}
-		if (max_error<eps) break;
-		
-		for (t=0;t<k;t++)
-		{
-			double diff=(-Qp[t]+pQp)/Q[t][t];
-			p[t]+=diff;
-			pQp=(pQp+diff*(diff*Q[t][t]+2*Qp[t]))/(1+diff)/(1+diff);
-			for (j=0;j<k;j++)
-			{
-				Qp[j]=(Qp[j]+diff*Q[t][j])/(1+diff);
-				p[j]/=(1+diff);
-			}
-		}
-	}
-	if (iter>=max_iter)
-		info("Exceeds max_iter in multiclass_prob\n");
-	for(t=0;t<k;t++) free(Q[t]);
-	free(Q);
-	free(Qp);
-}
-
-// Cross-validation decision values for probability estimates
-static void svm_binary_svc_probability(
-	const svm_problem *prob, const svm_parameter *param,
-	double Cp, double Cn, double& probA, double& probB)
-{
-	int i;
-	int nr_fold = 5;
-	int *perm = Malloc(int,prob->l);
-	double *dec_values = Malloc(double,prob->l);
-
-	// random shuffle
-	for(i=0;i<prob->l;i++) perm[i]=i;
-	for(i=0;i<prob->l;i++)
-	{
-		int j = i+rand()%(prob->l-i);
-		swap(perm[i],perm[j]);
-	}
-	for(i=0;i<nr_fold;i++)
-	{
-		int begin = i*prob->l/nr_fold;
-		int end = (i+1)*prob->l/nr_fold;
-		int j,k;
-		struct svm_problem subprob;
-
-		subprob.l = prob->l-(end-begin);
-		subprob.x = Malloc(struct svm_node*,subprob.l);
-		subprob.y = Malloc(double,subprob.l);
-			
-		k=0;
-		for(j=0;j<begin;j++)
-		{
-			subprob.x[k] = prob->x[perm[j]];
-			subprob.y[k] = prob->y[perm[j]];
-			++k;
-		}
-		for(j=end;j<prob->l;j++)
-		{
-			subprob.x[k] = prob->x[perm[j]];
-			subprob.y[k] = prob->y[perm[j]];
-			++k;
-		}
-		int p_count=0,n_count=0;
-		for(j=0;j<k;j++)
-			if(subprob.y[j]>0)
-				p_count++;
-			else
-				n_count++;
-
-		if(p_count==0 && n_count==0)
-			for(j=begin;j<end;j++)
-				dec_values[perm[j]] = 0;
-		else if(p_count > 0 && n_count == 0)
-			for(j=begin;j<end;j++)
-				dec_values[perm[j]] = 1;
-		else if(p_count == 0 && n_count > 0)
-			for(j=begin;j<end;j++)
-				dec_values[perm[j]] = -1;
-		else
-		{
-			svm_parameter subparam = *param;
-			subparam.probability=0;
-			subparam.C=1.0;
-			subparam.nr_weight=2;
-			subparam.weight_label = Malloc(int,2);
-			subparam.weight = Malloc(double,2);
-			subparam.weight_label[0]=+1;
-			subparam.weight_label[1]=-1;
-			subparam.weight[0]=Cp;
-			subparam.weight[1]=Cn;
-			struct svm_model *submodel = svm_train(&subprob,&subparam);
-			for(j=begin;j<end;j++)
-			{
-				svm_predict_values(submodel,prob->x[perm[j]],&(dec_values[perm[j]])); 
-				// ensure +1 -1 order; reason not using CV subroutine
-				dec_values[perm[j]] *= submodel->label[0];
-			}		
-			svm_free_and_destroy_model(&submodel);
-			svm_destroy_param(&subparam);
-		}
-		free(subprob.x);
-		free(subprob.y);
-	}		
-	sigmoid_train(prob->l,dec_values,prob->y,probA,probB);
-	free(dec_values);
-	free(perm);
-}
-
-// Return parameter of a Laplace distribution 
-static double svm_svr_probability(
-	const svm_problem *prob, const svm_parameter *param)
-{
-	int i;
-	int nr_fold = 5;
-	double *ymv = Malloc(double,prob->l);
-	double mae = 0;
-
-	svm_parameter newparam = *param;
-	newparam.probability = 0;
-	svm_cross_validation(prob,&newparam,nr_fold,ymv);
-	for(i=0;i<prob->l;i++)
-	{
-		ymv[i]=prob->y[i]-ymv[i];
-		mae += fabs(ymv[i]);
-	}		
-	mae /= prob->l;
-	double std=sqrt(2*mae*mae);
-	int count=0;
-	mae=0;
-	for(i=0;i<prob->l;i++)
-		if (fabs(ymv[i]) > 5*std) 
-			count=count+1;
-		else 
-			mae+=fabs(ymv[i]);
-	mae /= (prob->l-count);
-	info("Prob. model for test data: target value = predicted value + z,\nz: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma= %g\n",mae);
-	free(ymv);
-	return mae;
-}
-
-
-// label: label name, start: begin of each class, count: #data of classes, perm: indices to the original data
-// perm, length l, must be allocated before calling this subroutine
-static void svm_group_classes(const svm_problem *prob, int *nr_class_ret, int **label_ret, int **start_ret, int **count_ret, int *perm)
-{
-	int l = prob->l;
-	int max_nr_class = 16;
-	int nr_class = 0;
-	int *label = Malloc(int,max_nr_class);
-	int *count = Malloc(int,max_nr_class);
-	int *data_label = Malloc(int,l);	
-	int i;
-
-	for(i=0;i<l;i++)
-	{
-		int this_label = (int)prob->y[i];
-		int j;
-		for(j=0;j<nr_class;j++)
-		{
-			if(this_label == label[j])
-			{
-				++count[j];
-				break;
-			}
-		}
-		data_label[i] = j;
-		if(j == nr_class)
-		{
-			if(nr_class == max_nr_class)
-			{
-				max_nr_class *= 2;
-				label = (int *)realloc(label,max_nr_class*sizeof(int));
-				count = (int *)realloc(count,max_nr_class*sizeof(int));
-			}
-			label[nr_class] = this_label;
-			count[nr_class] = 1;
-			++nr_class;
-		}
-	}
-
-	int *start = Malloc(int,nr_class);
-	start[0] = 0;
-	for(i=1;i<nr_class;i++)
-		start[i] = start[i-1]+count[i-1];
-	for(i=0;i<l;i++)
-	{
-		perm[start[data_label[i]]] = i;
-		++start[data_label[i]];
-	}
-	start[0] = 0;
-	for(i=1;i<nr_class;i++)
-		start[i] = start[i-1]+count[i-1];
-
-	*nr_class_ret = nr_class;
-	*label_ret = label;
-	*start_ret = start;
-	*count_ret = count;
-	free(data_label);
-}
-
-//
-// Interface functions
-//
-svm_model *svm_train(const svm_problem *prob, const svm_parameter *param)
-{
-	svm_model *model = Malloc(svm_model,1);
-	model->param = *param;
-	model->free_sv = 0;	// XXX
-
-	if(param->svm_type == ONE_CLASS ||
-	   param->svm_type == EPSILON_SVR ||
-	   param->svm_type == NU_SVR)
-	{
-		// regression or one-class-svm
-		model->nr_class = 2;
-		model->label = NULL;
-		model->nSV = NULL;
-		model->probA = NULL; model->probB = NULL;
-		model->sv_coef = Malloc(double *,1);
-
-		if(param->probability && 
-		   (param->svm_type == EPSILON_SVR ||
-		    param->svm_type == NU_SVR))
-		{
-			model->probA = Malloc(double,1);
-			model->probA[0] = svm_svr_probability(prob,param);
-		}
-
-		decision_function f = svm_train_one(prob,param,0,0);
-		model->rho = Malloc(double,1);
-		model->rho[0] = f.rho;
-
-		int nSV = 0;
-		int i;
-		for(i=0;i<prob->l;i++)
-			if(fabs(f.alpha[i]) > 0) ++nSV;
-		model->l = nSV;
-		model->SV = Malloc(svm_node *,nSV);
-		model->sv_coef[0] = Malloc(double,nSV);
-		int j = 0;
-		for(i=0;i<prob->l;i++)
-			if(fabs(f.alpha[i]) > 0)
-			{
-				model->SV[j] = prob->x[i];
-				model->sv_coef[0][j] = f.alpha[i];
-				++j;
-			}		
-
-		free(f.alpha);
-	}
-	else
-	{
-		// classification
-		int l = prob->l;
-		int nr_class;
-		int *label = NULL;
-		int *start = NULL;
-		int *count = NULL;
-		int *perm = Malloc(int,l);
-
-		// group training data of the same class
-		svm_group_classes(prob,&nr_class,&label,&start,&count,perm);
-		if(nr_class == 1) 
-			info("WARNING: training data in only one class. See README for details.\n");
-		
-		svm_node **x = Malloc(svm_node *,l);
-		int i;
-		for(i=0;i<l;i++)
-			x[i] = prob->x[perm[i]];
-
-		// calculate weighted C
-
-		double *weighted_C = Malloc(double, nr_class);
-		for(i=0;i<nr_class;i++)
-			weighted_C[i] = param->C;
-		for(i=0;i<param->nr_weight;i++)
-		{	
-			int j;
-			for(j=0;j<nr_class;j++)
-				if(param->weight_label[i] == label[j])
-					break;
-			if(j == nr_class)
-				fprintf(stderr,"WARNING: class label %d specified in weight is not found\n", param->weight_label[i]);
-			else
-				weighted_C[j] *= param->weight[i];
-		}
-
-		// train k*(k-1)/2 models
-		
-		bool *nonzero = Malloc(bool,l);
-		for(i=0;i<l;i++)
-			nonzero[i] = false;
-		decision_function *f = Malloc(decision_function,nr_class*(nr_class-1)/2);
-
-		double *probA=NULL,*probB=NULL;
-		if (param->probability)
-		{
-			probA=Malloc(double,nr_class*(nr_class-1)/2);
-			probB=Malloc(double,nr_class*(nr_class-1)/2);
-		}
-
-		int p = 0;
-		for(i=0;i<nr_class;i++)
-			for(int j=i+1;j<nr_class;j++)
-			{
-				svm_problem sub_prob;
-				int si = start[i], sj = start[j];
-				int ci = count[i], cj = count[j];
-				sub_prob.l = ci+cj;
-				sub_prob.x = Malloc(svm_node *,sub_prob.l);
-				sub_prob.y = Malloc(double,sub_prob.l);
-				int k;
-				for(k=0;k<ci;k++)
-				{
-					sub_prob.x[k] = x[si+k];
-					sub_prob.y[k] = +1;
-				}
-				for(k=0;k<cj;k++)
-				{
-					sub_prob.x[ci+k] = x[sj+k];
-					sub_prob.y[ci+k] = -1;
-				}
-
-				if(param->probability)
-					svm_binary_svc_probability(&sub_prob,param,weighted_C[i],weighted_C[j],probA[p],probB[p]);
-
-				f[p] = svm_train_one(&sub_prob,param,weighted_C[i],weighted_C[j]);
-				for(k=0;k<ci;k++)
-					if(!nonzero[si+k] && fabs(f[p].alpha[k]) > 0)
-						nonzero[si+k] = true;
-				for(k=0;k<cj;k++)
-					if(!nonzero[sj+k] && fabs(f[p].alpha[ci+k]) > 0)
-						nonzero[sj+k] = true;
-				free(sub_prob.x);
-				free(sub_prob.y);
-				++p;
-			}
-
-		// build output
-
-		model->nr_class = nr_class;
-		
-		model->label = Malloc(int,nr_class);
-		for(i=0;i<nr_class;i++)
-			model->label[i] = label[i];
-		
-		model->rho = Malloc(double,nr_class*(nr_class-1)/2);
-		for(i=0;i<nr_class*(nr_class-1)/2;i++)
-			model->rho[i] = f[i].rho;
-
-		if(param->probability)
-		{
-			model->probA = Malloc(double,nr_class*(nr_class-1)/2);
-			model->probB = Malloc(double,nr_class*(nr_class-1)/2);
-			for(i=0;i<nr_class*(nr_class-1)/2;i++)
-			{
-				model->probA[i] = probA[i];
-				model->probB[i] = probB[i];
-			}
-		}
-		else
-		{
-			model->probA=NULL;
-			model->probB=NULL;
-		}
-
-		int total_sv = 0;
-		int *nz_count = Malloc(int,nr_class);
-		model->nSV = Malloc(int,nr_class);
-		for(i=0;i<nr_class;i++)
-		{
-			int nSV = 0;
-			for(int j=0;j<count[i];j++)
-				if(nonzero[start[i]+j])
-				{	
-					++nSV;
-					++total_sv;
-				}
-			model->nSV[i] = nSV;
-			nz_count[i] = nSV;
-		}
-		
-		info("Total nSV = %d\n",total_sv);
-
-		model->l = total_sv;
-		model->SV = Malloc(svm_node *,total_sv);
-		p = 0;
-		for(i=0;i<l;i++)
-			if(nonzero[i]) model->SV[p++] = x[i];
-
-		int *nz_start = Malloc(int,nr_class);
-		nz_start[0] = 0;
-		for(i=1;i<nr_class;i++)
-			nz_start[i] = nz_start[i-1]+nz_count[i-1];
-
-		model->sv_coef = Malloc(double *,nr_class-1);
-		for(i=0;i<nr_class-1;i++)
-			model->sv_coef[i] = Malloc(double,total_sv);
-
-		p = 0;
-		for(i=0;i<nr_class;i++)
-			for(int j=i+1;j<nr_class;j++)
-			{
-				// classifier (i,j): coefficients with
-				// i are in sv_coef[j-1][nz_start[i]...],
-				// j are in sv_coef[i][nz_start[j]...]
-
-				int si = start[i];
-				int sj = start[j];
-				int ci = count[i];
-				int cj = count[j];
-				
-				int q = nz_start[i];
-				int k;
-				for(k=0;k<ci;k++)
-					if(nonzero[si+k])
-						model->sv_coef[j-1][q++] = f[p].alpha[k];
-				q = nz_start[j];
-				for(k=0;k<cj;k++)
-					if(nonzero[sj+k])
-						model->sv_coef[i][q++] = f[p].alpha[ci+k];
-				++p;
-			}
-		
-		free(label);
-		free(probA);
-		free(probB);
-		free(count);
-		free(perm);
-		free(start);
-		free(x);
-		free(weighted_C);
-		free(nonzero);
-		for(i=0;i<nr_class*(nr_class-1)/2;i++)
-			free(f[i].alpha);
-		free(f);
-		free(nz_count);
-		free(nz_start);
-	}
-	return model;
-}
-
-// Stratified cross validation
-void svm_cross_validation(const svm_problem *prob, const svm_parameter *param, int nr_fold, double *target)
-{
-	int i;
-	int *fold_start = Malloc(int,nr_fold+1);
-	int l = prob->l;
-	int *perm = Malloc(int,l);
-	int nr_class;
-
-	// stratified cv may not give leave-one-out rate
-	// Each class to l folds -> some folds may have zero elements
-	if((param->svm_type == C_SVC ||
-	    param->svm_type == NU_SVC) && nr_fold < l)
-	{
-		int *start = NULL;
-		int *label = NULL;
-		int *count = NULL;
-		svm_group_classes(prob,&nr_class,&label,&start,&count,perm);
-
-		// random shuffle and then data grouped by fold using the array perm
-		int *fold_count = Malloc(int,nr_fold);
-		int c;
-		int *index = Malloc(int,l);
-		for(i=0;i<l;i++)
-			index[i]=perm[i];
-		for (c=0; c<nr_class; c++) 
-			for(i=0;i<count[c];i++)
-			{
-				int j = i+rand()%(count[c]-i);
-				swap(index[start[c]+j],index[start[c]+i]);
-			}
-		for(i=0;i<nr_fold;i++)
-		{
-			fold_count[i] = 0;
-			for (c=0; c<nr_class;c++)
-				fold_count[i]+=(i+1)*count[c]/nr_fold-i*count[c]/nr_fold;
-		}
-		fold_start[0]=0;
-		for (i=1;i<=nr_fold;i++)
-			fold_start[i] = fold_start[i-1]+fold_count[i-1];
-		for (c=0; c<nr_class;c++)
-			for(i=0;i<nr_fold;i++)
-			{
-				int begin = start[c]+i*count[c]/nr_fold;
-				int end = start[c]+(i+1)*count[c]/nr_fold;
-				for(int j=begin;j<end;j++)
-				{
-					perm[fold_start[i]] = index[j];
-					fold_start[i]++;
-				}
-			}
-		fold_start[0]=0;
-		for (i=1;i<=nr_fold;i++)
-			fold_start[i] = fold_start[i-1]+fold_count[i-1];
-		free(start);	
-		free(label);
-		free(count);	
-		free(index);
-		free(fold_count);
-	}
-	else
-	{
-		for(i=0;i<l;i++) perm[i]=i;
-		for(i=0;i<l;i++)
-		{
-			int j = i+rand()%(l-i);
-			swap(perm[i],perm[j]);
-		}
-		for(i=0;i<=nr_fold;i++)
-			fold_start[i]=i*l/nr_fold;
-	}
-
-	for(i=0;i<nr_fold;i++)
-	{
-		int begin = fold_start[i];
-		int end = fold_start[i+1];
-		int j,k;
-		struct svm_problem subprob;
-
-		subprob.l = l-(end-begin);
-		subprob.x = Malloc(struct svm_node*,subprob.l);
-		subprob.y = Malloc(double,subprob.l);
-			
-		k=0;
-		for(j=0;j<begin;j++)
-		{
-			subprob.x[k] = prob->x[perm[j]];
-			subprob.y[k] = prob->y[perm[j]];
-			++k;
-		}
-		for(j=end;j<l;j++)
-		{
-			subprob.x[k] = prob->x[perm[j]];
-			subprob.y[k] = prob->y[perm[j]];
-			++k;
-		}
-		struct svm_model *submodel = svm_train(&subprob,param);
-		if(param->probability && 
-		   (param->svm_type == C_SVC || param->svm_type == NU_SVC))
-		{
-			double *prob_estimates=Malloc(double,svm_get_nr_class(submodel));
-			for(j=begin;j<end;j++)
-				target[perm[j]] = svm_predict_probability(submodel,prob->x[perm[j]],prob_estimates);
-			free(prob_estimates);			
-		}
-		else
-			for(j=begin;j<end;j++)
-				target[perm[j]] = svm_predict(submodel,prob->x[perm[j]]);
-		svm_free_and_destroy_model(&submodel);
-		free(subprob.x);
-		free(subprob.y);
-	}		
-	free(fold_start);
-	free(perm);	
-}
-
-
-int svm_get_svm_type(const svm_model *model)
-{
-	return model->param.svm_type;
-}
-
-int svm_get_nr_class(const svm_model *model)
-{
-	return model->nr_class;
-}
-
-void svm_get_labels(const svm_model *model, int* label)
-{
-	if (model->label != NULL)
-		for(int i=0;i<model->nr_class;i++)
-			label[i] = model->label[i];
-}
-
-double svm_get_svr_probability(const svm_model *model)
-{
-	if ((model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) &&
-	    model->probA!=NULL)
-		return model->probA[0];
-	else
-	{
-		fprintf(stderr,"Model doesn't contain information for SVR probability inference\n");
-		return 0;
-	}
-}
-
-double svm_predict_values(const svm_model *model, const svm_node *x, double* dec_values)
-{
-	int i;
-	if(model->param.svm_type == ONE_CLASS ||
-	   model->param.svm_type == EPSILON_SVR ||
-	   model->param.svm_type == NU_SVR)
-	{
-		double *sv_coef = model->sv_coef[0];
-		double sum = 0;
-		for(i=0;i<model->l;i++)
-			sum += sv_coef[i] * Kernel::k_function(x,model->SV[i],model->param);
-		sum -= model->rho[0];
-		*dec_values = sum;
-
-		if(model->param.svm_type == ONE_CLASS)
-			return (sum>0)?1:-1;
-		else
-			return sum;
-	}
-	else
-	{
-		int nr_class = model->nr_class;
-		int l = model->l;
-		
-		double *kvalue = Malloc(double,l);
-		for(i=0;i<l;i++)
-			kvalue[i] = Kernel::k_function(x,model->SV[i],model->param);
-
-		int *start = Malloc(int,nr_class);
-		start[0] = 0;
-		for(i=1;i<nr_class;i++)
-			start[i] = start[i-1]+model->nSV[i-1];
-
-		int *vote = Malloc(int,nr_class);
-		for(i=0;i<nr_class;i++)
-			vote[i] = 0;
-
-		int p=0;
-		for(i=0;i<nr_class;i++)
-			for(int j=i+1;j<nr_class;j++)
-			{
-				double sum = 0;
-				int si = start[i];
-				int sj = start[j];
-				int ci = model->nSV[i];
-				int cj = model->nSV[j];
-				
-				int k;
-				double *coef1 = model->sv_coef[j-1];
-				double *coef2 = model->sv_coef[i];
-				for(k=0;k<ci;k++)
-					sum += coef1[si+k] * kvalue[si+k];
-				for(k=0;k<cj;k++)
-					sum += coef2[sj+k] * kvalue[sj+k];
-				sum -= model->rho[p];
-				dec_values[p] = sum;
-
-				if(dec_values[p] > 0)
-					++vote[i];
-				else
-					++vote[j];
-				p++;
-			}
-
-		int vote_max_idx = 0;
-		for(i=1;i<nr_class;i++)
-			if(vote[i] > vote[vote_max_idx])
-				vote_max_idx = i;
-
-		free(kvalue);
-		free(start);
-		free(vote);
-		return model->label[vote_max_idx];
-	}
-}
-
-double svm_predict(const svm_model *model, const svm_node *x)
-{
-	int nr_class = model->nr_class;
-	double *dec_values;
-	if(model->param.svm_type == ONE_CLASS ||
-	   model->param.svm_type == EPSILON_SVR ||
-	   model->param.svm_type == NU_SVR)
-		dec_values = Malloc(double, 1);
-	else 
-		dec_values = Malloc(double, nr_class*(nr_class-1)/2);
-	double pred_result = svm_predict_values(model, x, dec_values);
-	free(dec_values);
-	return pred_result;
-}
-
-double svm_predict_probability(
-	const svm_model *model, const svm_node *x, double *prob_estimates)
-{
-	if ((model->param.svm_type == C_SVC || model->param.svm_type == NU_SVC) &&
-	    model->probA!=NULL && model->probB!=NULL)
-	{
-		int i;
-		int nr_class = model->nr_class;
-		double *dec_values = Malloc(double, nr_class*(nr_class-1)/2);
-		svm_predict_values(model, x, dec_values);
-
-		double min_prob=1e-7;
-		double **pairwise_prob=Malloc(double *,nr_class);
-		for(i=0;i<nr_class;i++)
-			pairwise_prob[i]=Malloc(double,nr_class);
-		int k=0;
-		for(i=0;i<nr_class;i++)
-			for(int j=i+1;j<nr_class;j++)
-			{
-				pairwise_prob[i][j]=min(max(sigmoid_predict(dec_values[k],model->probA[k],model->probB[k]),min_prob),1-min_prob);
-				pairwise_prob[j][i]=1-pairwise_prob[i][j];
-				k++;
-			}
-		multiclass_probability(nr_class,pairwise_prob,prob_estimates);
-
-		int prob_max_idx = 0;
-		for(i=1;i<nr_class;i++)
-			if(prob_estimates[i] > prob_estimates[prob_max_idx])
-				prob_max_idx = i;
-		for(i=0;i<nr_class;i++)
-			free(pairwise_prob[i]);
-		free(dec_values);
-		free(pairwise_prob);	     
-		return model->label[prob_max_idx];
-	}
-	else 
-		return svm_predict(model, x);
-}
-
-static const char *svm_type_table[] =
-{
-	"c_svc","nu_svc","one_class","epsilon_svr","nu_svr",NULL
-};
-
-static const char *kernel_type_table[]=
-{
-	"linear","polynomial","rbf","sigmoid","precomputed",NULL
-};
-
-int svm_save_model(const char *model_file_name, const svm_model *model)
-{
-	FILE *fp = fopen(model_file_name,"w");
-	if(fp==NULL) return -1;
-
-	const svm_parameter& param = model->param;
-
-	fprintf(fp,"svm_type %s\n", svm_type_table[param.svm_type]);
-	fprintf(fp,"kernel_type %s\n", kernel_type_table[param.kernel_type]);
-
-	if(param.kernel_type == POLY)
-		fprintf(fp,"degree %d\n", param.degree);
-
-	if(param.kernel_type == POLY || param.kernel_type == RBF || param.kernel_type == SIGMOID)
-		fprintf(fp,"gamma %g\n", param.gamma);
-
-	if(param.kernel_type == POLY || param.kernel_type == SIGMOID)
-		fprintf(fp,"coef0 %g\n", param.coef0);
-
-	int nr_class = model->nr_class;
-	int l = model->l;
-	fprintf(fp, "nr_class %d\n", nr_class);
-	fprintf(fp, "total_sv %d\n",l);
-	
-	{
-		fprintf(fp, "rho");
-		for(int i=0;i<nr_class*(nr_class-1)/2;i++)
-			fprintf(fp," %g",model->rho[i]);
-		fprintf(fp, "\n");
-	}
-	
-	if(model->label)
-	{
-		fprintf(fp, "label");
-		for(int i=0;i<nr_class;i++)
-			fprintf(fp," %d",model->label[i]);
-		fprintf(fp, "\n");
-	}
-
-	if(model->probA) // regression has probA only
-	{
-		fprintf(fp, "probA");
-		for(int i=0;i<nr_class*(nr_class-1)/2;i++)
-			fprintf(fp," %g",model->probA[i]);
-		fprintf(fp, "\n");
-	}
-	if(model->probB)
-	{
-		fprintf(fp, "probB");
-		for(int i=0;i<nr_class*(nr_class-1)/2;i++)
-			fprintf(fp," %g",model->probB[i]);
-		fprintf(fp, "\n");
-	}
-
-	if(model->nSV)
-	{
-		fprintf(fp, "nr_sv");
-		for(int i=0;i<nr_class;i++)
-			fprintf(fp," %d",model->nSV[i]);
-		fprintf(fp, "\n");
-	}
-
-	fprintf(fp, "SV\n");
-	const double * const *sv_coef = model->sv_coef;
-	const svm_node * const *SV = model->SV;
-
-	for(int i=0;i<l;i++)
-	{
-		for(int j=0;j<nr_class-1;j++)
-			fprintf(fp, "%.16g ",sv_coef[j][i]);
-
-		const svm_node *p = SV[i];
-
-		if(param.kernel_type == PRECOMPUTED)
-			fprintf(fp,"0:%d ",(int)(p->value));
-		else
-			while(p->index != -1)
-			{
-				fprintf(fp,"%d:%.8g ",p->index,p->value);
-				p++;
-			}
-		fprintf(fp, "\n");
-	}
-	if (ferror(fp) != 0 || fclose(fp) != 0) return -1;
-	else return 0;
-}
-
-static char *line = NULL;
-static int max_line_len;
-
-static char* readline(FILE *input)
-{
-	int len;
-
-	if(fgets(line,max_line_len,input) == NULL)
-		return NULL;
-
-	while(strrchr(line,'\n') == NULL)
-	{
-		max_line_len *= 2;
-		line = (char *) realloc(line,max_line_len);
-		len = (int) strlen(line);
-		if(fgets(line+len,max_line_len-len,input) == NULL)
-			break;
-	}
-	return line;
-}
-
-svm_model *svm_load_model(const char *model_file_name)
-{
-	FILE *fp = fopen(model_file_name,"rb");
-	if(fp==NULL) return NULL;
-	
-	// read parameters
-
-	svm_model *model = Malloc(svm_model,1);
-	svm_parameter& param = model->param;
-	model->rho = NULL;
-	model->probA = NULL;
-	model->probB = NULL;
-	model->label = NULL;
-	model->nSV = NULL;
-
-	char cmd[81];
-	while(1)
-	{
-		fscanf(fp,"%80s",cmd);
-
-		if(strcmp(cmd,"svm_type")==0)
-		{
-			fscanf(fp,"%80s",cmd);
-			int i;
-			for(i=0;svm_type_table[i];i++)
-			{
-				if(strcmp(svm_type_table[i],cmd)==0)
-				{
-					param.svm_type=i;
-					break;
-				}
-			}
-			if(svm_type_table[i] == NULL)
-			{
-				fprintf(stderr,"unknown svm type.\n");
-				free(model->rho);
-				free(model->label);
-				free(model->nSV);
-				free(model);
-				return NULL;
-			}
-		}
-		else if(strcmp(cmd,"kernel_type")==0)
-		{		
-			fscanf(fp,"%80s",cmd);
-			int i;
-			for(i=0;kernel_type_table[i];i++)
-			{
-				if(strcmp(kernel_type_table[i],cmd)==0)
-				{
-					param.kernel_type=i;
-					break;
-				}
-			}
-			if(kernel_type_table[i] == NULL)
-			{
-				fprintf(stderr,"unknown kernel function.\n");
-				free(model->rho);
-				free(model->label);
-				free(model->nSV);
-				free(model);
-				return NULL;
-			}
-		}
-		else if(strcmp(cmd,"degree")==0)
-			fscanf(fp,"%d",&param.degree);
-		else if(strcmp(cmd,"gamma")==0)
-			fscanf(fp,"%lf",&param.gamma);
-		else if(strcmp(cmd,"coef0")==0)
-			fscanf(fp,"%lf",&param.coef0);
-		else if(strcmp(cmd,"nr_class")==0)
-			fscanf(fp,"%d",&model->nr_class);
-		else if(strcmp(cmd,"total_sv")==0)
-			fscanf(fp,"%d",&model->l);
-		else if(strcmp(cmd,"rho")==0)
-		{
-			int n = model->nr_class * (model->nr_class-1)/2;
-			model->rho = Malloc(double,n);
-			for(int i=0;i<n;i++)
-				fscanf(fp,"%lf",&model->rho[i]);
-		}
-		else if(strcmp(cmd,"label")==0)
-		{
-			int n = model->nr_class;
-			model->label = Malloc(int,n);
-			for(int i=0;i<n;i++)
-				fscanf(fp,"%d",&model->label[i]);
-		}
-		else if(strcmp(cmd,"probA")==0)
-		{
-			int n = model->nr_class * (model->nr_class-1)/2;
-			model->probA = Malloc(double,n);
-			for(int i=0;i<n;i++)
-				fscanf(fp,"%lf",&model->probA[i]);
-		}
-		else if(strcmp(cmd,"probB")==0)
-		{
-			int n = model->nr_class * (model->nr_class-1)/2;
-			model->probB = Malloc(double,n);
-			for(int i=0;i<n;i++)
-				fscanf(fp,"%lf",&model->probB[i]);
-		}
-		else if(strcmp(cmd,"nr_sv")==0)
-		{
-			int n = model->nr_class;
-			model->nSV = Malloc(int,n);
-			for(int i=0;i<n;i++)
-				fscanf(fp,"%d",&model->nSV[i]);
-		}
-		else if(strcmp(cmd,"SV")==0)
-		{
-			while(1)
-			{
-				int c = getc(fp);
-				if(c==EOF || c=='\n') break;	
-			}
-			break;
-		}
-		else
-		{
-			fprintf(stderr,"unknown text in model file: [%s]\n",cmd);
-			free(model->rho);
-			free(model->label);
-			free(model->nSV);
-			free(model);
-			return NULL;
-		}
-	}
-
-	// read sv_coef and SV
-
-	int elements = 0;
-	long pos = ftell(fp);
-
-	max_line_len = 1024;
-	line = Malloc(char,max_line_len);
-	char *p,*endptr,*idx,*val;
-
-	while(readline(fp)!=NULL)
-	{
-		p = strtok(line,":");
-		while(1)
-		{
-			p = strtok(NULL,":");
-			if(p == NULL)
-				break;
-			++elements;
-		}
-	}
-	elements += model->l;
-
-	fseek(fp,pos,SEEK_SET);
-
-	int m = model->nr_class - 1;
-	int l = model->l;
-	model->sv_coef = Malloc(double *,m);
-	int i;
-	for(i=0;i<m;i++)
-		model->sv_coef[i] = Malloc(double,l);
-	model->SV = Malloc(svm_node*,l);
-	svm_node *x_space = NULL;
-	if(l>0) x_space = Malloc(svm_node,elements);
-
-	int j=0;
-	for(i=0;i<l;i++)
-	{
-		readline(fp);
-		model->SV[i] = &x_space[j];
-
-		p = strtok(line, " \t");
-		model->sv_coef[0][i] = strtod(p,&endptr);
-		for(int k=1;k<m;k++)
-		{
-			p = strtok(NULL, " \t");
-			model->sv_coef[k][i] = strtod(p,&endptr);
-		}
-
-		while(1)
-		{
-			idx = strtok(NULL, ":");
-			val = strtok(NULL, " \t");
-
-			if(val == NULL)
-				break;
-			x_space[j].index = (int) strtol(idx,&endptr,10);
-			x_space[j].value = strtod(val,&endptr);
-
-			++j;
-		}
-		x_space[j++].index = -1;
-	}
-	free(line);
-
-	if (ferror(fp) != 0 || fclose(fp) != 0)
-		return NULL;
-
-	model->free_sv = 1;	// XXX
-	return model;
-}
-
-void svm_free_model_content(svm_model* model_ptr)
-{
-	if(model_ptr->free_sv && model_ptr->l > 0 && model_ptr->SV != NULL)
-		free((void *)(model_ptr->SV[0]));
-	if(model_ptr->sv_coef)
-	{
-		for(int i=0;i<model_ptr->nr_class-1;i++)
-			free(model_ptr->sv_coef[i]);
-	}
-
-	free(model_ptr->SV);
-	model_ptr->SV = NULL;
-
-	free(model_ptr->sv_coef);
-	model_ptr->sv_coef = NULL;
-
-	free(model_ptr->rho);
-	model_ptr->rho = NULL;
-
-	free(model_ptr->label);
-	model_ptr->label= NULL;
-
-	free(model_ptr->probA);
-	model_ptr->probA = NULL;
-
-	free(model_ptr->probB);
-	model_ptr->probB= NULL;
-
-	free(model_ptr->nSV);
-	model_ptr->nSV = NULL;
-}
-
-void svm_free_and_destroy_model(svm_model** model_ptr_ptr)
-{
-	if(model_ptr_ptr != NULL && *model_ptr_ptr != NULL)
-	{
-		svm_free_model_content(*model_ptr_ptr);
-		free(*model_ptr_ptr);
-		*model_ptr_ptr = NULL;
-	}
-}
-
-void svm_destroy_param(svm_parameter* param)
-{
-	free(param->weight_label);
-	free(param->weight);
-}
-
-const char *svm_check_parameter(const svm_problem *prob, const svm_parameter *param)
-{
-	// svm_type
-
-	int svm_type = param->svm_type;
-	if(svm_type != C_SVC &&
-	   svm_type != NU_SVC &&
-	   svm_type != ONE_CLASS &&
-	   svm_type != EPSILON_SVR &&
-	   svm_type != NU_SVR)
-		return "unknown svm type";
-	
-	// kernel_type, degree
-	
-	int kernel_type = param->kernel_type;
-	if(kernel_type != LINEAR &&
-	   kernel_type != POLY &&
-	   kernel_type != RBF &&
-	   kernel_type != SIGMOID &&
-	   kernel_type != PRECOMPUTED)
-		return "unknown kernel type";
-
-	if(param->gamma < 0)
-		return "gamma < 0";
-
-	if(param->degree < 0)
-		return "degree of polynomial kernel < 0";
-
-	// cache_size,eps,C,nu,p,shrinking
-
-	if(param->cache_size <= 0)
-		return "cache_size <= 0";
-
-	if(param->eps <= 0)
-		return "eps <= 0";
-
-	if(svm_type == C_SVC ||
-	   svm_type == EPSILON_SVR ||
-	   svm_type == NU_SVR)
-		if(param->C <= 0)
-			return "C <= 0";
-
-	if(svm_type == NU_SVC ||
-	   svm_type == ONE_CLASS ||
-	   svm_type == NU_SVR)
-		if(param->nu <= 0 || param->nu > 1)
-			return "nu <= 0 or nu > 1";
-
-	if(svm_type == EPSILON_SVR)
-		if(param->p < 0)
-			return "p < 0";
-
-	if(param->shrinking != 0 &&
-	   param->shrinking != 1)
-		return "shrinking != 0 and shrinking != 1";
-
-	if(param->probability != 0 &&
-	   param->probability != 1)
-		return "probability != 0 and probability != 1";
-
-	if(param->probability == 1 &&
-	   svm_type == ONE_CLASS)
-		return "one-class SVM probability output not supported yet";
-
-
-	// check whether nu-svc is feasible
-	
-	if(svm_type == NU_SVC)
-	{
-		int l = prob->l;
-		int max_nr_class = 16;
-		int nr_class = 0;
-		int *label = Malloc(int,max_nr_class);
-		int *count = Malloc(int,max_nr_class);
-
-		int i;
-		for(i=0;i<l;i++)
-		{
-			int this_label = (int)prob->y[i];
-			int j;
-			for(j=0;j<nr_class;j++)
-				if(this_label == label[j])
-				{
-					++count[j];
-					break;
-				}
-			if(j == nr_class)
-			{
-				if(nr_class == max_nr_class)
-				{
-					max_nr_class *= 2;
-					label = (int *)realloc(label,max_nr_class*sizeof(int));
-					count = (int *)realloc(count,max_nr_class*sizeof(int));
-				}
-				label[nr_class] = this_label;
-				count[nr_class] = 1;
-				++nr_class;
-			}
-		}
-	
-		for(i=0;i<nr_class;i++)
-		{
-			int n1 = count[i];
-			for(int j=i+1;j<nr_class;j++)
-			{
-				int n2 = count[j];
-				if(param->nu*(n1+n2)/2 > min(n1,n2))
-				{
-					free(label);
-					free(count);
-					return "specified nu is infeasible";
-				}
-			}
-		}
-		free(label);
-		free(count);
-	}
-
-	return NULL;
-}
-
-int svm_check_probability_model(const svm_model *model)
-{
-	return ((model->param.svm_type == C_SVC || model->param.svm_type == NU_SVC) &&
-		model->probA!=NULL && model->probB!=NULL) ||
-		((model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) &&
-		 model->probA!=NULL);
-}
-
-void svm_set_print_string_function(void (*print_func)(const char *))
-{
-	if(print_func == NULL)
-		svm_print_string = &print_string_stdout;
-	else
-		svm_print_string = print_func;
-}
diff --git a/src/modules/imagery/imagery_svm/svm.h b/src/modules/imagery/imagery_svm/svm.h
deleted file mode 100644
index dbc5e08..0000000
--- a/src/modules/imagery/imagery_svm/svm.h
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef _LIBSVM_H
-#define _LIBSVM_H
-
-#define LIBSVM_VERSION 311
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int libsvm_version;
-
-struct svm_node
-{
-	int index;
-	double value;
-};
-
-struct svm_problem
-{
-	int l;
-	double *y;
-	struct svm_node **x;
-};
-
-enum { C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR };	/* svm_type */
-enum { LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED }; /* kernel_type */
-
-struct svm_parameter
-{
-	int svm_type;
-	int kernel_type;
-	int degree;	/* for poly */
-	double gamma;	/* for poly/rbf/sigmoid */
-	double coef0;	/* for poly/sigmoid */
-
-	/* these are for training only */
-	double cache_size; /* in MB */
-	double eps;	/* stopping criteria */
-	double C;	/* for C_SVC, EPSILON_SVR and NU_SVR */
-	int nr_weight;		/* for C_SVC */
-	int *weight_label;	/* for C_SVC */
-	double* weight;		/* for C_SVC */
-	double nu;	/* for NU_SVC, ONE_CLASS, and NU_SVR */
-	double p;	/* for EPSILON_SVR */
-	int shrinking;	/* use the shrinking heuristics */
-	int probability; /* do probability estimates */
-};
-
-//
-// svm_model
-// 
-struct svm_model
-{
-	struct svm_parameter param;	/* parameter */
-	int nr_class;		/* number of classes, = 2 in regression/one class svm */
-	int l;			/* total #SV */
-	struct svm_node **SV;		/* SVs (SV[l]) */
-	double **sv_coef;	/* coefficients for SVs in decision functions (sv_coef[k-1][l]) */
-	double *rho;		/* constants in decision functions (rho[k*(k-1)/2]) */
-	double *probA;		/* pariwise probability information */
-	double *probB;
-
-	/* for classification only */
-
-	int *label;		/* label of each class (label[k]) */
-	int *nSV;		/* number of SVs for each class (nSV[k]) */
-				/* nSV[0] + nSV[1] + ... + nSV[k-1] = l */
-	/* XXX */
-	int free_sv;		/* 1 if svm_model is created by svm_load_model*/
-				/* 0 if svm_model is created by svm_train */
-};
-
-struct svm_model *svm_train(const struct svm_problem *prob, const struct svm_parameter *param);
-void svm_cross_validation(const struct svm_problem *prob, const struct svm_parameter *param, int nr_fold, double *target);
-
-int svm_save_model(const char *model_file_name, const struct svm_model *model);
-struct svm_model *svm_load_model(const char *model_file_name);
-
-int svm_get_svm_type(const struct svm_model *model);
-int svm_get_nr_class(const struct svm_model *model);
-void svm_get_labels(const struct svm_model *model, int *label);
-double svm_get_svr_probability(const struct svm_model *model);
-
-double svm_predict_values(const struct svm_model *model, const struct svm_node *x, double* dec_values);
-double svm_predict(const struct svm_model *model, const struct svm_node *x);
-double svm_predict_probability(const struct svm_model *model, const struct svm_node *x, double* prob_estimates);
-
-void svm_free_model_content(struct svm_model *model_ptr);
-void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr);
-void svm_destroy_param(struct svm_parameter *param);
-
-const char *svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param);
-int svm_check_probability_model(const struct svm_model *model);
-
-void svm_set_print_string_function(void (*print_func)(const char *));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LIBSVM_H */
diff --git a/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp b/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp
index 7a2ab0b..56c97da 100644
--- a/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp
+++ b/src/modules/imagery/imagery_vigra/vigra_random_forest.cpp
@@ -71,7 +71,7 @@
 //---------------------------------------------------------
 #if !defined(VIGRA_VERSION_MAJOR) || VIGRA_VERSION_MAJOR < 1 || VIGRA_VERSION_MINOR < 10
 // define some dummies
-#include <vigra\matrix.hxx>
+#include <vigra/matrix.hxx>
 class CRandom_Forest
 {
 public:
diff --git a/src/modules/io/io_gdal/gdal_driver.cpp b/src/modules/io/io_gdal/gdal_driver.cpp
index eabd372..07c041f 100644
--- a/src/modules/io/io_gdal/gdal_driver.cpp
+++ b/src/modules/io/io_gdal/gdal_driver.cpp
@@ -260,6 +260,8 @@ bool CSG_GDAL_DataSet::Open_Read(const CSG_String &File_Name)
 	//-----------------------------------------------------
 	double	Transform[6];
 
+	m_File_Name	= File_Name;
+
 	m_Access	= SG_GDAL_IO_READ;
 
 	m_NX		= m_pDataSet->GetRasterXSize();
@@ -299,37 +301,38 @@ bool CSG_GDAL_DataSet::Open_Read(const CSG_String &File_Name)
 }
 
 //---------------------------------------------------------
-bool CSG_GDAL_DataSet::Open_Write(const CSG_String &File_Name, const CSG_String &Driver, const CSG_String &Options,TSG_Data_Type Type, int NBands, const CSG_Grid_System &System, const CSG_Projection &Projection)
+bool CSG_GDAL_DataSet::Open_Write(const CSG_String &File_Name, const CSG_String &Driver, const CSG_String &Options, TSG_Data_Type Type, int NBands, const CSG_Grid_System &System, const CSG_Projection &Projection)
 {
-	char		**pOptions 	= NULL;
-	char		**pTokens 	= NULL;	
-	GDALDriver	*pDriver;
+	Close();
+
+	//--------------------------------------------------------
+	char	**pOptions	= NULL;
 	
-	if (!Options.is_Empty()){
-	  pTokens = CSLTokenizeString2( Options, " ", CSLT_STRIPLEADSPACES);
+	if( !Options.is_Empty() )
+	{
+		char	**pTokens	= CSLTokenizeString2(Options, " ", CSLT_STRIPLEADSPACES);
 	  
-	  for( int i = 0; pTokens != NULL && pTokens[i] != NULL; i++ ){
-	    pOptions = CSLAddString( pOptions,  pTokens[i] );
-	  }
+		for(int i=0; pTokens && pTokens[i]; i++)
+		{
+			pOptions	= CSLAddString(pOptions, pTokens[i]);
+		}
 	}
-	
-	Close();
-	
-	
 
 	//--------------------------------------------------------
+	GDALDriver	*pDriver;
+
 	if( (pDriver = gSG_GDAL_Drivers.Get_Driver(Driver)) == NULL )
 	{
 		SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("driver not found."), Driver.c_str()));
 
 		return( false );
 	}
-	
-	if( !GDALValidateCreationOptions (pDriver, pOptions))
+
+	if( !GDALValidateCreationOptions(pDriver, pOptions) )
 	{
-	  SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("Creation option(s) not supported by the driver"), Options.c_str() ));
-	  
-	  return false;
+		SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("Creation option(s) not supported by the driver"), Options.c_str()));
+
+		return( false );
 	}
 
 	if( CSLFetchBoolean(pDriver->GetMetadata(), GDAL_DCAP_CREATE, false) == false )
@@ -347,6 +350,8 @@ bool CSG_GDAL_DataSet::Open_Write(const CSG_String &File_Name, const CSG_String
 	}
 
 	//--------------------------------------------------------
+	m_File_Name	= File_Name;
+
 	m_Access	= SG_GDAL_IO_WRITE;
 
 	if( Projection.is_Okay() )
@@ -383,17 +388,19 @@ bool CSG_GDAL_DataSet::Close(void)
 		m_pDataSet	= NULL;
 	}
 
+	m_File_Name.Clear();
+
 	m_Access	= SG_GDAL_IO_CLOSED;
 
-	
-	if (strlen(CPLGetLastErrorMsg()) > 3)
+	if( strlen(CPLGetLastErrorMsg()) > 3 )
 	{
-	      SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"),_TL("Dataset creation failed") , SG_STR_MBTOSG(CPLGetLastErrorMsg())));
-	      CPLErrorReset();
-	      
-	      return false;
+		SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("Dataset creation failed"), SG_STR_MBTOSG(CPLGetLastErrorMsg())));
+
+		CPLErrorReset();
+
+		return( false );
 	}
-	
+
 	return( true );
 }
 
@@ -433,6 +440,12 @@ CSG_String CSG_GDAL_DataSet::Get_Description(void)	const
 }
 
 //---------------------------------------------------------
+CSG_String CSG_GDAL_DataSet::Get_File_Name(void)	const
+{
+	return( m_File_Name );
+}
+
+//---------------------------------------------------------
 const char * CSG_GDAL_DataSet::Get_MetaData_Item(const char *pszName, const char *pszDomain)	const
 {
 	return( m_pDataSet ? m_pDataSet->GetMetadataItem(pszName, pszDomain) : "" );
@@ -885,8 +898,8 @@ bool CSG_GDAL_DataSet::Get_Transformation(CSG_Grid **ppGrid, TSG_Grid_Interpolat
 			double		z;
 			CSG_Vector	vWorld(2), vImage;
 
-			vWorld[0]	= pWorld->Get_XMin() + x * pWorld->Get_Cellsize();
-			vWorld[1]	= pWorld->Get_YMin() + y * pWorld->Get_Cellsize();
+			vWorld[0]	= pWorld->Get_XMin() + (x - 0.5) * pWorld->Get_Cellsize();
+			vWorld[1]	= pWorld->Get_YMin() + (y + 0.5) * pWorld->Get_Cellsize();
 
 			vImage	= BInv * (vWorld - A);
 
diff --git a/src/modules/io/io_gdal/gdal_driver.h b/src/modules/io/io_gdal/gdal_driver.h
index 788e1ae..db01762 100644
--- a/src/modules/io/io_gdal/gdal_driver.h
+++ b/src/modules/io/io_gdal/gdal_driver.h
@@ -149,6 +149,7 @@ public:
 	CSG_String					Get_DriverID		(void)	const;
 	CSG_String					Get_Name			(void)	const;
 	CSG_String					Get_Description		(void)	const;
+	CSG_String					Get_File_Name		(void)	const;
 	const char *				Get_Projection		(void)	const;
 	const char *				Get_MetaData_Item	(const char *pszName, const char *pszDomain = "")							const;
 	const char **				Get_MetaData		(const char *pszDomain = "")												const;
@@ -175,6 +176,8 @@ private:
 
 	double						m_xMin, m_yMin, m_Cellsize;
 
+	CSG_String					m_File_Name;
+
 	CSG_Vector					m_TF_A;
 
 	CSG_Matrix					m_TF_B, m_TF_BInv;
diff --git a/src/modules/io/io_gdal/gdal_import.cpp b/src/modules/io/io_gdal/gdal_import.cpp
index 99ae9e7..0755912 100644
--- a/src/modules/io/io_gdal/gdal_import.cpp
+++ b/src/modules/io/io_gdal/gdal_import.cpp
@@ -391,10 +391,18 @@ bool CGDAL_Import::Load(CSG_GDAL_DataSet &DataSet, const CSG_String &Name)
 					: Name.c_str()
 				);
 
+				pGrid->Set_File_Name(DataSet.Get_File_Name());
+
 				m_pGrids->Add_Item(pGrid);
 
 				DataObject_Add			(pGrid);
 				DataObject_Set_Colors	(pGrid, CSG_Colors(11, SG_COLORS_BLACK_WHITE, false));
+
+				if( DataSet.Get_Count() == 1 )
+				{
+					pGrid->Set_File_Name(DataSet.Get_File_Name());
+					pGrid->Get_MetaData().Add_Child("GDAL_DRIVER", DataSet.Get_DriverID());
+				}
 			}
 		}
     }
diff --git a/src/modules/io/io_grid_image/MLB_Interface.cpp b/src/modules/io/io_grid_image/MLB_Interface.cpp
index 4ccb281..e7a9c6a 100644
--- a/src/modules/io/io_grid_image/MLB_Interface.cpp
+++ b/src/modules/io/io_grid_image/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2542 2015-07-15 12:31:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -109,12 +109,13 @@ CSG_Module *		Create_Module(int i)
 {
 	switch( i )
 	{
-	case 0:	return( new CGrid_Export );
-	case 1:	return( new CGrid_Import );
-	case 2:	return( new CGrid_to_KML );
-	}
+	case  0:	return( new CGrid_Export );
+	case  1:	return( new CGrid_Import );
+	case  2:	return( new CGrid_to_KML );
+	case  3:	return( new CGrid_from_KML );
 
-	return( NULL );
+	default:	return( NULL );
+	}
 }
 
 
diff --git a/src/modules/io/io_grid_image/grid_export.cpp b/src/modules/io/io_grid_image/grid_export.cpp
index 4c6e216..9aac83b 100644
--- a/src/modules/io/io_grid_image/grid_export.cpp
+++ b/src/modules/io/io_grid_image/grid_export.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_export.cpp 2533 2015-07-02 11:47:01Z oconrad $
+ * Version $Id: grid_export.cpp 2542 2015-07-15 12:31:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -537,29 +537,26 @@ bool CGrid_Export::On_Execute(void)
 	}
 
 	//-----------------------------------------------------
-	if( Parameters("FILE_KML")->asBool() && Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("kml")), SG_FILE_W, false) )
+	if( Parameters("FILE_KML")->asBool() )
 	{
-		Stream.Printf(SG_T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));
-		Stream.Printf(SG_T("<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n"));
-		Stream.Printf(SG_T("  <Folder>\n"));
-		Stream.Printf(SG_T("    <name>Raster exported from SAGA</name>\n"));
-		Stream.Printf(SG_T("    <description>System for Automated Geoscientific Analyses - www.saga-gis.org</description>\n"));
-		Stream.Printf(SG_T("    <GroundOverlay>\n"));
-		Stream.Printf(SG_T("      <name>%s</name>\n")				, pGrid->Get_Name());
-		Stream.Printf(SG_T("      <description>%s</description>\n")	, pGrid->Get_Description());
-		Stream.Printf(SG_T("      <Icon>\n"));
-		Stream.Printf(SG_T("        <href>%s</href>\n")				, SG_File_Get_Name(fName, true).c_str());
-		Stream.Printf(SG_T("      </Icon>\n"));
-		Stream.Printf(SG_T("      <LatLonBox>\n"));
-		Stream.Printf(SG_T("        <north>%.10f</north>\n")			, pGrid->Get_YMax());
-		Stream.Printf(SG_T("        <south>%.10f</south>\n")			, pGrid->Get_YMin());
-		Stream.Printf(SG_T("        <east>%.10f</east>\n")				, pGrid->Get_XMax());
-		Stream.Printf(SG_T("        <west>%.10f</west>\n")				, pGrid->Get_XMin());
-		Stream.Printf(SG_T("        <rotation>0.0</rotation>\n"));
-		Stream.Printf(SG_T("      </LatLonBox>\n"));
-		Stream.Printf(SG_T("    </GroundOverlay>\n"));
-		Stream.Printf(SG_T("  </Folder>\n"));
-		Stream.Printf(SG_T("</kml>\n"));
+		CSG_MetaData	KML;	KML.Set_Name("kml");	KML.Add_Property("xmlns", "http://www.opengis.net/kml/2.2");
+
+	//	CSG_MetaData	*pFolder	= KML.Add_Child("Folder");
+	//	pFolder->Add_Child("name"       , "Raster exported from SAGA");
+	//	pFolder->Add_Child("description", "System for Automated Geoscientific Analyses - www.saga-gis.org");
+	//	CSG_MetaData	*pOverlay	= pFolder->Add_Child("GroundOverlay");
+
+		CSG_MetaData	*pOverlay	= KML.Add_Child("GroundOverlay");
+		pOverlay->Add_Child("name"       , pGrid->Get_Name());
+		pOverlay->Add_Child("description", pGrid->Get_Description());
+		pOverlay->Add_Child("Icon"       )->Add_Child("href", SG_File_Get_Name(fName, true));
+		pOverlay->Add_Child("LatLonBox"  );
+		pOverlay->Get_Child("LatLonBox"  )->Add_Child("north", pGrid->Get_YMax());
+		pOverlay->Get_Child("LatLonBox"  )->Add_Child("south", pGrid->Get_YMin());
+		pOverlay->Get_Child("LatLonBox"  )->Add_Child("east" , pGrid->Get_XMax());
+		pOverlay->Get_Child("LatLonBox"  )->Add_Child("west" , pGrid->Get_XMin());
+
+		KML.Save(fName, SG_T("kml"));
 	}
 
 	//-----------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_to_kml.cpp b/src/modules/io/io_grid_image/grid_to_kml.cpp
index 8ce9429..e237d80 100644
--- a/src/modules/io/io_grid_image/grid_to_kml.cpp
+++ b/src/modules/io/io_grid_image/grid_to_kml.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_to_kml.cpp 2533 2015-07-02 11:47:01Z oconrad $
+ * Version $Id: grid_to_kml.cpp 2543 2015-07-27 13:48:24Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -235,10 +235,12 @@ int CGrid_to_KML::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Paramete
 		pParameters->Get_Parameter("SHADE_BRIGHT")->Set_Enabled(pParameter->asGrid() != NULL);
 	}
 
-	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "GRID") )
+	if(	!SG_STR_CMP(pParameter->Get_Identifier(), "GRID") || !SG_STR_CMP(pParameter->Get_Identifier(), "COLOURING") )
 	{
-		pParameters->Get_Parameter("INTERPOL")->Set_Enabled(pParameter->asGrid()
-			&& pParameter->asGrid()->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Projected
+		CSG_Grid	*pGrid	= pParameters->Get_Parameter("GRID")->asGrid();
+
+		pParameters->Get_Parameter("INTERPOL")->Set_Enabled(
+			pGrid && pGrid->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Projected && pParameters->Get_Parameter("COLOURING")->asInt() < 4
 		);
 	}
 
@@ -273,6 +275,8 @@ bool CGrid_to_KML::On_Execute(void)
 			return( false );
 		}
 
+		Image.Set_Name       (pGrid->Get_Name       ());
+		Image.Set_Description(pGrid->Get_Description());
 		Image.Flip();
 		pGrid	= &Image;
 		Method	= 4;	// rgb coded values
@@ -295,7 +299,7 @@ bool CGrid_to_KML::On_Execute(void)
 		pModule->Settings_Push();
 
 		if( pModule->Set_Parameter("CRS_PROJ4"    , SG_T("+proj=longlat +ellps=WGS84 +datum=WGS84"))
-		&&  pModule->Set_Parameter("INTERPOLATION", Parameters("INTERPOL")->asBool() ? 4 : 0)
+		&&  pModule->Set_Parameter("INTERPOLATION", Method < 4 && Parameters("INTERPOL")->asBool() ? 4 : 0)
 		&&  pModule->Set_Parameter("SOURCE"       , pGrid)
 		&&  pModule->Execute() )
 		{
@@ -377,7 +381,7 @@ bool CGrid_to_KML::On_Execute(void)
 	if( Parameters("OUTPUT")->asInt() != 0 )	// create kmz
 	{
 		CSG_String	Filename	= Parameters("FILE")->asString();	SG_File_Set_Extension(Filename, "kmz");
-		
+
 		wxDir		dir;
 		wxString	file;
 
@@ -424,3 +428,204 @@ bool CGrid_to_KML::On_Execute(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+CGrid_from_KML::CGrid_from_KML(void)
+{
+	Set_Name		(_TL("Import Grids from KML"));
+
+	Set_Author		("O.Conrad (c) 2015");
+
+	Set_Description	(_TW(
+		"Uses 'Import Image' tool to load the ground overlay image files associated with the kml. "
+	));
+
+	Parameters.Add_Grid_List(
+		NULL	, "GRIDS"		, _TL("Grids"),
+		_TL(""),
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_FilePath(
+		NULL	, "FILE"		, _TL("KML/KMZ File"),
+		_TL(""),
+		CSG_String::Format("%s|%s",
+			_TL("KML/KMZ Files"), SG_T("*.kml;*.kmz"),
+			_TL("All Files"    ), SG_T("*.*")
+		), NULL, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_from_KML::On_Execute(void)
+{
+	//-----------------------------------------------------
+	wxString	Dir, File	= Parameters("FILE")->asString();
+
+	//-----------------------------------------------------
+	bool	bKMZ	= SG_File_Cmp_Extension(File, SG_T("kmz"));
+
+	if( !bKMZ )
+	{
+		Dir	= SG_File_Get_Path(File).c_str();
+	}
+	else	// unzip to temporary directory
+	{
+		Dir	= wxFileName::CreateTempFileName("kml_");
+
+		wxRemoveFile(Dir);
+		wxFileName::Mkdir(Dir);
+
+		wxZipEntry			*pEntry;
+		wxZipInputStream	Zip(new wxFileInputStream(File));
+
+		while( (pEntry = Zip.GetNextEntry()) != NULL )
+		{
+			wxFileName	fn(Dir, pEntry->GetName());
+
+			wxFileOutputStream	*pOutput	= new wxFileOutputStream(fn.GetFullPath());
+
+			pOutput->Write(Zip);
+
+			delete(pOutput);
+			delete(pEntry);
+
+			if( !fn.GetExt().CmpNoCase("kml") )
+			{
+				File	= fn.GetFullPath();
+			}
+		}
+	}
+
+	//-----------------------------------------------------
+	CSG_MetaData	KML;
+
+	if( !KML.Load(&File) )
+	{
+		Error_Fmt("%s [%s]", _TL("failed to load file"), File.wc_str());
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	m_pGrids	= Parameters("GRIDS")->asGridList();
+	m_pGrids->Del_Items();
+
+	Load_KML(Dir, KML);
+
+	//-----------------------------------------------------
+	if( bKMZ && wxDirExists(Dir) )
+	{
+		wxFileName::Rmdir(Dir, wxPATH_RMDIR_FULL|wxPATH_RMDIR_RECURSIVE);
+	}
+
+	//-----------------------------------------------------
+	return( m_pGrids->Get_Count() > 0 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CGrid_from_KML::Load_KML(const SG_Char *Dir, const CSG_MetaData &KML)
+{
+	for(int i=0; i<KML.Get_Children_Count(); i++)
+	{
+		if( KML.Get_Child(i)->Cmp_Name("GroundOverlay") )
+		{
+			Load_Overlay(Dir, *KML.Get_Child(i));
+		}
+		else
+		{
+			Load_KML    (Dir, *KML.Get_Child(i));
+		}
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+bool CGrid_from_KML::Load_Overlay(const SG_Char *Dir, const CSG_MetaData &KML)
+{
+	//-----------------------------------------------------
+	if( !KML("Icon") || !KML["Icon"]("HRef") )
+	{
+		Error_Set(_TL("missing icon tags"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	CSG_Rect	r;
+
+	if(    !KML("LatLonBox")
+		|| !KML["LatLonBox"]("North") || !KML["LatLonBox"]["North"].Get_Content().asDouble(r.m_rect.yMax)
+		|| !KML["LatLonBox"]("South") || !KML["LatLonBox"]["South"].Get_Content().asDouble(r.m_rect.yMin)
+		|| !KML["LatLonBox"]("East" ) || !KML["LatLonBox"]["East" ].Get_Content().asDouble(r.m_rect.xMax)
+		|| !KML["LatLonBox"]("West" ) || !KML["LatLonBox"]["West" ].Get_Content().asDouble(r.m_rect.xMin) )
+	{
+		Error_Set(_TL("failed to load georeference for KML ground overlay"));
+
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	wxFileName	fn(KML["Icon"]["HRef"].Get_Content().c_str());
+
+	if( !fn.FileExists() )
+	{
+		fn.SetPath(Dir);
+	}
+
+	CSG_Data_Manager	Data;
+	CSG_String			FullPath = fn.GetFullPath().wc_str();
+
+	if( !Data.Add(FullPath) || !Data.Get_Grid_System(0) || !Data.Get_Grid_System(0)->Get(0) )
+	{
+		Error_Fmt("%s: %s", _TL("failed to load KML ground overlay icon"), fn.GetFullPath().wc_str());
+	}
+
+	//-----------------------------------------------------
+	CSG_Grid	*pIcon	= (CSG_Grid *)Data.Get_Grid_System(0)->Get(0);
+
+	CSG_Grid	*pGrid	= SG_Create_Grid(pIcon->Get_Type(), pIcon->Get_NX(), pIcon->Get_NY(), r.Get_YRange() / (pIcon->Get_NY() - 1), r.Get_XMin(), r.Get_YMin());
+
+	if( KML("Name") && !KML["Name"].Get_Content().is_Empty() )
+		pGrid->Set_Name(KML["Name"].Get_Content());
+
+	if( KML("Description") && !KML["Description"].Get_Content().is_Empty() )
+		pGrid->Set_Name(KML["Description"].Get_Content());
+
+	pGrid->Get_Projection().Assign("+proj=longlat +ellps=WGS84 +datum=WGS84", SG_PROJ_FMT_Proj4);
+
+	#pragma omp parallel for
+	for(int y=0; y<pGrid->Get_NY(); y++)
+	{
+		for(int x=0; x<pGrid->Get_NX(); x++)
+		{
+			pGrid->Set_Value(x, y, pIcon->asDouble(x, y));
+		}
+	}
+
+	m_pGrids->Add_Item(pGrid);
+
+	DataObject_Add(pGrid);
+	DataObject_Set_Parameter(pGrid, "COLORS_TYPE", 6);	// Color Classification Type: RGB
+
+	//-----------------------------------------------------
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/io/io_grid_image/grid_to_kml.h b/src/modules/io/io_grid_image/grid_to_kml.h
index cd444eb..6d3f7dd 100644
--- a/src/modules/io/io_grid_image/grid_to_kml.h
+++ b/src/modules/io/io_grid_image/grid_to_kml.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_to_kml.h 2089 2014-04-04 12:37:27Z reklov_w $
+ * Version $Id: grid_to_kml.h 2542 2015-07-15 12:31:48Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -103,6 +103,35 @@ private:
 
 ///////////////////////////////////////////////////////////
 //														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CGrid_from_KML : public CSG_Module
+{
+public:
+	CGrid_from_KML(void);
+
+	virtual CSG_String		Get_MenuPath			(void)	{	return( _TL("R:Import") );	}
+
+
+protected:
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	CSG_Parameter_Grid_List	*m_pGrids;
+
+
+	bool					Load_KML				(const SG_Char *Dir, const CSG_MetaData &KML);
+	bool					Load_Overlay			(const SG_Char *Dir, const CSG_MetaData &KML);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
 //														 //
 //														 //
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
index 0d398cf..ba16539 100644
--- a/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
+ * Version $Id: MLB_Interface.cpp 2562 2015-08-30 10:50:30Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -70,11 +70,11 @@ CSG_String Get_Info(int i)
 	case MLB_INFO_Name:	default:
 		return( _TL("Point Clouds") );
 
-	case MLB_INFO_Category:
-		return( _TL("Shapes") );
-
+	case MLB_INFO_Category:
+		return( _TL("Shapes") );
+
 	case MLB_INFO_Author:
-		return( SG_T("O.Conrad, V.Wichmann, M.Bremer (c) 2009-12") );
+		return( SG_T("O.Conrad, V.Wichmann, M.Bremer (c) 2009-15") );
 
 	case MLB_INFO_Description:
 		return( _TL("Tools for point clouds.") );
@@ -95,6 +95,7 @@ CSG_String Get_Info(int i)
 #include "pc_drop_attribute.h"
 #include "pc_from_grid.h"
 #include "pc_from_shapes.h"
+#include "pc_from_table.h"
 #include "pc_merge.h"
 #include "pc_reclass_extract.h"
 #include "pc_thinning_simple.h"
@@ -121,6 +122,7 @@ CSG_Module *		Create_Module(int i)
 	case 10:	return( new CPC_Attribute_Calculator );
 	case 11:	return( new CPC_Cluster_Analysis );
 	case 12:	return( new CPC_Merge );
+	case 13:	return( new CPC_From_Table );
 	}
 
 	return( NULL );
diff --git a/src/modules/pointcloud/pointcloud_tools/Makefile.am b/src/modules/pointcloud/pointcloud_tools/Makefile.am
index a666637..457e925 100644
--- a/src/modules/pointcloud/pointcloud_tools/Makefile.am
+++ b/src/modules/pointcloud/pointcloud_tools/Makefile.am
@@ -22,6 +22,7 @@ pc_cut.cpp\
 pc_drop_attribute.cpp\
 pc_from_grid.cpp\
 pc_from_shapes.cpp\
+pc_from_table.cpp\
 pc_merge.cpp\
 pc_reclass_extract.cpp\
 pc_thinning_simple.cpp\
@@ -35,6 +36,7 @@ pc_cut.h\
 pc_drop_attribute.h\
 pc_from_grid.h\
 pc_from_shapes.h\
+pc_from_table.h\
 pc_merge.h\
 pc_reclass_extract.h\
 pc_thinning_simple.h\
diff --git a/src/modules/pointcloud/pointcloud_tools/Makefile.in b/src/modules/pointcloud/pointcloud_tools/Makefile.in
index ccdb7cb..5f16d56 100644
--- a/src/modules/pointcloud/pointcloud_tools/Makefile.in
+++ b/src/modules/pointcloud/pointcloud_tools/Makefile.in
@@ -130,8 +130,9 @@ libpointcloud_tools_la_DEPENDENCIES =  \
 am_libpointcloud_tools_la_OBJECTS = MLB_Interface.lo \
 	pc_attribute_calculator.lo pc_cluster_analysis.lo pc_cut.lo \
 	pc_drop_attribute.lo pc_from_grid.lo pc_from_shapes.lo \
-	pc_merge.lo pc_reclass_extract.lo pc_thinning_simple.lo \
-	pc_to_grid.lo pc_to_shapes.lo pc_transform.lo
+	pc_from_table.lo pc_merge.lo pc_reclass_extract.lo \
+	pc_thinning_simple.lo pc_to_grid.lo pc_to_shapes.lo \
+	pc_transform.lo
 libpointcloud_tools_la_OBJECTS = $(am_libpointcloud_tools_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -382,6 +383,7 @@ pc_cut.cpp\
 pc_drop_attribute.cpp\
 pc_from_grid.cpp\
 pc_from_shapes.cpp\
+pc_from_table.cpp\
 pc_merge.cpp\
 pc_reclass_extract.cpp\
 pc_thinning_simple.cpp\
@@ -395,6 +397,7 @@ pc_cut.h\
 pc_drop_attribute.h\
 pc_from_grid.h\
 pc_from_shapes.h\
+pc_from_table.h\
 pc_merge.h\
 pc_reclass_extract.h\
 pc_thinning_simple.h\
@@ -489,6 +492,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_drop_attribute.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_from_grid.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_from_shapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_from_table.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_merge.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_reclass_extract.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_thinning_simple.Plo at am__quote@
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
index 36f4308..39320a4 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_from_shapes.cpp 2570 2015-09-03 10:16:20Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -120,16 +120,18 @@ CPC_From_Shapes::CPC_From_Shapes(void)
 //---------------------------------------------------------
 bool CPC_From_Shapes::On_Execute(void)
 {
-	int				zField, iField, nFields, *Fields;
+	int				zField, nFields, *Fields;
 	CSG_PointCloud	*pPoints;
 	CSG_Shapes		*pShapes;
 
-	pShapes	= Parameters("SHAPES")	->asShapes();
-	pPoints	= Parameters("POINTS")	->asPointCloud();
-	zField	= Parameters("ZFIELD")	->asInt();
+	pShapes	= Parameters("SHAPES")->asShapes();
+	pPoints	= Parameters("POINTS")->asPointCloud();
+	zField	= Parameters("ZFIELD")->asInt();
 
 	if( !pShapes->is_Valid() )
 	{
+		Error_Set(_TL("invalid input"));
+
 		return( false );
 	}
 
@@ -140,14 +142,13 @@ bool CPC_From_Shapes::On_Execute(void)
 	nFields	= 0;
 	Fields	= new int[pShapes->Get_Field_Count()];
 
-	if( Parameters("OUTPUT")->asInt() == 1 )
+	if( Parameters("OUTPUT")->asInt() == 1 )	// all attributes
 	{
-		for(iField=0, nFields=0; iField<pShapes->Get_Field_Count(); iField++)
+		for(int iField=0; iField<pShapes->Get_Field_Count(); iField++)
 		{
-			if( iField != zField && SG_Data_Type_Get_Size(pShapes->Get_Field_Type(iField)) > 0 )
+			if( iField != zField && pPoints->Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField)) )
 			{
 				Fields[nFields++]	= iField;
-				pPoints->Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField));
 			}
 		}
 	}
@@ -165,16 +166,26 @@ bool CPC_From_Shapes::On_Execute(void)
 
 				pPoints->Add_Point(p.x, p.y, zField < 0 ? pShape->Get_Z(iPoint, iPart) : pShape->asDouble(zField));
 
-				for(iField=0; iField<nFields; iField++)
+				for(int iField=0, jField=3; iField<nFields; iField++, jField++)
 				{
-					pPoints->Set_Value(3 + iField, pShape->asDouble(Fields[iField]));
+					switch( pPoints->Get_Field_Type(jField) )
+					{
+					case SG_DATATYPE_Date:
+					case SG_DATATYPE_String:
+						pPoints->Set_Value(jField, pShape->asString(Fields[iField]));
+						break;
+
+					default:
+						pPoints->Set_Value(jField, pShape->asDouble(Fields[iField]));
+						break;
+					}
 				}
 			}
 		}
 	}
 
 	//-----------------------------------------------------
-	delete [] Fields;
+	delete[](Fields);
 
 	return( pPoints->Get_Count() > 0 );
 }
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
index ea810a2..98ebb3b 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_from_shapes.h 2570 2015-09-03 10:16:20Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp b/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
similarity index 54%
copy from src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
copy to src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
index 36f4308..d94e725 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_table.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_from_table.cpp 2570 2015-09-03 10:16:20Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -13,10 +13,10 @@
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                   pc_from_shapes.cpp                  //
+//                   pc_from_table.cpp                   //
 //                                                       //
-//                 Copyright (C) 2009 by                 //
-//                      Olaf Conrad                      //
+//                 Copyright (C) 2015 by                 //
+//                    Volker Wichmann                    //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
@@ -40,12 +40,13 @@
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
+//    e-mail:     wichmann at laserdata                     //
 //                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
+//    contact:    Volker Wichmann                        //
+//                LASERDATA GmbH                         //
+//                Management and analysis of             //
+//                laserscanning data                     //
+//                Innsbruck, Austria                     //
 //                                                       //
 ///////////////////////////////////////////////////////////
 
@@ -59,7 +60,7 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#include "pc_from_shapes.h"
+#include "pc_from_table.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -69,45 +70,51 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CPC_From_Shapes::CPC_From_Shapes(void)
+CPC_From_Table::CPC_From_Table(void)
 {
-	//-----------------------------------------------------
-	Set_Name		(_TL("Point Cloud from Shapes"));
+	Set_Name		(_TL("Point Cloud from Table"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2009"));
+	Set_Author		(SG_T("V. Wichmann (c) 2015"));
 
-	Set_Description	(_TW(
-		""
+	Set_Description	(_TW(		
+		"This tool allows one to create a point cloud from a table.\n\n"
 	));
 
 
 	//-----------------------------------------------------
-	CSG_Parameter	*pNode	= Parameters.Add_Shapes(
-		NULL	, "SHAPES"		, _TL("Shapes"),
-		_TL(""),
+
+	CSG_Parameter *pNode = Parameters.Add_Table(
+		NULL	, "TAB_IN"		,_TL("Table"),
+		_TL("The input table."),
 		PARAMETER_INPUT
 	);
 
 	Parameters.Add_Table_Field(
-		pNode	, "ZFIELD"		, _TL("Z Value"),
-		_TL(""),
-		true
+		pNode	, "FIELD_X"		, _TL("X"),
+		_TL("The attribute field with the x-coordinate.")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD_Y"		, _TL("Y"),
+		_TL("The attribute field with the y-coordinate.")
+	);
+
+	Parameters.Add_Table_Field(
+		pNode	, "FIELD_Z"		, _TL("Z"),
+		_TL("The attribute field with the z-coordinate.")
+	);
+
+	Parameters.Add_Table_Fields(
+		pNode	, "FIELDS"		, _TL("Attributes"),
+		_TL("The attribute fields to convert, optional.")
 	);
 
 	Parameters.Add_PointCloud(
-		NULL	, "POINTS"		, _TL("Points"),
-		_TL(""),
+		NULL	, "PC_OUT"		,_TL("Point Cloud"),
+		_TL("The output point cloud."),
 		PARAMETER_OUTPUT
 	);
 
-	Parameters.Add_Choice(
-		NULL	, "OUTPUT"		, _TL("Output"),
-		_TL(""),
-		CSG_String::Format(SG_T("%s|%s|"),
-			_TL("only z"),
-			_TL("all attributes")
-		), 0
-	);
 }
 
 
@@ -118,65 +125,78 @@ CPC_From_Shapes::CPC_From_Shapes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CPC_From_Shapes::On_Execute(void)
+bool CPC_From_Table::On_Execute(void)
 {
-	int				zField, iField, nFields, *Fields;
+	CSG_Table		*pTable;
+	int				iFieldX, iFieldY, iFieldZ;
+	int				*Features, nFeatures;
 	CSG_PointCloud	*pPoints;
-	CSG_Shapes		*pShapes;
 
-	pShapes	= Parameters("SHAPES")	->asShapes();
-	pPoints	= Parameters("POINTS")	->asPointCloud();
-	zField	= Parameters("ZFIELD")	->asInt();
+	//-----------------------------------------------------
 
-	if( !pShapes->is_Valid() )
-	{
-		return( false );
-	}
+	pTable		= Parameters("TAB_IN")->asTable();
+	iFieldX		= Parameters("FIELD_X")->asInt();
+	iFieldY		= Parameters("FIELD_Y")->asInt();
+	iFieldZ		= Parameters("FIELD_Z")->asInt();
+
+	Features	= (int *)Parameters("FIELDS")->asPointer();
+	nFeatures	=        Parameters("FIELDS")->asInt    ();
+
+	pPoints		= Parameters("PC_OUT")->asPointCloud();
 
 	//-----------------------------------------------------
-	pPoints->Create();
-	pPoints->Set_Name(pShapes->Get_Name());
 
-	nFields	= 0;
-	Fields	= new int[pShapes->Get_Field_Count()];
+	pPoints->Create();
+	pPoints->Set_Name(CSG_String::Format(SG_T("%s_pc"), pTable->Get_Name()));
 
-	if( Parameters("OUTPUT")->asInt() == 1 )
+	for( int j=0; j<nFeatures; j++ )
 	{
-		for(iField=0, nFields=0; iField<pShapes->Get_Field_Count(); iField++)
+		TSG_Data_Type	Data_Type;
+
+		switch( pTable->Get_Field_Type(Features[j]) )
 		{
-			if( iField != zField && SG_Data_Type_Get_Size(pShapes->Get_Field_Type(iField)) > 0 )
-			{
-				Fields[nFields++]	= iField;
-				pPoints->Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField));
-			}
+		case SG_DATATYPE_Undefined:
+		case SG_DATATYPE_Binary:
+			SG_UI_Msg_Add_Error(_TL("Undefined or binary attribute field types are not supported!"));
+			return( false );
+
+		case SG_DATATYPE_Date:
+		case SG_DATATYPE_String:
+			Data_Type = SG_DATATYPE_String;						break;
+
+		default:
+			Data_Type = pTable->Get_Field_Type(Features[j]);	break;
 		}
+
+		pPoints->Add_Field(pTable->Get_Field_Name(Features[j]), Data_Type);
 	}
 
+
 	//-----------------------------------------------------
-	for(int iShape=0; iShape<pShapes->Get_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++)
+	Process_Set_Text(_TL("Converting ..."));
+
+	for( int iRecord=0; iRecord<pTable->Get_Record_Count() && Set_Progress(iRecord, pTable->Get_Record_Count()); iRecord++ )
 	{
-		CSG_Shape	*pShape	= pShapes->Get_Shape(iShape);
+		pPoints->Add_Point(pTable->Get_Record(iRecord)->asDouble(iFieldX), pTable->Get_Record(iRecord)->asDouble(iFieldY), pTable->Get_Record(iRecord)->asDouble(iFieldZ));
 
-		for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
+		for( int j=0; j<nFeatures; j++ )
 		{
-			for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
+			switch( pPoints->Get_Attribute_Type(j) )
 			{
-				TSG_Point	p	= pShape->Get_Point(iPoint, iPart);
-
-				pPoints->Add_Point(p.x, p.y, zField < 0 ? pShape->Get_Z(iPoint, iPart) : pShape->asDouble(zField));
-
-				for(iField=0; iField<nFields; iField++)
-				{
-					pPoints->Set_Value(3 + iField, pShape->asDouble(Fields[iField]));
-				}
+			case SG_DATATYPE_String:
+				pPoints->Set_Value(iRecord, j + 3, pTable->Get_Record(iRecord)->asString(Features[j]));
+				break;
+			default:
+				pPoints->Set_Value(iRecord, j + 3, pTable->Get_Record(iRecord)->asDouble(Features[j]));
+				break;
 			}
 		}
 	}
 
-	//-----------------------------------------------------
-	delete [] Fields;
 
-	return( pPoints->Get_Count() > 0 );
+	//-------------------------------------------------
+
+	return( true );
 }
 
 
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/pointcloud/pointcloud_tools/pc_from_table.h
similarity index 73%
copy from src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
copy to src/modules/pointcloud/pointcloud_tools/pc_from_table.h
index ea810a2..387ccdb 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_from_table.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_from_table.h 2570 2015-09-03 10:16:20Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -13,10 +13,10 @@
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//                   pc_from_shapes.h                    //
+//                    pc_from_table.h                    //
 //                                                       //
-//                 Copyright (C) 2009 by                 //
-//                      Olaf Conrad                      //
+//                 Copyright (C) 2015 by                 //
+//                    Volker Wichmann                    //
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
@@ -40,12 +40,13 @@
 //                                                       //
 //-------------------------------------------------------//
 //                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
+//    e-mail:     wichmann at laserdata                     //
 //                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
+//    contact:    Volker Wichmann                        //
+//                LASERDATA GmbH                         //
+//                Management and analysis of             //
+//                laserscanning data                     //
+//                Innsbruck, Austria                     //
 //                                                       //
 ///////////////////////////////////////////////////////////
 
@@ -54,18 +55,19 @@
 
 ///////////////////////////////////////////////////////////
 //														 //
-//														 //
+//                                                       //
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-#ifndef HEADER_INCLUDED__PC_From_Shapes_H
-#define HEADER_INCLUDED__PC_From_Shapes_H
+#ifndef HEADER_INCLUDED__PC_From_Table_H
+#define HEADER_INCLUDED__PC_From_Table_H
 
 //---------------------------------------------------------
 #include "MLB_Interface.h"
 
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 //														 //
@@ -73,26 +75,22 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CPC_From_Shapes : public CSG_Module
+class CPC_From_Table : public CSG_Module
 {
 public:
-	CPC_From_Shapes(void);
+	CPC_From_Table(void);
 
-	virtual CSG_String			Get_MenuPath	(void)	{	return( _TL("R:Conversion") );	}
+	virtual CSG_String		Get_MenuPath	(void)	{	return( _TL("R:Conversion") );	}
 
 
 protected:
 
-	virtual bool				On_Execute		(void);
+	virtual bool			On_Execute		(void);
 
-};
 
+private:
 
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
 
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__PC_From_Shapes_H
+};
+
+#endif // #ifndef HEADER_INCLUDED__PC_From_Table_H
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
index 1b76234..5316cd6 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
+++ b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_reclass_extract.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_reclass_extract.cpp 2561 2015-08-27 08:10:41Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -308,6 +308,8 @@ bool CPC_Reclass_Extract::On_Execute(void)
 			m_pResult->Add_Field(CSG_String::Format(SG_T("%s_reclass"), m_pInput->Get_Field_Name(m_AttrField)), m_pInput->Get_Field_Type(m_AttrField));
 	}
 
+	m_iOrig = 0;	// counter of unchanged points
+
 	//-----------------------------------------------------
 	switch( method )
 	{
@@ -338,6 +340,12 @@ bool CPC_Reclass_Extract::On_Execute(void)
 			Set_Display_Attributes(m_pResult, m_AttrField, sParms);
 	}
 
+	if( m_bExtract)
+		SG_UI_Msg_Add(CSG_String::Format(_TL("%d points out of %d extracted."), m_pInput->Get_Point_Count()-m_iOrig, m_pInput->Get_Point_Count()), true);
+	else
+		SG_UI_Msg_Add(CSG_String::Format(_TL("%d points out of %d reclassified."), m_pInput->Get_Point_Count()-m_iOrig, m_pInput->Get_Point_Count()), true);
+
+
 	return( true );
 }
 
@@ -355,7 +363,6 @@ void CPC_Reclass_Extract::Reclass_Range(void)
 	int			opera;
 	double		minValue, maxValue, value, others, noData, noDataValue, newValue;
 
-
 	minValue	= Parameters("MIN")->asDouble();
 	maxValue	= Parameters("MAX")->asDouble();
 	newValue	= Parameters("RNEW")->asDouble();
@@ -373,7 +380,7 @@ void CPC_Reclass_Extract::Reclass_Range(void)
 	else
 		floating = false;
 
-	for (int i=0; i<m_pInput->Get_Point_Count(); i++)
+	for (int i=0; i<m_pInput->Get_Point_Count() && Set_Progress(i, m_pInput->Get_Point_Count()); i++)
 	{
 		if( floating == true )
 			value = m_pInput->Get_Value(i, m_AttrField);
@@ -391,7 +398,9 @@ void CPC_Reclass_Extract::Reclass_Range(void)
 			else
 			{
 				if (!m_bExtract)
-					Set_Value(i, value);								// or original value		
+					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 
@@ -407,6 +416,8 @@ void CPC_Reclass_Extract::Reclass_Range(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 	}
@@ -421,7 +432,6 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 	int			opera;
 	double		oldValue, newValue, value, others, noData, noDataValue;
 
-
 	oldValue	= Parameters("OLD")->asDouble();
 	newValue	= Parameters("NEW")->asDouble();
 	others		= Parameters("OTHERS")->asDouble();
@@ -438,8 +448,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 	else
 		floating = false;
 
-		
-	for (int i=0; i<m_pInput->Get_Point_Count(); i++)
+
+	for (int i=0; i<m_pInput->Get_Point_Count() && Set_Progress(i, m_pInput->Get_Point_Count()); i++)
 	{
 		if( floating == true )
 			value = m_pInput->Get_Value(i, m_AttrField);
@@ -459,6 +469,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 
@@ -474,6 +486,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 
@@ -489,6 +503,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 
@@ -504,6 +520,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 
@@ -519,6 +537,8 @@ void CPC_Reclass_Extract::Reclass_Single(void)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);								// or original value
+
+				m_iOrig++;
 			}
 		}
 	}
@@ -632,6 +652,8 @@ bool CPC_Reclass_Extract::Reclass_Table(bool bUser)
 			{
 				if (!m_bExtract)
 					Set_Value(i, value);							// or original value
+
+				m_iOrig++;
 			}
 		}
 	}
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
index 25e4a12..ef6a2a9 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
+++ b/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pc_reclass_extract.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pc_reclass_extract.h 2561 2015-08-27 08:10:41Z reklov_w $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -102,6 +102,7 @@ private:
 	int				m_Single;
 	bool			m_bExtract, m_bCreateAttrib;
 	int				m_AttrField;
+	int				m_iOrig;
 
 	CSG_PointCloud	*m_pInput, *m_pResult;
 
diff --git a/src/modules/shapes/shapes_lines/MLB_Interface.cpp b/src/modules/shapes/shapes_lines/MLB_Interface.cpp
index 072842f..4093768 100644
--- a/src/modules/shapes/shapes_lines/MLB_Interface.cpp
+++ b/src/modules/shapes/shapes_lines/MLB_Interface.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: MLB_Interface.cpp 2338 2014-11-17 10:06:18Z reklov_w $
+ * Version $Id: MLB_Interface.cpp 2573 2015-09-04 12:25:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -121,6 +121,7 @@ CSG_Module *		Create_Module(int i)
 	case  4:	return( new CLine_Simplification );
 	case  5:	return( new CLine_Dissolve );
 	case  6:	return( new CLine_Split_with_Lines );
+	case  8:	return( new CLine_Split_at_Points );
 	case  7:	return( new CLine_Smoothing );
 
 	case 10:	return( NULL );
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.cpp b/src/modules/shapes/shapes_lines/line_split_with_lines.cpp
index e6837de..da8da51 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.cpp
+++ b/src/modules/shapes/shapes_lines/line_split_with_lines.cpp
@@ -233,3 +233,182 @@ bool CLine_Split_with_Lines::Get_Intersection(CSG_Shape *pLine, CSG_Shape_Part *
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+CLine_Split_at_Points::CLine_Split_at_Points(void)
+{
+	//-----------------------------------------------------
+	Set_Name		(_TL("Split Lines at Points"));
+
+	Set_Author		(SG_T("O. Conrad (c) 2015"));
+
+	Set_Description	(_TW(
+		"Split Lines at Points."
+	));
+
+	//-----------------------------------------------------
+	Parameters.Add_Shapes(
+		NULL	, "LINES"		, _TL("Lines"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Line
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "SPLIT"		, _TL("Split Features"),
+		_TL(""),
+		PARAMETER_INPUT, SHAPE_TYPE_Point
+	);
+
+	Parameters.Add_Shapes(
+		NULL	, "INTERSECT"	, _TL("Intersection"),
+		_TL(""),
+		PARAMETER_OUTPUT, SHAPE_TYPE_Line
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "OUTPUT"		, _TL("Output"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("polylines"),
+			_TL("separate lines")
+		), 1
+	);
+
+	Parameters.Add_Value(
+		NULL	, "EPSILON"		, _TL("Epsilon"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, true
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CLine_Split_at_Points::On_Execute(void)
+{
+	CSG_Shapes	*pLines, *pSplit, *pIntersect;
+
+	pLines		= Parameters("LINES"    )->asShapes();
+	pSplit		= Parameters("SPLIT"    )->asShapes();
+	pIntersect	= Parameters("INTERSECT")->asShapes();
+
+	if(	!pLines->is_Valid() || pLines->Get_Count() < 1
+	||	!pSplit->is_Valid() || pSplit->Get_Count() < 1
+	||	pLines->Get_Extent().Intersects(pSplit->Get_Extent()) == INTERSECTION_None )
+	{
+		Error_Set(_TL("no lines for splitting"));
+
+		return( false );
+	}
+
+	//--------------------------------------------------------
+	pIntersect->Create(SHAPE_TYPE_Line,
+		CSG_String::Format(SG_T("%s [%s: %s]"), pLines->Get_Name(), _TL("Splitted"), pSplit->Get_Name()),
+		pLines
+	);
+
+	double	Epsilon	= Parameters("EPSILON")->asDouble();
+
+	//--------------------------------------------------------
+	for(int iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
+	{
+		CSG_Shape	*pLine	= pIntersect->Add_Shape(pLines->Get_Shape(iLine), SHAPE_COPY);
+
+		CSG_Rect	Extent	= pLine->Get_Extent();	Extent.Inflate(Epsilon, false);
+
+		for(int iSplit=0; iSplit<pSplit->Get_Count(); iSplit++)
+		{
+			TSG_Point	Point	= pSplit->Get_Shape(iSplit)->Get_Point(0);
+
+			if( Extent.Contains(Point) )
+			{
+				Get_Intersection(pLine, Point, Epsilon);
+			}
+		}
+
+		if( Parameters("OUTPUT")->asInt() == 1 )
+		{
+			while( pLine->Get_Part_Count() > 1 )
+			{
+				CSG_Shape_Line	*pAdd	= (CSG_Shape_Line *)pIntersect->Add_Shape(pLine, SHAPE_COPY_ATTR);	// only attributes
+
+				for(int iPoint=0; iPoint<pLine->Get_Point_Count(1); iPoint++)
+				{
+					pAdd->Add_Point(pLine->Get_Point(iPoint, 1));
+				}
+
+				pLine->Del_Part(1);
+			}
+		}
+	}
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CLine_Split_at_Points::Get_Intersection(CSG_Shape *pLine, TSG_Point Point, double Epsilon)
+{
+	int			min_iPart, min_iPoint;
+	double		min_Dist	= 1.1 * Epsilon;
+	TSG_Point	min_C;
+
+	for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+	{
+		TSG_Point	C, B, A	= pLine->Get_Point(0, iPart);
+
+		for(int iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+		{
+			B	= A;	A	= pLine->Get_Point(iPoint, iPart);
+
+			double	Dist	= SG_Get_Nearest_Point_On_Line(Point, A, B, C, true);
+
+			if( Dist < min_Dist )
+			{
+				min_Dist	= Dist;
+				min_C		= C;
+				min_iPart	= iPart;
+				min_iPoint	= iPoint;
+			}
+		}
+	}
+
+	if( min_Dist <= Epsilon )
+	{
+		int		iPoint;
+
+		CSG_Shape_Part	*pPart	= ((CSG_Shape_Line *)pLine)->Get_Part(min_iPart);
+
+		pLine->Add_Point(min_C, min_iPart = pLine->Get_Part_Count());
+
+		for(iPoint=min_iPoint; iPoint<pPart->Get_Count(); iPoint++)
+		{
+			pLine->Add_Point(pPart->Get_Point(iPoint), min_iPart);
+		}
+
+		for(iPoint=pPart->Get_Count()-1; iPoint>=min_iPoint; iPoint--)
+		{
+			pPart->Del_Point(iPoint);
+		}
+
+		pPart->Add_Point(min_C);
+
+		return( true );
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.h b/src/modules/shapes/shapes_lines/line_split_with_lines.h
index c4229fc..ba8caaf 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.h
+++ b/src/modules/shapes/shapes_lines/line_split_with_lines.h
@@ -100,6 +100,29 @@ private:
 
 ///////////////////////////////////////////////////////////
 //														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class CLine_Split_at_Points : public CSG_Module  
+{
+public:
+	CLine_Split_at_Points(void);
+
+
+protected:
+
+	virtual bool			On_Execute			(void);
+
+
+private:
+
+	bool					Get_Intersection	(CSG_Shape *pLine, TSG_Point Point, double Epsilon);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
 //														 //
 //														 //
 ///////////////////////////////////////////////////////////
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.cpp b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
index 46bb6fc..e4d2abd 100644
--- a/src/modules/shapes/shapes_points/Points_From_Lines.cpp
+++ b/src/modules/shapes/shapes_points/Points_From_Lines.cpp
@@ -1,10 +1,10 @@
 /**********************************************************
- * Version $Id: Points_From_Lines.cpp 2515 2015-06-21 11:45:31Z reklov_w $
+ * Version $Id: Points_From_Lines.cpp 2545 2015-07-28 07:46:45Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
     Points_From_Lines.cpp
-    Copyright (C) Victor Olaya
+    Copyright (C) Victor Olaya, Volker Wichmann
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ CPoints_From_Lines::CPoints_From_Lines(void)
 {
 	Set_Name		(_TL("Convert Lines to Points"));
 
-	Set_Author		(_TL("Victor Olaya (c) 2004"));
+	Set_Author		(_TL("V. Olaya, V. Wichmann (c) 2004-2015"));
 
 	Set_Description	(_TW(
 		"Converts lines to points. "
@@ -67,10 +67,20 @@ CPoints_From_Lines::CPoints_From_Lines(void)
 		PARAMETER_TYPE_Bool, false
 	);
 
+	Parameters.Add_Choice(
+		NULL, "METHOD_INSERT"	, _TL("Insertion"),
+		_TL("Choose the method how to insert additional points."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("per line segment"),
+			_TL("per line"),
+			_TL("from line center")
+		), 0
+	);
+
 	Parameters.Add_Value(
-		NULL, "DIST"	, _TL("Insert Distance"),
-		_TL(""),
-		PARAMETER_TYPE_Double, 100, 0.0, true
+		NULL, "DIST"	, _TL("Insertion Distance"),
+		_TL("Point insertion distance [map units]."),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
 	);
 
 	Parameters.Add_Value(
@@ -86,92 +96,163 @@ CPoints_From_Lines::CPoints_From_Lines(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+int CPoints_From_Lines::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
+{
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "ADD") )
+	{
+		pParameters->Get_Parameter("METHOD_INSERT")		->Set_Enabled(pParameter->asBool());
+		pParameters->Get_Parameter("DIST")				->Set_Enabled(pParameter->asBool());
+	}
+
+	return( 1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 bool CPoints_From_Lines::On_Execute(void)
 {
-	int			iLine, iPart, iPoint, jPoint;
-	double		dx, dy, dz, dm, dDist, dLine,  A_z, B_z, A_m, B_m;
-	TSG_Point	Pt_A, Pt_B;
 	CSG_Shapes	*pLines, *pPoints;
-	CSG_Shape	*pLine, *pPoint;
-	bool		bAddPtOrder;
+	bool		bAddPoints, bAddPtOrder;
+	int			iMethod;
+	double		dDist;
 
 	//-----------------------------------------------------
-	pLines		= Parameters("LINES")	->asShapes();
-	pPoints		= Parameters("POINTS")	->asShapes();
-	dDist		= Parameters("ADD")		->asBool() ? Parameters("DIST")->asDouble() : -1.0;
-	bAddPtOrder	= Parameters("ADD_POINT_ORDER")->asBool();
+	pLines		= Parameters("LINES")			->asShapes();
+	pPoints		= Parameters("POINTS")			->asShapes();
+	bAddPoints	= Parameters("ADD")				->asBool();
+	iMethod		= Parameters("METHOD_INSERT")	->asInt();
+	dDist		= Parameters("DIST")			->asDouble();
+	bAddPtOrder	= Parameters("ADD_POINT_ORDER")	->asBool();
 
 	pPoints->Create(SHAPE_TYPE_Point, pLines->Get_Name(), pLines, pLines->Get_Vertex_Type());
 
 	if( bAddPtOrder )
 		pPoints->Add_Field(_TL("PT_ID"), SG_DATATYPE_Int);
 
-	//-----------------------------------------------------
-	for(iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
+	if( bAddPoints )
+	{
+		switch (iMethod)
+		{
+		case 0:
+		default:		Convert_Add_Points_Segment(pLines, pPoints, dDist, bAddPtOrder);	break;
+
+		case 1:			Convert_Add_Points_Line(pLines, pPoints, dDist, bAddPtOrder);		break;
+
+		case 2:			Convert_Add_Points_Center(pLines, pPoints, dDist, bAddPtOrder);		break;
+		}
+	}
+	else
+	{
+		Convert(pLines, pPoints, bAddPtOrder);
+	}
+	
+
+	return( true );
+}
+
+
+//---------------------------------------------------------
+void CPoints_From_Lines::Convert_Add_Points_Segment(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder)
+{
+	CSG_Shape	*pLine, *pPoint;
+	TSG_Point	Pt_A, Pt_B;
+	double		dx, dy, dz, dm, dLine,  A_z, B_z, A_m, B_m;
+
+
+	for(int iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
 	{
 		pLine	= pLines->Get_Shape(iLine);
 
 		int		iPoints = 0;
 
-		for(iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+		for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
 		{
-			//---------------------------------------------
-			if( dDist > 0.0 )	// insert additional points...
+			Pt_B	= pLine->Get_Point(0, iPart);
+
+			if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 			{
-				Pt_B	= pLine->Get_Point(0, iPart);
+				B_z	= pLine->Get_Z(0, iPart);
+
+				if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+				{
+					B_m	= pLine->Get_M(0, iPart);
+				}
+			}
+
+			for(int iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+			{
+				Pt_A	= Pt_B;
+				Pt_B	= pLine->Get_Point(iPoint, iPart);
 
 				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 				{
-					B_z	= pLine->Get_Z(0, iPart);
+					A_z = B_z;
+					B_z	= pLine->Get_Z(iPoint, iPart);
 
 					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
 					{
-						B_m	= pLine->Get_M(0, iPart);
+						A_m = B_m;
+						B_m	= pLine->Get_M(iPoint, iPart);
 					}
 				}
 
-				for(iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+				dx		= Pt_B.x - Pt_A.x;
+				dy		= Pt_B.y - Pt_A.y;
+				dLine	= sqrt(dx*dx + dy*dy);
+				dx		/= dLine;
+				dy		/= dLine;
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 				{
-					Pt_A	= Pt_B;
-					Pt_B	= pLine->Get_Point(iPoint, iPart);
+					dz		= (B_z - A_z) / dLine;
 
-					if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
 					{
-						A_z = B_z;
-						B_z	= pLine->Get_Z(iPoint, iPart);
-
-						if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
-						{
-							A_m = B_m;
-							B_m	= pLine->Get_M(iPoint, iPart);
-						}
+						dm		= (B_m - A_m) / dLine;
 					}
+				}
 
-					dx		= Pt_B.x - Pt_A.x;
-					dy		= Pt_B.y - Pt_A.y;
-					dLine	= sqrt(dx*dx + dy*dy);
-					dx		/= dLine;
-					dy		/= dLine;
+				pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
+				pPoint	->Add_Point(Pt_A);
 
-					if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
-					{
-						dz		= (B_z - A_z) / dLine;
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					pPoint->Set_Z(A_z, 0);
 
-						if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
-						{
-							dm		= (B_m - A_m) / dLine;
-						}
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						pPoint->Set_M(A_m, 0);
 					}
+				}
+
+				if( bAddPtOrder )
+				{
+					pPoint->Set_Value(pPoints->Get_Field_Count()-1, iPoints);
+					iPoints++;
+				}
+
+				double dLength = 0.0;
+
+				while( dLength + dDist < dLine )
+				{
+					Pt_A.x	+= dDist * dx;
+					Pt_A.y	+= dDist * dy;
 
 					pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
 					pPoint	->Add_Point(Pt_A);
 
 					if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 					{
+						A_z	+= dDist * dz;
 						pPoint->Set_Z(A_z, 0);
 
 						if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
 						{
+							A_m	+= dDist * dm;
 							pPoint->Set_M(A_m, 0);
 						}
 					}
@@ -182,54 +263,123 @@ bool CPoints_From_Lines::On_Execute(void)
 						iPoints++;
 					}
 
-					double dLength = 0.0;
+					dLength += dDist;
+				}
+			}
+		}
+	}
 
-					while( dLength + dDist < dLine )
-					{
-						Pt_A.x	+= dDist * dx;
-						Pt_A.y	+= dDist * dy;
+	return;
+}
 
-						pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
-						pPoint	->Add_Point(Pt_A);
 
-						if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
-						{
-							A_z	+= dDist * dz;
-							pPoint->Set_Z(A_z, 0);
-
-							if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
-							{
-								A_m	+= dDist * dm;
-								pPoint->Set_M(A_m, 0);
-							}
-						}
+//---------------------------------------------------------
+void CPoints_From_Lines::Convert_Add_Points_Line(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder)
+{
+	CSG_Shape	*pLine, *pPoint;
+	TSG_Point	Pt_A, Pt_B;
+	double		dx, dy, dz, dm, dLine,  A_z, B_z, A_m, B_m;
 
-						if( bAddPtOrder )
-						{
-							pPoint->Set_Value(pPoints->Get_Field_Count()-1, iPoints);
-							iPoints++;
-						}
 
-						dLength += dDist;
-					}
+	for(int iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
+	{
+		pLine	= pLines->Get_Shape(iLine);
+
+		int		iPoints = 0;
+		double	dOffset = 0.0;
+
+		for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+		{
+			Pt_B	= pLine->Get_Point(0, iPart);
+
+			if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+			{
+				B_z	= pLine->Get_Z(0, iPart);
+
+				if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+				{
+					B_m	= pLine->Get_M(0, iPart);
 				}
 			}
 
-			//---------------------------------------------
-			else				// just copy points...
+			for(int iPoint=1; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
 			{
-				for(iPoint=0; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+				Pt_A	= Pt_B;
+				Pt_B	= pLine->Get_Point(iPoint, iPart);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					A_z = B_z;
+					B_z	= pLine->Get_Z(iPoint, iPart);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						A_m = B_m;
+						B_m	= pLine->Get_M(iPoint, iPart);
+					}
+				}
+
+				dx		= Pt_B.x - Pt_A.x;
+				dy		= Pt_B.y - Pt_A.y;
+				dLine	= sqrt(dx*dx + dy*dy);
+				dx		/= dLine;
+				dy		/= dLine;
+
+				Pt_A.x	+= dOffset * dx;
+				Pt_A.y	+= dOffset * dy;
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 				{
+					dz		= (B_z - A_z) / dLine;
+					A_z		+= dOffset * dz;
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						dm		= (B_m - A_m) / dLine;
+						A_m		+= dOffset * dm;
+					}
+				}
+
+				pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
+				pPoint	->Add_Point(Pt_A);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					pPoint->Set_Z(A_z, 0);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						pPoint->Set_M(A_m, 0);
+					}
+				}
+
+				if( bAddPtOrder )
+				{
+					pPoint->Set_Value(pPoints->Get_Field_Count()-1, iPoints);
+					iPoints++;
+				}
+
+				double dLength = 0.0;
+
+				dLine -= dOffset;
+
+				while( dLength + dDist < dLine )
+				{
+					Pt_A.x	+= dDist * dx;
+					Pt_A.y	+= dDist * dy;
+
 					pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
-					pPoint	->Add_Point(pLine->Get_Point(iPoint, iPart));
+					pPoint	->Add_Point(Pt_A);
 
 					if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
 					{
-						pPoint->Set_Z(pLine->Get_Z(iPoint, iPart), 0);
+						A_z	+= dDist * dz;
+						pPoint->Set_Z(A_z, 0);
 
 						if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
 						{
-							pPoint->Set_M(pLine->Get_M(iPoint, iPart), 0);
+							A_m	+= dDist * dm;
+							pPoint->Set_M(A_m, 0);
 						}
 					}
 
@@ -238,15 +388,303 @@ bool CPoints_From_Lines::On_Execute(void)
 						pPoint->Set_Value(pPoints->Get_Field_Count()-1, iPoints);
 						iPoints++;
 					}
+
+					dLength += dDist;
 				}
+
+				dOffset = (dLength + dDist) - dLine;
 			}
 		}
 	}
 
-	return( true );
+	return;
+}
+
+
+//---------------------------------------------------------
+void CPoints_From_Lines::Convert_Add_Points_Center(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder)
+{
+	CSG_Shape	*pLine;
+	TSG_Point	Pt_A, Pt_B, Pt_C;
+	double		dx, dy, dz, dm, dLine,  A_z, B_z, C_z, A_m, B_m, C_m;
+	int			iSplitPart, iSplitPoint;
+
+	for(int iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
+	{
+		pLine	= pLines->Get_Shape(iLine);
+
+		double	dCenter = ((CSG_Shape_Line *)pLine)->Get_Length() / 2.0;
+		double	dLength = 0.0;
+
+		//---------------------------------------------------------
+		// search for the part we need to split
+		for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+		{
+			dLine = ((CSG_Shape_Line *)pLine)->Get_Length(iPart);
+
+			if( dLength + dLine < dCenter )
+			{
+				dLength += dLine;
+			}
+			else
+			{
+				iSplitPart = iPart;
+				break;
+			}
+		}
+
+		double	dOffset = dCenter - dLength;
+
+		Pt_B	= pLine->Get_Point(0, iSplitPart);
+
+		if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+		{
+			B_z	= pLine->Get_Z(0, iSplitPart);
+
+			if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+			{
+				B_m	= pLine->Get_M(0, iSplitPart);
+			}
+		}
+
+		dLength = 0.0;
+
+		//---------------------------------------------------------
+		// search for the point after which we need to split
+		for(int iPoint=1; iPoint<pLine->Get_Point_Count(iSplitPart); iPoint++)
+		{
+			Pt_A	= Pt_B;
+			Pt_B	= pLine->Get_Point(iPoint, iSplitPart);
+
+			if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+			{
+				A_z = B_z;
+				B_z	= pLine->Get_Z(iPoint, iSplitPart);
+
+				if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+				{
+					A_m = B_m;
+					B_m	= pLine->Get_M(iPoint, iSplitPart);
+				}
+			}
+
+			dx		= Pt_B.x - Pt_A.x;
+			dy		= Pt_B.y - Pt_A.y;
+			dLine	= sqrt(dx*dx + dy*dy);
+
+			if (dLength + dLine < dOffset)
+			{
+				dLength += dLine;
+			}
+			else
+			{
+				iSplitPoint = iPoint - 1;
+				dOffset		= dOffset - dLength;
+				break;
+			}
+		}
+
+		//---------------------------------------------------------
+		// create center point
+		dx		/= dLine;
+		dy		/= dLine;
+
+		Pt_A.x	+= dOffset * dx;
+		Pt_A.y	+= dOffset * dy;
+
+		Pt_C	= Pt_A;
+
+		if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+		{
+			dz		= (B_z - A_z) / dLine;
+			A_z		+= dOffset * dz;
+			C_z		= A_z;
+
+			if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+			{
+				dm		= (B_m - A_m) / dLine;
+				A_m		+= dOffset * dm;
+				C_m		= A_m;
+			}
+		}
+
+		//---------------------------------------------------------
+		// create line part from center to end of line
+		CSG_Shapes	SplitLines;
+		CSG_Shape	*pSplitLine;
+		
+		SplitLines.Create(pLines->Get_Type(), pLines->Get_Name(), pLines, pLines->Get_Vertex_Type());
+
+		int iPartOffset = 0;
+		int iPointOffset;
+
+		pSplitLine	= SplitLines.Add_Shape(pLine, SHAPE_COPY_ATTR);
+		pSplitLine	->Add_Point(Pt_C, iPartOffset);
+
+		if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+		{
+			pSplitLine->Set_Z(C_z, iPartOffset);
+
+			if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+			{
+				pSplitLine->Set_M(C_m, iPartOffset);
+			}
+		}
+
+		for(int iPart=iSplitPart; iPart<pLine->Get_Part_Count(); iPart++)
+		{
+			if( iPart == iSplitPart )
+			{
+				iPointOffset = iSplitPoint + 1;
+			}
+			else
+			{
+				iPointOffset = 0;
+			}
+
+			for(int iPoint=iPointOffset; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+			{
+				Pt_A	= pLine->Get_Point(iPoint, iPart);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					A_z	= pLine->Get_Z(iPoint, iPart);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						A_m	= pLine->Get_M(iPoint, iPart);
+					}
+				}
+
+				pSplitLine	->Add_Point(Pt_A, iPartOffset);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					pSplitLine->Set_Z(A_z, iPartOffset);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						pSplitLine->Set_M(A_m, iPartOffset);
+					}
+				}
+			} // for iPoint
+
+			iPartOffset++;
+		} // for iPart;
+
+		Convert_Add_Points_Line(&SplitLines, pPoints, dDist, bAddPtOrder);
+
+
+		//---------------------------------------------------------
+		// create line part from center to start of line
+		
+		SplitLines.Create(pLines->Get_Type(), pLines->Get_Name(), pLines, pLines->Get_Vertex_Type());
+
+		iPartOffset = 0;
+
+		pSplitLine	= SplitLines.Add_Shape(pLine, SHAPE_COPY_ATTR);
+		pSplitLine	->Add_Point(Pt_C, iPartOffset);
+
+		if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+		{
+			pSplitLine->Set_Z(C_z, iPartOffset);
+
+			if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+			{
+				pSplitLine->Set_M(C_m, iPartOffset);
+			}
+		}
+
+		for(int iPart=iSplitPart; iPart>=0; iPart--)
+		{
+			if( iPart == iSplitPart )
+			{
+				iPointOffset = iSplitPoint;
+			}
+			else
+			{
+				iPointOffset = pLine->Get_Point_Count(iPart);
+			}
+
+			for(int iPoint=iPointOffset; iPoint>=0; iPoint--)
+			{
+				Pt_A	= pLine->Get_Point(iPoint, iPart);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					A_z	= pLine->Get_Z(iPoint, iPart);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						A_m	= pLine->Get_M(iPoint, iPart);
+					}
+				}
+
+				pSplitLine	->Add_Point(Pt_A, iPartOffset);
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					pSplitLine->Set_Z(A_z, iPartOffset);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						pSplitLine->Set_M(A_m, iPartOffset);
+					}
+				}
+			} // for iPoint
+
+			iPartOffset++;
+		} // for iPart;
+
+		Convert_Add_Points_Line(&SplitLines, pPoints, dDist, bAddPtOrder);
+
+	} // for iLine
+			
+	
+	return;
 }
 
 
+//---------------------------------------------------------
+void CPoints_From_Lines::Convert(CSG_Shapes *pLines, CSG_Shapes *pPoints, bool bAddPtOrder)
+{
+	CSG_Shape	*pLine, *pPoint;
+
+	for(int iLine=0; iLine<pLines->Get_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++)
+	{
+		pLine	= pLines->Get_Shape(iLine);
+
+		int		iPoints = 0;
+
+		for(int iPart=0; iPart<pLine->Get_Part_Count(); iPart++)
+		{
+			for(int iPoint=0; iPoint<pLine->Get_Point_Count(iPart); iPoint++)
+			{
+				pPoint	= pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR);
+				pPoint	->Add_Point(pLine->Get_Point(iPoint, iPart));
+
+				if( pLines->Get_Vertex_Type() != SG_VERTEX_TYPE_XY )
+				{
+					pPoint->Set_Z(pLine->Get_Z(iPoint, iPart), 0);
+
+					if( pLines->Get_Vertex_Type() == SG_VERTEX_TYPE_XYZM )
+					{
+						pPoint->Set_M(pLine->Get_M(iPoint, iPart), 0);
+					}
+				}
+
+				if( bAddPtOrder )
+				{
+					pPoint->Set_Value(pPoints->Get_Field_Count()-1, iPoints);
+					iPoints++;
+				}
+			}
+		}
+	}
+
+	return;
+}
+
 ///////////////////////////////////////////////////////////
 //														 //
 //														 //
diff --git a/src/modules/shapes/shapes_points/Points_From_Lines.h b/src/modules/shapes/shapes_points/Points_From_Lines.h
index 5299f40..1f2955c 100644
--- a/src/modules/shapes/shapes_points/Points_From_Lines.h
+++ b/src/modules/shapes/shapes_points/Points_From_Lines.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: Points_From_Lines.h 2072 2014-03-31 08:50:43Z reklov_w $
+ * Version $Id: Points_From_Lines.h 2545 2015-07-28 07:46:45Z reklov_w $
  *********************************************************/
 
 /*******************************************************************************
@@ -61,6 +61,13 @@ protected:
 
 	virtual bool				On_Execute		(void);
 
+	virtual int					On_Parameters_Enable		(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	void						Convert_Add_Points_Segment	(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder);
+	void						Convert_Add_Points_Line		(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder);
+	void						Convert_Add_Points_Center	(CSG_Shapes *pLines, CSG_Shapes *pPoints, double dDist, bool bAddPtOrder);
+	void						Convert						(CSG_Shapes *pLines, CSG_Shapes *pPoints, bool bAddPtOrder);
+
 };
 
 
diff --git a/src/modules/simulation/Makefile.am b/src/modules/simulation/Makefile.am
index 7ec461d..1d005e7 100644
--- a/src/modules/simulation/Makefile.am
+++ b/src/modules/simulation/Makefile.am
@@ -1 +1 @@
-SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion sim_fire_spreading sim_hydrology sim_ihacres
+SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion sim_fire_spreading sim_hydrology sim_ihacres sim_rivflow
diff --git a/src/modules/simulation/Makefile.in b/src/modules/simulation/Makefile.in
index 65c9896..35c2fef 100644
--- a/src/modules/simulation/Makefile.in
+++ b/src/modules/simulation/Makefile.in
@@ -322,7 +322,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion sim_fire_spreading sim_hydrology sim_ihacres
+SUBDIRS = sim_cellular_automata sim_ecosystems_hugget sim_erosion sim_fire_spreading sim_hydrology sim_ihacres sim_rivflow
 all: all-recursive
 
 .SUFFIXES:
diff --git a/src/modules/simulation/sim_rivflow/DataTrans.cpp b/src/modules/simulation/sim_rivflow/DataTrans.cpp
new file mode 100644
index 0000000..ae824d3
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/DataTrans.cpp
@@ -0,0 +1,179 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     DataTrans.cpp                     //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "DataTrans.h"
+#include <math.h>
+#include <iostream>
+#include "stdio.h"
+#include <fstream>
+#include <string>
+#include "stdlib.h"
+#include <sstream>
+
+using namespace std;
+
+#define ESC 27
+
+//---------------------------------------------------------
+//#########################################################
+
+CDataTrans::CDataTrans(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("DataTrans");
+	Set_Author		("Christian Alwardt");
+	Set_Description	("DataOperations");
+
+
+	//Parameters list...
+
+	Parameters.Add_Grid_List(
+			Parameters("SOURCE_NODE"),
+			"SOURCE1"		, SG_T("RunOff"),
+			SG_T(""),
+			PARAMETER_INPUT, false
+		);
+
+		Parameters.Add_Grid_List(
+			Parameters("SOURCE_NODE"),
+			"SOURCE2"		, SG_T("Drainage"),
+			SG_T(""),
+			PARAMETER_INPUT, false
+		);
+
+
+}
+
+
+//#########################################################
+//---------------------------------------------------------
+//#########################################################
+
+
+
+bool CDataTrans::On_Execute(void)
+{
+	
+	//-----------------------------------------------------
+	
+	CSG_Parameter_Grid_List	*pSources1	= Parameters("SOURCE1")->asGridList(); //RunOff Liste
+	CSG_Parameter_Grid_List	*pSources2	= Parameters("SOURCE2")->asGridList(); //Drainage Liste
+
+	if( pSources1->Get_Count() > 0 && pSources2->Get_Count() > 0)
+	{
+		if( pSources1->Get_Count() == pSources2->Get_Count()) 
+		{
+			m_pID = pSources1->Get_Count();
+
+			for(i=0; i < pSources1->Get_Count(); i++)
+			{
+				pSource1 = pSources1->asGrid(i);
+				pSource2 = pSources2->asGrid(i);
+	
+				Set_TFile(pSource1, pSource2);
+			}
+	
+		}
+		else 
+			Message_Dlg("Achtung, Anzahl der Eintr�ge stimmt nicht �berein");
+	}
+
+
+	
+	delete(pSources1);
+	delete(pSources1);
+
+	return(true);
+}
+
+
+
+bool CDataTrans::Set_TFile(CSG_Grid *pSource1, CSG_Grid *pSource2)
+{
+	if( pSource1->Get_NX() == pSource2->Get_NX() && pSource1->Get_NY() == pSource2->Get_NY())
+	{
+		NX = pSource1->Get_NX();
+		NY = pSource1->Get_NY();
+	
+		fstream myfile;
+		std::stringstream file0;
+		std::string file;
+
+		//LandSurfaceModell-Daten
+		
+		//-----------------------------------------------------
+		file0.str("");
+		file0 << "dataTemp/lsMData-Day" << i+1 << ".txt";
+		file = file0.str();
+		myfile.open(file.c_str(), ios::out|ios::trunc);
+
+		for(int x = 0; x < NX; ++x)
+		{
+			for(int y = 0; y < NY; ++y)
+			{
+				myfile << x << " " << y;
+				myfile << " " << pSource1->asDouble(x,y) << " " << pSource2->asDouble(x,y);
+				myfile << "\n";
+			}
+		}
+		myfile.close();
+		Process_Set_Text(CSG_String::Format(SG_T("GridSave || Datensatz %d geschrieben"),i+1));
+	}
+
+	return(true);
+}
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/simulation/sim_rivflow/DataTrans.h
similarity index 63%
copy from src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
copy to src/modules/simulation/sim_rivflow/DataTrans.h
index ea810a2..61d3066 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/simulation/sim_rivflow/DataTrans.h
@@ -1,98 +1,90 @@
-/**********************************************************
- * Version $Id: pc_from_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   pointcloud_tools                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   pc_from_shapes.h                    //
-//                                                       //
-//                 Copyright (C) 2009 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__PC_From_Shapes_H
-#define HEADER_INCLUDED__PC_From_Shapes_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPC_From_Shapes : public CSG_Module
-{
-public:
-	CPC_From_Shapes(void);
-
-	virtual CSG_String			Get_MenuPath	(void)	{	return( _TL("R:Conversion") );	}
-
-
-protected:
-
-	virtual bool				On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__PC_From_Shapes_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     DataTrans.h                       //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__DataTrans_H
+#define HEADER_INCLUDED__DataTrans_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------
+//#########################################################
+
+class CDataTrans : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CDataTrans(void);							// constructor
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute	(void);		// always overwrite this function
+
+
+private: ///// private members and functions: /////////////
+	CSG_Grid *pSource1, *pSource2;
+	
+	int NX, NY, m_pID, i;
+
+	bool	Set_TFile(CSG_Grid *pSource1, CSG_Grid *pSource2);
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__DataTrans_H
\ No newline at end of file
diff --git a/src/modules/simulation/sim_rivflow/GridComb.cpp b/src/modules/simulation/sim_rivflow/GridComb.cpp
new file mode 100644
index 0000000..0dc13e5
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/GridComb.cpp
@@ -0,0 +1,405 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    GridComb.cpp                       //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "GridComb.h"
+#include <math.h>
+#include <string>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <time.h>
+
+using namespace std;
+
+//ACHTUNG
+//////////////////////////////////////////////////////////////////////
+//ACHTUNG: Bisher keine Fehlerroutine, die auf unterschiedlich gro�e InputGrids im DateiOrdner hinweist -> moegliche Fehlerursache!!!
+//////////////////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------
+//#########################################################
+
+CGridComb::CGridComb(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("GridCombination");
+	Set_Author		("Christian Alwardt");
+	Set_Description	("Grid Combination");
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "INPUT"	, "Gelaendemodell (DTM)",
+		"Digitales Gelaendemodell des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_FilePath(
+		Parameters("GENERAL_NODE")	, "Folder1", _TL("Pfad WaterGap Raster"),
+		_TL("Ordnerpfad in dem alle zu bearbeitenden WaterGap Raster abgelegt sind"), _TL("SAGA Grid Files (*.sgrd)|*.sgrd|All Files|*.*"),0 ,false ,true ,false
+	);
+
+	Parameters.Add_Value(
+		NULL, "sY"	, "Start-Jahr",
+		"Jahr in dem die Gridoperation startet",
+		PARAMETER_TYPE_Int, 1990, 1906, true, 2000, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "eY"	, "End-Jahr",
+		"Jahr in dem der Verarbeitungsprozess enden soll",
+		PARAMETER_TYPE_Int, 1990, 1906, true, 2000, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "DomW", "Domestic Water",
+		"Beruecksichtigung der Domestic Water im resultieren Raster.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "ElecW", "Electricity Water",
+		"Beruecksichtigung der Electricity Water im resultieren Raster.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "LiveW", "Livestock Water",
+		"Beruecksichtigung der Livestock Water im resultieren Raster.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "ManW", "Manufacturing Water",
+		"Beruecksichtigung des Manufacturing Water im resultieren Raster.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "IrrW", "Irrigation Water",
+		"Beruecksichtigung des Irrigation Water im resultieren Raster (moeglicher Einheitenfehler im WaterGapDatensatz!!).",
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Choice(
+		Parameters("GENERAL_NODE")	, "FvA"	, _TL("Flaechenverbrauch-Auswahl (FvA)"),
+		_TL(""),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("Resultierendes Raster ueber WasserENTNAHME erstellen"),
+			_TL("Resultierendes Raster ueber WasserNUTZUNG erstellen")
+		), 0
+	);
+	
+
+}
+
+
+//---------------------------------------------------------
+//#########################################################
+bool CGridComb::On_Execute(void)
+{
+	//-----------------------------------------------------
+	// Get the parameter settings...
+
+	m_pRefGrid = Parameters("INPUT")->asGrid();
+	m_pDataFolder = Parameters("Folder1")->asString();
+	sY = Parameters("sY")->asInt();
+	eY = Parameters("eY")->asInt();
+
+	m_pGridComb = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+	m_pDomW = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+	m_pElecW = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+	m_pLiveW = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+	m_pManW = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+	m_pIrrW = SG_Create_Grid(m_pRefGrid, SG_DATATYPE_Double);
+
+	m_pFvA = Parameters("FvA")->asInt(); //Auswahlplatzhalter ob Wasserentnahme oder Wassernutzung beruecksichtigt werden soll
+
+	//-----------------------------------------------------
+	//Startdatum/Zeit erfassen
+	time_t rawtime;
+	struct tm * timeinfo;
+	time (&rawtime);
+	timeinfo = localtime (&rawtime);
+	//-----------------------------------------------------
+
+
+	//-----------------------------------------------------
+	// Do something...
+
+	//-----------------------------------------------------	
+	//SpeicherDateipfad (sfile) fuer diese Simulation wird generiert und entsprechender Ordner erstellt - Ordnerformat : ddmmyy_HHMM
+	std::stringstream sPath0;
+	sPath0.str("");
+	char buffer [20];
+	strftime(buffer,20,"%d%m%y_%H%M",timeinfo);
+	sPath0 << m_pDataFolder.b_str() << "\\Total-" << "FvA" << m_pFvA << "-D" << Parameters("DomW")->asBool() << "E" << Parameters("ElecW")->asBool() << "L" << Parameters("LiveW")->asBool() << "M" << Parameters("ManW")->asBool() << "I" << Parameters("IrrW")->asBool() << "-" << buffer;
+	std::string m_pSPath;
+	m_pSPath = sPath0.str();							//Speicherdateipfad
+	SG_Dir_Create(CSG_String(m_pSPath.c_str()));		//Ordner wird erstellt
+	SPath = m_pSPath.c_str();
+	//-----------------------------------------------------
+
+
+
+	//-----------------------------------------------------
+	//Fehlerroutine
+
+	if((eY - sY) < 0)
+	{
+		Message_Dlg("Fehler: Das EndJahr liegt vor dem Startjahr");
+			return (false);
+	}
+
+	if( (m_pFvA == 0) && Parameters("LiveW")->asBool() )
+		Message_Dlg("Hinweis: Fuer den Livestock liegen nur Wassernutzungsdaten vor. Diese werden deshalb auch fuer die Kalkulation der Wasserentnahme herangezogen");
+	//-----------------------------------------------------
+
+
+
+	NX = m_pRefGrid->Get_NX();	//Anzahl der Reihen x
+	NY = m_pRefGrid->Get_NY();	//Anzahl der Zeilen y
+
+
+//-----------------------------------------------------
+//Jahresschleife
+	for(int n = sY; n <= eY; n++ )
+	{
+		if(Parameters("DomW")->asBool())
+		{
+			CSG_String sDomW;
+			if( m_pFvA == 0 )
+				sDomW.Printf(SG_T("%s/domwith_%d.sgrd"), m_pDataFolder.c_str(), n);
+			else
+				sDomW.Printf(SG_T("%s/domcon_%d.sgrd"), m_pDataFolder.c_str(), n);
+			
+			if(!m_pDomW->Create(sDomW))
+				m_pDomW->Assign(0.0);
+		}
+
+		if(Parameters("ElecW")->asBool())
+		{
+			CSG_String sElecW;
+			if( m_pFvA == 0 )
+				sElecW.Printf(SG_T("%s/elecwith_%d.sgrd"), m_pDataFolder.c_str(), n);
+			else
+				sElecW.Printf(SG_T("%s/eleccon_%d.sgrd"), m_pDataFolder.c_str(), n);
+			
+			if(!m_pElecW->Create(sElecW))
+				m_pElecW->Assign(0.0);
+		}
+
+		if(Parameters("LiveW")->asBool())
+		{
+			CSG_String sLiveW;
+			sLiveW.Printf(SG_T("%s/livecon_%d.sgrd"), m_pDataFolder.c_str(), n);
+			
+			if(!m_pLiveW->Create(sLiveW))
+				m_pLiveW->Assign(0.0);
+		}
+
+		if(Parameters("ManW")->asBool())
+		{
+			CSG_String sManW;
+			if( m_pFvA == 0 )
+				sManW.Printf(SG_T("%s/manwith_%d.sgrd"), m_pDataFolder.c_str(), n);
+			else
+				sManW.Printf(SG_T("%s/mancon_%d.sgrd"), m_pDataFolder.c_str(), n);
+			
+			if(!m_pManW->Create(sManW))
+				m_pManW->Assign(0.0);
+		}
+		
+		
+		if(Parameters("IrrW")->asBool())
+		{
+			CSG_String sIrrW;
+
+			//-----------------------------------------------------
+			//Im Fall von IrrigationData -> extra Monatsschleife
+			//####ACHTUNG!!######
+			//Annahme, dass die Einheit fuer IrrigationData falsch angegebn ist und in Wirklichkeit und m3/month betraegt,
+			//deshalb wird durch (86400*30) getielt um Einheit m3/s zu erhalten - siehe unten !!
+			for(int i=0; i<12; i++)
+			{
+				if( m_pFvA == 0 )
+					sIrrW.Printf(SG_T("%s/PIrrWW_%d_%d.sgrd"), m_pDataFolder.c_str(), n, i+1);
+				else
+					sIrrW.Printf(SG_T("%s/PIrrUse_%d_%d.sgrd"), m_pDataFolder.c_str(), n, i+1);
+				
+				if(!m_pIrrW->Create(sIrrW))
+					m_pIrrW->Assign(0.0);
+		
+				for(int x=0; x < NX; x++)
+				{
+					for(int y=0; y < NY; y++)
+					{
+						if(m_pRefGrid->is_NoData(x,y)) 
+							m_pGridComb->Set_NoData(x,y);
+						else
+						{
+							m_pGridComb->Set_Value(x, y, (m_pDomW->asDouble(x,y) + m_pElecW->asDouble(x,y) + m_pLiveW->asDouble(x,y) + m_pManW->asDouble(x,y) + ( m_pIrrW->asDouble(x,y) / 86400 / 30 ) )); 
+						
+						//Monitoring:
+						double a = m_pDomW->asDouble(x,y);
+						double b = m_pElecW->asDouble(x,y);
+						double c = m_pLiveW->asDouble(x,y);
+						double d = m_pManW->asDouble(x,y);
+						double e = ( m_pIrrW->asDouble(x,y) / 86400 / 30 );
+						//		
+						}
+
+					}
+				}
+				CSG_String SaveAsFile;
+					
+				SaveAsFile.Printf(SG_T("%s/TotalWUse_%d_%d.sgrd"), SPath.c_str(), n, i+1);
+										
+				m_pGridComb->Save(SaveAsFile);
+			}
+				//-----------------------------------------------------
+		}
+		else
+		{
+			for(int x=0; x < NX; x++)
+			{
+				for(int y=0; y < NY; y++)
+				{
+					if(m_pRefGrid->is_NoData(x,y)) 
+						m_pGridComb->Set_NoData(x,y);
+					else
+						m_pGridComb->Set_Value(x, y, (m_pDomW->asDouble(x,y) + m_pElecW->asDouble(x,y) + m_pLiveW->asDouble(x,y) + m_pManW->asDouble(x,y)) ); 
+				}
+			}
+			
+			CSG_String SaveAsFile;
+			
+			SaveAsFile.Printf(SG_T("%s/TotalWUse_%d.sgrd"), SPath.c_str(), n);
+			
+			m_pGridComb->Save(SaveAsFile);
+		}
+	}
+
+//-----------------------------------------------------
+
+	SaveParameters();
+
+	delete(m_pDomW);
+	delete(m_pElecW);
+	delete(m_pLiveW);
+	delete(m_pManW);
+	delete(m_pIrrW);
+	delete(m_pGridComb);
+
+	//-----------------------------------------------------
+	// Return 'true' if everything is okay...
+
+	return( true );
+}
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+
+
+bool CGridComb::SaveParameters()
+{
+	int i = 0;
+
+	int d = NX * NY;
+	time_t rawtime;
+	time(&rawtime);
+
+	CSG_String sSaveFile;
+	sSaveFile.Printf(SG_T("%s/Parameters.txt"), SPath.c_str() );
+
+	fstream myfile;
+	myfile.open(sSaveFile.b_str(), ios::out|ios::trunc);
+
+	myfile << "Einstellungen der Grid-Kombination." << "\n\n";
+	myfile << "Timestamp: " << ctime(&rawtime) << "\n\n";
+	myfile << "Einstellungen:\n\n";
+	myfile << "StartJahr = " << sY << "\n";
+	myfile << "EndJahr = " << eY << "\n\n";
+	
+	myfile << "DomW: " << Parameters("DomW")->asBool() << "\n";
+	myfile << "ElecW: " << Parameters("ElecW")->asBool() << "\n";
+	myfile << "LiveW: " << Parameters("LiveW")->asBool() << "\n";
+	myfile << "ManW: " << Parameters("ManW")->asBool() << "\n";
+	myfile << "IrrW: " << Parameters("IrrW")->asBool() << "\n\n";
+
+	myfile << "FlaechennutzungsAuswahl - WaterWithdrawl [=0] oder WaterConsumption[=1]:" << m_pFvA << "\n\n";
+
+	myfile << "SpeicherDateipfad: " << sSaveFile.b_str() << "\n\n";
+
+	myfile.close();
+
+return true;
+}
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.h b/src/modules/simulation/sim_rivflow/GridComb.h
similarity index 64%
copy from src/modules/shapes/shapes_lines/line_split_with_lines.h
copy to src/modules/simulation/sim_rivflow/GridComb.h
index c4229fc..d9f13b5 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.h
+++ b/src/modules/simulation/sim_rivflow/GridComb.h
@@ -1,108 +1,107 @@
-/**********************************************************
- * Version $Id: line_split_with_lines.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     shapes_lines                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                line_split_with_lines.h                //
-//                                                       //
-//                 Copyright (C) 2014 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__line_split_with_lines_H
-#define HEADER_INCLUDED__line_split_with_lines_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CLine_Split_with_Lines : public CSG_Module  
-{
-public:
-	CLine_Split_with_Lines(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	bool					Get_Intersection	(CSG_Shape *pLine, CSG_Shape_Part *pSplit);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__line_split_with_lines_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      GridComb.h                       //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__GridComb_H
+#define HEADER_INCLUDED__GridComb_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+//#########################################################
+
+class CGridComb : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CGridComb(void);							// constructor
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute	(void);		// always overwrite this function
+
+
+private: ///// private members and functions: /////////////
+
+int sY, eY;
+int NX, NY;
+int m_pFvA; //Auswahlplatzhalter ob Wasserentnahme oder Wassernutzung ber�cksichtigt werden soll
+
+CSG_String m_pDataFolder;
+CSG_String SPath;
+
+CSG_Grid *m_pRefGrid;
+CSG_Grid *m_pGridComb;
+CSG_Grid *m_pDomW;
+CSG_Grid *m_pElecW;
+CSG_Grid *m_pLiveW;
+CSG_Grid *m_pManW;
+CSG_Grid *m_pIrrW;
+
+bool SaveParameters();
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__GridComb_H
diff --git a/src/modules/simulation/sim_rivflow/LandFlow.cpp b/src/modules/simulation/sim_rivflow/LandFlow.cpp
new file mode 100644
index 0000000..7298773
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/LandFlow.cpp
@@ -0,0 +1,3165 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     LandFlow.cpp                      //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "LandFlow.h"
+
+#include <math.h>
+#include <string>
+#include <iostream>
+#include <stdio.h>
+#include <fstream>
+#include <stdlib.h>
+#include <sstream>
+#include <exception>
+
+#include <time.h>
+#include <saga_api/datetime.h>
+
+using namespace std;
+
+#define ESC 27
+
+
+//---------------------------------------------------------
+//#########################################################
+
+CLandFlow::CLandFlow(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("LandFlow Version 1.0 (build 3.5.1b)"); //Manuelle erhoehung der WaterUseDATEN (NUR fuer Entnahme aus HG-Rasterzelle)
+	Set_Author		("Christian Alwardt");
+	Set_Description	("Landflow of RiverBasine");
+	cVers = 3.51; 
+	
+	//###################################################################
+	//-----------------------------------------------------
+	//Parameters list...
+
+
+	//-----------------------------------------------------
+	//Parameter Gruppierung...		
+	CSG_Parameter	*pNode0;
+	CSG_Parameter	*pNode1;
+	CSG_Parameter	*pNode2;
+	CSG_Parameter	*pNode3;
+	CSG_Parameter	*pNode4;
+	CSG_Parameter	*pNode5;
+	CSG_Parameter	*pNode11;
+	CSG_Parameter	*pNode21;
+	CSG_Parameter	*pNode41;
+	CSG_Parameter	*pNode42;
+	CSG_Parameter	*pNode51;
+	CSG_Parameter	*pNode52;
+	CSG_Parameter	*pNode53;
+	CSG_Parameter	*pNode54;
+	CSG_Parameter	*pNode55;
+
+	
+	pNode0	= Parameters.Add_Node(
+		NULL	, "SOURCE_NODE"	, _TL("Eingangsdaten"),
+		_TL("")
+	);
+
+	pNode0	= Parameters.Add_Node(
+		NULL	, "TARGET_NODE"	, _TL("Ausgabedaten"),
+		_TL("")
+	);
+
+	pNode1	= Parameters.Add_Node(
+		NULL	, "GENERAL_NODE", _TL("Allgemeine Parameter"),
+		_TL("")
+	);
+
+	pNode11	= Parameters.Add_Node(
+		pNode1	, "LS_NODE", _TL("Vertikale Zufluesse"),
+		_TL("")
+	);
+	
+	pNode2	= Parameters.Add_Node(
+		NULL	, "FLOW_NODE", _TL("Parameterwerte HD Modell"),
+		_TL("")
+	);
+
+	pNode21	= Parameters.Add_Node(
+		pNode2	, "RIV_NODE", _TL("Hauptgerinne-Parameter (erweitertes HD-Modell)"),
+		_TL("")
+	);
+
+	pNode3	= Parameters.Add_Node(
+		NULL	, "WTHD_NODE", _TL("Dynamische Flaechenwassernutzung und Abflussreduktion"),
+		_TL("")
+	);
+
+	pNode4	= Parameters.Add_Node(
+		NULL	, "RM_NODE", _TL("Punktuelle Rasterzellenmanipulation"),
+		_TL("")
+	);
+
+	pNode41	= Parameters.Add_Node(
+		pNode4	, "RM1_NODE", _TL("Rasterzelle 1"),
+		_TL("Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 1")
+	);
+
+	pNode42	= Parameters.Add_Node(
+		pNode4	, "RM2_NODE", _TL("Rasterzelle 2"),
+		_TL("Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 2")
+	);
+	
+	pNode5	= Parameters.Add_Node(
+		NULL	, "MONI_NODE", _TL("Test- und Monitoring-Routinen"),
+		_TL("")
+	);
+
+	pNode51	= Parameters.Add_Node(
+		pNode5	, "EvP1_NODE", _TL("Evaluierungspunkt 1 [Default: Elbe5000]"),
+		_TL("")
+	);
+
+	pNode52	= Parameters.Add_Node(
+		pNode5	, "EvP2_NODE", _TL("Evaluierungspunkt 2 [Default: Elbe5000]"),
+		_TL("")
+	);
+
+	pNode53	= Parameters.Add_Node(
+		pNode5	, "EvP3_NODE", _TL("Evaluierungspunkt 3 [Default: Elbe5000]"),
+		_TL("")
+	);
+
+	pNode54	= Parameters.Add_Node(
+		pNode5	, "RBM_NODE", _TL("Ausgangsrasterzelle Flusseinzugsgebiet [Default: Elbe5000]"),
+		_TL("")
+	);
+	
+	pNode55	= Parameters.Add_Node(
+		pNode5	, "TEST1_NODE", _TL("TestRoutine 1"),
+		_TL("")
+	);
+
+	//-----------------------------------------------------
+	//Grids...	
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT", "Gelaendemodell (DTM)",
+		"Digitales Gelaendemodell des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT2"	, "Hoehengradienten (Grad)",
+		"Abflussgradienten jeder Rasterzelle des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+		
+	Parameters.Add_Grid(
+		NULL, "INPUT10"	, "Flusseinzugsgebiet (BasinShare)",
+		"Abgrenzung des Flusseinzugsgebiets mit den Teileinzugsgebieten des Flussnetzwerkes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT8"	, "HG-Raster (HGGrid)",
+		"Hauptgerinnerasterzellen",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "INPUT9"	, "HG-Hoehengradienten (HGGrad)",
+		"Abflussgradienten der Hauptgerinnerasterzellen",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "INPUT11"	, "Referenzverlauf Flussbilanz",
+		"Raster des Referenzverlauf des (linearen) Hauptflussarmes, der zur Erstellung der Flusswasserbilanz herangezogen werden soll",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Grid(
+		NULL, "INPUT12"	, "Zuflussrasterzellen (NumInFlowCells)",
+		"Raster mit Angabe ueber die Anzahl der Rasterzellen, die in eine spezifische Rasterzelle (x,y) abflieszen",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Grid(
+		Parameters("WTHD_NODE"), "INPUT3" , "statische Wassserentnahme (statWUse)",
+		"Flaechenbasierte statische Wassserentnahme pro RiverGridbox in. ACHTUNG: Funktioniert ggf. nur bei bereits initiierten Systemen bzw. Vorlauf",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT5"	, "Fluss-Speicher einlesen",
+		"Simulation mit spezifischen Gerinne- bzw. Hauptgerinne-Speicherwerten (ChannelFlow) initiieren",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT6"	, "Oberflaechenabfluss-Speicher einlesen",
+		"Simulation mit spezifischen Oberflaechenabfluss-Speicherwerten (OverlandFlow) initiieren",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Grid(
+		Parameters("SOURCE_NODE"), "INPUT7"	, "Grundwasserabfluss-Speicher einlesen",
+		"Simulation mit spezifischen Grundwasserabfluss-Speicherwerten (BaseFlow) initiieren",
+		PARAMETER_INPUT_OPTIONAL
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+	
+	Parameters.Add_Grid(
+		Parameters("TARGET_NODE"), "OUTPUT"	, "Fluss-Speicher ausgeben",
+		"Fluss-Speicher 'CFCache' (ChannelFlowCache) am Ende der Simulation ausgeben - Initialisierungsdaten)",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("TARGET_NODE"), "OUTPUT2" , "Oberflaechenabfluss-Speicher ausgeben",
+		"Oberflaechenabfluss-Speicher 'OFCache' (OverlandFlowCache) am Ende der Simulation ausgeben - Initialisierungsdaten",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("TARGET_NODE"), "OUTPUT3" , "Grundwasserabfluss-Speicher ausgeben",
+		"Grundwasserabfluss-Speicher 'BFCache' (BaseFlowCache) am Ende der Simulation ausgeben - Initialisierungsdaten",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("TARGET_NODE"), "OUTPUT4" , "Wasserflussvolumen",
+		"Wasserflussvolumen in m3/s",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("TARGET_NODE"), "OUTPUT5"	, "SumRunoffDrainage",
+		"Aufsummieren der vertikalen Runoff und Drainage Zufluesse fuer jede Rasterzelle ueber den gesamten Simulationsverlauf",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		Parameters("WTHD_NODE"), "OUTPUT6"	, "DynWUse",
+		"Dynamisch eingelesene Flaechenwasssernutzung pro Rasterzelle. ACHTUNG: Funktioniert nur bei bereits initiierten Systemen bzw. Vorlauf",
+		PARAMETER_OUTPUT
+		//siehe Funktion WConsRiv()
+		//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+	//-----------------------------------------------------
+	
+	//Allgemeine Parameter...	
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "onlyRB"	, "Berechnung nur im Flusseinzugsgebiet",
+		"Der Abfluss wird nur ueber die Rasterzellen des Flusseinzugsgebietes berechnet",
+		PARAMETER_TYPE_Bool, true		
+	);
+	
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "TimeStep"	, "Zeitschrittdauer [s]",
+		"Dauer eines Simulations-Zeitschritts in Sekunden",
+		PARAMETER_TYPE_Int, 1, 1, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "CalcT", "automatisierter max. Zeitschritt",
+		"Automatisierte Berechnung der maximal moeglichen Dauer eines Zeitschrittes in [s] - Zeitschrittdauern wird ignoriert.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "sYear"	, "Startjahr",
+		"Jahr in dem die Simulation zum 1. Januar gestartet wird",
+		PARAMETER_TYPE_Int, 1999, 1979, true, 2009, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "DayNum"	, "Anzahl der Simulationstage",
+		"Anzahl der gesamten Simulationtage ueber die berechnete wird",
+		PARAMETER_TYPE_Int, 365, 1, true, 7670, true 
+	);
+			
+	Parameters.Add_FilePath(
+		Parameters("GENERAL_NODE")	, "Folder2", _TL("Speicherordner"),
+		_TL("Ordern in den alle Ausgabedaten gespeichert werden sollen"), _TL("Textdatei|*.txt|All Files|*.*"), 0, false ,true ,false
+	);
+		
+	Parameters.Add_FilePath(
+		Parameters("LS_NODE")	, "Folder1", _TL("Pfad LS-Daten"),
+		_TL("Ordnerpfad der Surface Runoff- und Drainagerasterdaten des Landoberflaechenschemas"), _TL("SAGA Grid Files (*.sgrd)|*.sgrd|All Files|*.*"),0 ,false ,true ,false
+	);
+	
+	Parameters.Add_Value(
+		Parameters("LS_NODE"), "stRedFacR", "Reduzierungsfaktor Surface Runoff [% / 100]",
+		"Statische Reduzierung des vertikalen Zuflusses 'Surface Runoff' in [% / 100] pro Zeitschritt.",
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("LS_NODE"), "autoFacD"	, "Ausgleich der Surface Runoff Reduktion",
+		"Erhoeht automatisch die Drainage um denjenigen Volumenbetrag, um den der Surface Runoff reduziert wurde. Wenn gesetzt, wird etwaige Reduzierung der Drainage NICHT beruecksichtigt!",
+		PARAMETER_TYPE_Bool, 0		
+	);
+
+	Parameters.Add_Value(
+		Parameters("LS_NODE"), "stRedFacD", "Reduzierungsfaktor Drainage [% / 100]",
+		"Statische Reduzierung des vertikalen Zuflusses der 'Drainage' in [% / 100] pro Zeitschritt.",
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("LS_NODE"), "OffsetR", "Offsetwert Surface Runoff [m3/s]",
+		"Statischer Offsetwert auf den vertikalen Zufluss 'Surface Runoff' in [m3/s] je Rasterzelle. ACHTUNG wird auf jede Rasterzelle angewendet, daher limitiert auf +/-1 m3/s. Bei Wahl des Wertes Aufloesung beachten! ",
+		PARAMETER_TYPE_Double, 0.0, -1.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("LS_NODE"), "OffsetD", "Offsetwert Drainage [m3/s]",
+		"Statischer Offsetwert auf den vertikalen Zufluss 'Drainage' in [m3/s] je Rasterzelle. ACHTUNG wird auf jede Rasterzelle angewendet, daher limitiert auf +/-1 m3/s. Bei Wahl des Wertes Aufloesung beachten!",
+		PARAMETER_TYPE_Double, 0.0, -1.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "CacheUse", "Initiierung mit vorhandenen Speichern",
+		"Initialisierung der Simulation mit spezifischen Speicherwerten (Raster und NCache)",
+		PARAMETER_TYPE_Bool, false
+	);
+
+	Parameters.Add_FilePath(
+		Parameters("GENERAL_NODE")	, "Folder4", _TL("NCache einlesen"),
+		_TL("Einlesen der NCache Textdatei"), _TL("Textdatei (*.txt)|*.txt|All Files|*.*"),0 ,false ,false ,false
+	);
+
+	Parameters.Add_Value(
+		Parameters("GENERAL_NODE"), "wNC"	, "Ausgabe NCache",
+		"Schreibt die Werte der Speicherkaskaden zum Ende Simulation in eine Textdatei (Initialisierungsdaten)",
+		PARAMETER_TYPE_Bool, 0		
+	);
+	//-----------------------------------------------------
+
+
+	//Parameterwerte HD Modell
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "ParamC"	, "Gerinne-Parameter cG",
+		"Parameter cG zur Berechnung der Lagtime kG des Gerinneabflusses",
+		PARAMETER_TYPE_Double, 6e-2, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "ParamG"	, "Oberflaechen-Parameter cO",
+		"Parameter cO zur Berechnung der Lagtime kO des Oberflaechenabflusses",
+		PARAMETER_TYPE_Double, 357e-3, 0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "ParamB"	, "Grundwasser-Parameter pB",
+		"Parameter pB zur Berechnung der Lagtime kB des Grundwasserabflusses",
+		PARAMETER_TYPE_Double, 300, 0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "nG"	, "Gerinne-Speicherkaskade nG",
+		"Festlegen, wieviele Speicher die Gerinne-Speicherkaskade nG enthaelt",
+		PARAMETER_TYPE_Int, 3, 1, true		
+	);
+
+	Parameters.Add_Choice(
+		Parameters("RIV_NODE")	, "RivG"	, _TL("Beruecksichtigung der Hauptgerinnerasterzellen?"),
+		_TL("Seperate Beruecksichtigung und Berechnung ueber Hauptgerinnerasterzellen - neben den normalen Gerinnerasterzellen."),
+		CSG_String::Format(SG_T("%s|%s|")/*(SG_T("%s|%s|%s|%s|")*/,
+			_TL("nein"),
+			_TL("ja; bestimmen anhand eines Hauptgerinnerasters (HG Raster)")/*,
+			_TL("ja; bestimmen ueber das Wasserflussvolumen (P:RFlow)"),
+			_TL("ja; bestimmen ueber die jeweilige Anzahl der ZuflussRasterzellen (IR:NumInFlowCells, P:NumCells")*/
+		), 1
+	);
+
+	Parameters.Add_Value(
+		Parameters("RIV_NODE"), "ParamCr"	, "Hauptgerinne-Parameter cHG",
+		"Parameter cHG zur Berechnung der Lagtime kHG des ChannelFlow-River [optional siehe oben]",
+		PARAMETER_TYPE_Double, 0.007, 0, true, 1.0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RIV_NODE"), "nHG"	, "Hauptgerinne-Speicherkaskade nHG",
+		"Festlegen, wieviele Speicher die Hauptgerinne-Speicherkaskade enthaelt  [optional siehe oben]",
+		PARAMETER_TYPE_Int, 1, 1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "EnfVmax", "Abflussgeschwindigkeit begrenzen",
+		"Die mittlere Wasserabflussgeschwindigkeit wird auf einen Hoechstwert begrenzt - Zeitschrittvorgaben und automatisierter Zeitschritt wird ueberschrieben.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "VTresh"	, "Oberer Abflussgeschwindigkeitsgrenzwert [km/h]",
+		"Maximale mittlere Wasserabflussgeschwindigkeit in km/h",
+		PARAMETER_TYPE_Double, 4, 0, true, 10, true		//Achtung!! Obergrenze statisch eingestellt
+	);
+	//-----------------------------------------------------
+
+
+	//Dynamische Wasserentnahme und Abflussreduktion
+	Parameters.Add_Choice(
+		Parameters("WTHD_NODE")	, "WCons"	, _TL("Dynamische Flaechenwassernutzung..."),
+		_TL("Auswahl der Art der dynamischen Flaechenwasserwassernutzung (WUse). ACHTUNG: Funktioniert ggf. nur bei bereits initiierten Systemen bzw. nach Vorlauf"),
+		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
+			_TL("keine"),
+			_TL("...anteilig aus den Hauptgerinnerasterzellen"),
+			_TL("...anteilig aus Rasterzellen der Teileinzugegebiete"),
+			_TL("...genau den entsprechenden Wert aus der jeweiligen Rasterzelle entnehmen")
+		), 0
+	);
+	
+	Parameters.Add_FilePath(
+		Parameters("WTHD_NODE")	, "Folder3", _TL("Ordnerpfad der WUse Daten"),
+		_TL("Speicherpfad der dynamischen Wassernutzungsdaten"), _TL("SAGA Grid Files (*.sgrd)|*.sgrd|All Files|*.*"),0 ,false ,true ,false
+	);
+
+
+	Parameters.Add_Choice(
+		Parameters("WTHD_NODE")	, "WConUnit"	, _TL("WUse Einheit"),
+		_TL("Einheit in der die WUse Daten vorliegen"),
+		CSG_String::Format(SG_T("%s|%s|"),
+			_TL("m3/s"),
+			_TL("m3/Monat")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		Parameters("WTHD_NODE"), "WConsD"	, "Vorlauftage ohne Entnahmen",
+		"Anzahl der Simulationestage bevor eine Wasserentnahme beruecksichtigt wird",
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("WTHD_NODE"), "WConThres", "Abflussschwellenwert [m3/s]",
+		"Fester Abflussschwellenwert in m3/s fuer das Hauptgerinne, der durch Entnahmen nicht unterschritten werden soll.",
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("WTHD_NODE"), "stConsAll", "Abflussreduzierungsfaktor Gerinnerasterzellen [% / 100]",
+		"Statische Reduzierung des Gesamtabflusses in den Gerinnerasterzellen um [% / 100] pro Zeitschritt.",
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("WTHD_NODE"), "stConsRiv", "Abflussreduzierungsfaktor HG-Rasterzellen [% / 100]",
+		"Statische Reduzierung des Gesamtabflusses  in den Hauptgerinnegitterboxen um [% / 100] pro Zeitschritt.",
+		PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true
+	);
+	//-----------------------------------------------------
+
+	//punktuelle Rasterzellenmanipulation
+	//RM1
+	Parameters.Add_Choice(
+		Parameters("RM1_NODE")	, "vRM1"	, _TL("Abflussmanipulation Rasterzelle 1... "),
+		_TL("Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 1 manipuliert werden. "),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nein"),
+			_TL("Ja, berechneten Abfluss veraendern: res. Abfluss = berechn. Abfluss * q + a"),
+			_TL("Ja, Abfluss manuell vorgeben: res. Abfluss = Speicherinhalt * q + a")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM1_NODE"), "RM1x"	, "Rasterzelle 1 [x-Koord.]",
+		"x-Koordinate der Rasterzelle 1, fuer die der Abfluss manipulatiert werden soll",
+		PARAMETER_TYPE_Int, -1, -1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM1_NODE"), "RM1y"	, "Rasterzelle 1 [y-Koord.]",
+		"y-Koordinate der Rasterzelle 1, fuer die der Abfluss manipulatiert werden soll",
+		PARAMETER_TYPE_Int, -1, -1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM1_NODE"), "RM1q"	, "q [%/100]",
+		"Prozentualer Faktor q [%/100] fuer Rasterzelle 1",
+		PARAMETER_TYPE_Double, 1, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM1_NODE"), "RM1a"	, "a [+-m3/s]",
+		"Addidativer Offsetwert a [+-m3/s] fuer Rasterzelle 1",
+		PARAMETER_TYPE_Double, 0		
+	);
+
+	//RM22
+	Parameters.Add_Choice(
+		Parameters("RM2_NODE")	, "vRM2"	, _TL("Abflussmanipulation Rasterzelle 2... "),
+		_TL("Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 2 manipuliert werden. "),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nein"),
+			_TL("Ja, berechneten Abfluss veraendern: res. Abfluss = berechn. Abfluss * q + a"),
+			_TL("Ja, Abfluss manuell vorgeben: res. Abfluss = Speicherinhalt * q + a")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM2_NODE"), "RM2x"	, "Rasterzelle 2 [x-Koord.]",
+		"x-Koordinate der Rasterzelle 2, fuer die der Abfluss manipulatiert werden soll",
+		PARAMETER_TYPE_Int, -1, -1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM2_NODE"), "RM2y"	, "Rasterzelle 2 [y-Koord.]",
+		"y-Koordinate der Rasterzelle 2, fuer die der Abfluss manipulatiert werden soll",
+		PARAMETER_TYPE_Int, -1, -1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM2_NODE"), "RM2q"	, "q [%/100]",
+		"Prozentualer Faktor q [%/100] fuer Rasterzelle 2",
+		PARAMETER_TYPE_Double, 1, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RM2_NODE"), "RM2a"	, "a [+-m3/s]",
+		"Addidativer Offsetwert a [+-m3/s] fuer Rasterzelle 2",
+		PARAMETER_TYPE_Double, 0		
+	);
+	
+
+	//Test- und Monitoring-Routinen
+	//EvP1
+	Parameters.Add_String(
+		Parameters("EvP1_NODE")	, "EvP1s"	, _TL("EvP1 Name"),
+		_TL("Name des Evaluierungspunktes 1"),
+		SG_T("NeuDarchau.txt")
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP1_NODE"), "EvP1x"	, "EvP1 Rasterzelle [x-Koord.]",
+		"x-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 1",
+		PARAMETER_TYPE_Int, 30, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP1_NODE"), "EvP1y"	, "EvP1 Rasterzelle [y-Koord.]",
+		"y-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 1",
+		PARAMETER_TYPE_Int, 115, 0, true		
+	);
+
+	//EvP2
+	Parameters.Add_String(
+		Parameters("EvP2_NODE")	, "EvP2s"	, _TL("EvP2 Name"),
+		_TL("Name des Evaluierungspunktes 2"),
+		SG_T("Lutherstadt-Wittenberg.txt")
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP2_NODE"), "EvP2x"	, "EvP2 Rasterzelle [x-Koord.]",
+		"x-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 2",
+		PARAMETER_TYPE_Int, 54, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP2_NODE"), "EvP2y"	, "EvP2 Rasterzelle [y-Koord.]",
+		"y-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 2",
+		PARAMETER_TYPE_Int, 85, 0, true		
+	);
+
+	//EvP3
+	Parameters.Add_String(
+		Parameters("EvP3_NODE")	, "EvP3s"	, _TL("EvP3 Name"),
+		_TL("Name des Evaluierungspunktes 3"),
+		SG_T("Schoena.txt")
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP3_NODE"), "EvP3x"	, "EvP3 Rasterzelle [x-Koord.]",
+		"x-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 3",
+		PARAMETER_TYPE_Int, 78, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("EvP3_NODE"), "EvP3y"	, "EvP3 Rasterzelle [y-Koord.]",
+		"y-Koordinate der spezifischen Hauptgerinnerasterzelle des Evaluerungspunktes 3",
+		PARAMETER_TYPE_Int, 65, 0, true		
+	);
+
+	//RBM
+	Parameters.Add_Value(
+		Parameters("RBM_NODE"), "RBMx"	, "Ausgangsrasterzelle [x-Koord.]",
+		"x-Koordinate der Ausgangsrasterzelle des Flusseinzugsgebietes",
+		PARAMETER_TYPE_Int, 16, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("RBM_NODE"), "RBMy"	, "Ausgangsrasterzelle [y-Koord.]",
+		"y-Koordinate der Ausgangsrasterzelle des Flusseinzugsgebietes",
+		PARAMETER_TYPE_Int, 121, 0, true		
+	);
+	
+	Parameters.Add_Value(
+		Parameters("MONI_NODE"), "wP"	, "SimParameters",
+		"Schreibt wichtige, der Simulation zugrundeliegenden Parameter in eine Textdatei",
+		PARAMETER_TYPE_Bool, 1		
+	);
+		
+	Parameters.Add_Value(
+		Parameters("MONI_NODE"), "eP"	, "Fehlerprotokoll",
+		"Schreibt Fehler in Textfile",
+		PARAMETER_TYPE_Bool, 1		
+	);
+
+	Parameters.Add_Value(
+		Parameters("MONI_NODE"), "MoniLog1"	, "RiverBasinDay-Monitoring",
+		"Monitoring taegicher Werte des Flusseinzugsgebiets",
+		PARAMETER_TYPE_Bool, 1		
+	);
+	
+	Parameters.Add_Value(
+		Parameters("MONI_NODE"), "MoniLog3"	, "RiverBasinMonth-Monitoring",
+		"Monitoring monatlicher Werte des Flusseinzugsgebiets",
+		PARAMETER_TYPE_Bool, 1		
+	);
+	
+	Parameters.Add_Value(
+		Parameters("MONI_NODE"), "MoniLog2"	, "WSystem-Monitoring",
+		"Monitoring von Zu- und Abflusswerten des WasserGesamtsystems",
+		PARAMETER_TYPE_Bool, 1		
+	);
+	
+	//Test1
+	Parameters.Add_Choice(
+		Parameters("TEST1_NODE")	, "Test1"	, _TL("Testroutine1 durchfuehren... "),
+		_TL("Waehlen ob TestRoutine 1 durchgefuehrt werden soll... 1) nur fuer Teileinzugsgebiet der HG-Rasterzelle oder 2) fuer das Flusseinzugsgebiet bis zum Erreichen der HG-Rasterzelle."),
+		CSG_String::Format(SG_T("%s|%s|%s|"),
+			_TL("nein"),
+			_TL("Ja, TestRoutine1 nur fuer Teileinzugsgbiet der HG-Rasterzelle"),
+			_TL("Ja, TestRoutine1 fuer Flusseinzugsgebiet bis zu der HG-Rasterzelle")
+		), 0
+	);
+
+	Parameters.Add_Value(
+		Parameters("TEST1_NODE"), "xt1"	, "Hauptgerinnerasterzelle [x-Koord.]",
+		"x-Koordinate der spezifischen Hauptgerinnerasterzelle fuer TestRoutine 1",
+		PARAMETER_TYPE_Int, 0, 0, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("TEST1_NODE"), "yt1"	, "Hauptgerinnerasterzelle [y-Koord.]",
+		"y-Koordinate der spezifischen Hauptgerinnerasterzelle fuer TestRoutine 1",
+		PARAMETER_TYPE_Int, 0, 0, true		
+	);
+	//-----------------------------------------------------
+
+
+	/*	Parameters.Add_Value(
+		Parameters("RIV_NODE"), "RFlow"	, "Wasserflussvolumen [untere Grenze]",
+		"Unterer Grenzwert des Wasserflussvolumens, ab dem eine Flussrasterzelle vorliegen soll [siehe Auswahl 'Flussrasterzellen beruecksichtigen'].",
+		PARAMETER_TYPE_Double, 0, 0, true		
+	);
+		
+		Parameters.Add_Value(
+		Parameters("RIV_NODE"), "NumCells"	, "ZuflussRasterzellen [untere Grenze]",
+		"Unterer Grenzwert der Anzahl an ZuflussRasterzellen, ab der eine Flussrasterzelle vorliegen soll [siehe Auswahl 'Flussrasterzellen beruecksichtigen'].",
+		PARAMETER_TYPE_Int, 0, 0, true		
+	);*/
+	
+	//###################################################################
+}
+
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//	Hauptfunktion										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+bool CLandFlow::On_Execute(void)
+{
+	
+	//-----------------------------------------------------
+	//SAGA-Input
+	m_pDTM = Parameters("INPUT")->asGrid();
+	m_pGrad = Parameters("INPUT2")->asGrid();
+	m_pWConsIn = Parameters("INPUT3")->asGrid(); //statisches WaterConsumption Grid in m3/s -> [kg m-2 s-1]
+	m_pCCacheIn = Parameters("INPUT5")->asGrid();
+	m_pRCacheIn = Parameters("INPUT6")->asGrid();
+	m_pDCacheIn = Parameters("INPUT7")->asGrid();
+	m_pRivGrids = Parameters("INPUT8")->asGrid();
+	m_pRivGrad = Parameters("INPUT9")->asGrid();
+	m_pBasinShare = Parameters("INPUT10")->asGrid();
+	m_pRivBalanceGrid = Parameters("INPUT11")->asGrid();
+	m_pNumInFlow = Parameters("INPUT12")->asGrid();
+	m_pCCacheOut = Parameters("OUTPUT")->asGrid();
+	m_pRCacheOut = Parameters("OUTPUT2")->asGrid();
+	m_pDCacheOut = Parameters("OUTPUT3")->asGrid();
+	m_pChannelFlow = Parameters("OUTPUT4")->asGrid();
+	m_pSumRunoffDrainage = Parameters("OUTPUT5")->asGrid();
+	m_pWConsOut = Parameters("OUTPUT6")->asGrid(); //dynamisch imm Programmablauf generiertes WaterConsumption Grid in [kg m-2 s-1]
+	m_pTStep = Parameters("TimeStep")->asInt(); // [s]
+	m_sYear0 = Parameters("sYear")->asInt(); // [y]
+	m_pDays = Parameters("DayNum")->asInt();
+	m_pLSDataFolder = Parameters("Folder1")->asString();
+	m_pDataSaveFolder = Parameters("Folder2")->asString();
+	m_pWConDataFolder = Parameters("Folder3")->asString();
+	m_pNCacheFolder = Parameters("Folder4")->asString();
+	m_pVTresh = Parameters("VTresh")->asDouble(); // [km/h]
+	m_pWConsDIn = Parameters("WConsD")->asInt();
+	m_pWConThres = Parameters("WConThres")->asDouble();		//Schwellenwert fuer HG-Abfluss der auch bei Entnahmen nicht unterschritten werden soll
+	m_pOffsetR = Parameters("OffsetR")->asDouble();			//Offsetwert auf den vertikalen Zufluss 'RunOff' pro Rasterzelle in m3/s
+	m_pOffsetD = Parameters("OffsetD")->asDouble();			//Offsetwert auf den vertikalen Zufluss 'Drainage' pro Rasterzelle in m3/s
+	m_pConsFacAll = (Parameters("stConsAll")->asDouble());	// Entnahmefaktor aus Gitterboxen [%]/[dt]
+	m_pConsFacRiv = (Parameters("stConsRiv")->asDouble());	// Entnahmefaktor aus Fluss-Gitterboxen [%]/[dt]
+	m_pRedFacR = (Parameters("stRedFacR")->asDouble());		// Reduzierungsfaktor des RunOff [%]/[dt]
+	m_pRedFacD = (Parameters("stRedFacD")->asDouble());		// Reduzierungsfaktor der Drainage [%]/[dt]
+	nC = Parameters("nG")->asInt();							//Anzahl der Speicherkaskaden des ChannelFlow Speichers
+	nCr = Parameters("nHG")->asInt();						//Anzahl der Speicherkaskaden des ChannelFlow River-Speichers
+	C0 = Parameters("ParamC")->asDouble();
+	C0r = Parameters("ParamCr")->asDouble();				//	Parameter fuer ChannelFlow im River [optional]
+	G0 = Parameters("ParamG")->asDouble();
+	pB = Parameters("ParamB")->asDouble();
+	var2 = Parameters("MoniLog1")->asBool();
+	var3 = Parameters("MoniLog2")->asBool();
+	var4 = Parameters("MoniLog3")->asBool();
+	
+	m_pEvP1s = Parameters("EvP1s")->asString();
+	m_pEvP2s = Parameters("EvP2s")->asString();
+	m_pEvP3s = Parameters("EvP3s")->asString();
+
+	
+
+
+	//-----------------------------------------------------
+	//Setzen von statischen Programmvariablen [0]=off [1]=on 
+	var1 = 1;	//Prozentuale Wasserentnahme zulassen
+	//-----------------------------------------------------
+
+	//-----------------------------------------------------
+	//Simulationsstart: Startzeit und -datum erfassen
+	time_t rawtime;
+	struct tm * timeinfo;
+	time (&rawtime);
+	timeinfo = localtime (&rawtime);
+	//-----------------------------------------------------
+
+
+	//-----------------------------------------------------	
+	//SpeicherDateipfad (sfile) fuer diese Simulation wird generiert und entsprechender Ordner erstellt - Ordnerformat : ddmmyy_HHMM
+	std::stringstream sPath0;
+	sPath0.str("");
+	char buffer [20];
+	strftime(buffer,20,"%d%m%y_%H%M",timeinfo);
+	sPath0 << m_pDataSaveFolder.b_str() << "\\" << buffer;		//^Speicherdateipfad
+	m_pSPath = sPath0.str();							//^
+	
+	sPath0.str("");
+	sPath0 << m_pSPath << "\\Grids";					//^Unter-Speicherdateipfad1
+	m_pSPath2 = sPath0.str();							//^
+	
+	sPath0.str("");
+	sPath0 << m_pSPath << "\\RivBalance";				//^Unter-Speicherdateipfad2
+	m_pSPath3 = sPath0.str();							//^
+
+	SG_Dir_Create(CSG_String(m_pSPath .c_str()));		//SaveOrdner zum speichern der Simulationsdaten wird erstellt
+	SG_Dir_Create(CSG_String(m_pSPath2.c_str()));		//Unter-SaveOrdner1 zum speichern der Grid-Dateien wird erstellt
+	SG_Dir_Create(CSG_String(m_pSPath3.c_str()));		//Unter-SaveOrdner2 zum speichern der Grid-Dateien wird erstellt
+	//-----------------------------------------------------
+	//LoadPfad
+
+
+	//-----------------------------------------------------
+	//FileName-String 
+	std::stringstream file0;
+	std::string file;
+
+	
+	//-----------------------------------------------------
+	//Parameter
+	m_sYear = m_sYear0;		//Jahresvariable initiieren
+	nG = 1;					//Anzahl der Speicherkaskaden des GroundFlow Speichers - STATISCH
+	NX = m_pDTM->Get_NX();	//Anzahl der Reihen x
+	NY = m_pDTM->Get_NY();	//Anzahl der Zeilen y
+	NumRBGrids = 0;			//Anzahl der Rasterzellen im Flusseinzugsgebiet
+	NumGrids = 0;			//Anzahl der Rasterzellen im DTM (ohne NoDataZellen)
+	
+	errC = 0;				//Fehlercode Variable
+	errC2 = 0;				//Fehlercode Variable2
+	errC3 = 0;				//Fehlercode Variable3
+	errC4 = 0;				//Fehlercode Variable4
+	
+	m_pWConsD = m_pWConsDIn; // Operator fuer "verbleibende Tage bis Entnahme" wird auf Input-Wert gesetzt
+
+
+  //######################################################
+	//Pruefroutinen
+	//-----------------------------------------------------
+	//STATISCHE SICHERHEITSANGABEN!! ueBERARBEITEN!!!
+	if(m_sYear == 1989 && m_pDays > 7670)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1990 && m_pDays > 7305)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1991 && m_pDays > 6940)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1992 && m_pDays > 6575)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1993 && m_pDays > 6209)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1994 && m_pDays > 5844)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1995 && m_pDays > 5479)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1996 && m_pDays > 5114)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1997 && m_pDays > 4748)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1998 && m_pDays > 4383)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 1999 && m_pDays > 4018)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2000 && m_pDays > 3653)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2001 && m_pDays > 3287)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2002 && m_pDays > 2922)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2003 && m_pDays > 2557)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2004 && m_pDays > 2192)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2005 && m_pDays > 1826)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2006 && m_pDays > 1461)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2007 && m_pDays > 1096)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2008 && m_pDays > 731)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+	if(m_sYear == 2009 && m_pDays > 365)
+		WriteLog("Fehler! Anzahl der Tageschritte zu grosz - uebersteigt Anzahl der Datensaetze!");
+  //######################################################
+	
+  //Analyse-------------------------------------------
+	for(int x=0; x < NX; x++)
+	{
+		for(int y=0; y < NY; y++)
+		{
+				
+			if(!m_pDTM->is_NoData(x,y))
+			{
+				NumGrids++;								//Anzahl der Rasterzellen im DTM (ohne NoDatazellen)
+				if(m_pBasinShare->asDouble(x,y) >= 0)	
+					NumRBGrids++;						//Anzahl der Rasterzellen im Flusseinzugsgebiet
+			}
+		}
+	}
+  //--------------------------------------------------
+
+	
+	
+  //###################################################################	
+  //######################################################
+	//Ermittlung kMin, vMax
+	//
+	double zMax, zMax2;
+	double k_Min0;			//temporaerer Operator zur bestimmung von KMin und vMax
+	int n0;					//temporaerer Operator zur bestimmung von KMin und vMax 
+
+	//-----------------------------------------------------
+	//nMax Wird benoetigt um Eintraege in NCArray-Array und -File zu setzten / zu lesen | Eigentlich sollte gelten nC >= nCr 
+	if(nC >= nCr)
+		nMax = nC;
+	else
+		nMax = nCr;
+	//-----------------------------------------------------
+		
+	zMax = m_pGrad->Get_ZMax();			//liefert maximale Steigung des DEM Grids ueber GradGrid
+	//minimalsten Retetionskoeffizienten der jeweiligen Abflussarten bestimmen
+	kMinG = G0/(nG*2) * (m_pDTM->Get_Cellsize() / 1000 ) / pow(zMax, 0.1 );		//anhand zMax Berechnung der kleinsten GroundFlow-Lagtime
+	kMinC = C0/(nC*2) * (m_pDTM->Get_Cellsize() / 1000 ) / pow(zMax, 0.1 );		//anhand zMax Berechnung der kleinsten ChannelFlow-Lagtime
+	kMinB = pB * (m_pDTM->Get_Cellsize() / 1000 ) / 50;						//anhand zMax Berechnung der kleinsten BaseFlow-Lagtime
+	
+	//mittlere vMax der jeweiligen Abflussarten bestimmen (in einer Speicher Kaskade entspricht die Mittlere MAximalgeschwindigkeit der Summe der einzelnen Speicher-Maximalgeschwindigkeiten)
+	vMaxC =  m_pDTM->Get_Cellsize() / 1000 / kMinC / nC / 24;
+	vMaxG =  m_pDTM->Get_Cellsize() / 1000 / kMinG / nG / 24;
+	
+	// falls Flusssgrids beruecksichtigt werden...
+	if( Parameters("RivG")->asInt() > 0 ) 
+	{
+		if( m_pRivGrids && m_pRivGrad)
+		{
+			zMax2 = m_pRivGrad->Get_ZMax(); //liefert maximale Steigung der RiverGrids ueber RiverGradIn
+			kMinCr = C0r/(nCr*2) * (m_pDTM->Get_Cellsize() / 1000 ) / pow(zMax2, 0.1 );	//anhand zMax2 Berechnung der kleinsten ChannelFlow River-Lagtime
+			vMaxCr =  m_pDTM->Get_Cellsize() / 1000 / kMinCr / nCr / 24;
+			//-----------------------------------------------------
+			//nMax Wird benoetigt um Eintraege in NCArray-Array und -File zu setzten / zu lesen | Eigentlich sollte gelten nC >= nCr 
+			if(nC >= nCr)
+				nMax = nC;
+			else
+				nMax = nCr;
+			//-----------------------------------------------------
+		}
+		else
+		{
+			Message_Dlg("Flussgrids koennen nicht beruecksichtigt werden, da kein RiverGrids und/oder RiverGrad-Input gesetzt wurde");
+			return (false);
+		}
+	}
+	else //Wenn Flussgrids nicht extra veruecksichtigt werden
+	{
+		kMinCr = -1; 
+		vMaxCr = -1;
+	}
+
+
+
+	//vMax aller Abflussarten bestimmen
+	if(vMaxCr >= vMaxC)
+		vMax = vMaxCr;
+	else
+		vMax = vMaxC;
+	
+	if(vMaxG > vMax)
+		vMax = vMaxG;
+
+	//Wenn mittlere Geschwindigkeitsobergrenze gesetzt und diese kleiner als errechnete mittlere Maximalgeschwindigkeit vMax... 
+	if( Parameters("EnfVmax")->asBool()) //Retentionskoeffizienten nach "oben" anpassen um mittlere Geschwindigkeitsobergrenze einzuhalten
+	{
+		if( m_pVTresh < vMax)
+		{
+			//mittlere Geschwindigkeitsobergrenze wird (bisher) allgemein fuer alle Abflussarten gesetzt!!
+			vMax = m_pVTresh;
+						
+			if( (m_pDTM->Get_Cellsize() / 1000 / vMax / nC / 24) > kMinC)
+				kMinC = m_pDTM->Get_Cellsize() / 1000 / vMax / nC / 24;
+			if( Parameters("RivG")->asInt() > 0 && (m_pDTM->Get_Cellsize() / 1000 / vMax / nCr / 24) > kMinCr )
+				kMinCr = m_pDTM->Get_Cellsize() / 1000 / vMax / nCr / 24;
+			if( (m_pDTM->Get_Cellsize() / 1000 / vMax / nG / 24) > kMinG)
+				kMinG = m_pDTM->Get_Cellsize() / 1000 / vMax / nG / 24;
+		}
+		else
+			Message_Dlg("Eingabe der Geschwindigkeitsobergrenze ist groeszer als maximal berechnete Geschwindigkeit - Eingabe wird ignoriert");
+	}
+	
+	//Bestimmen des minimalsten Retentionskoeffizienten...
+	if(kMinC < kMinG)
+		k_Min0 = kMinC;
+	else
+		k_Min0 = kMinG;
+
+	if(kMinCr >= 0 && kMinCr < k_Min0)
+		k_Min0 = kMinCr;
+	
+
+	if(kMinB < k_Min0) //Sicherheitsabfrage
+	{
+		Message_Dlg("BaseFlow-Lagtime ist am geringsten - SEHR wahrscheinlicher Fehler!");
+	}
+
+
+	//### entspricht kleinst moeglicher Zeitschrittlaenge!
+	k_Min = k_Min0;
+	//###
+
+
+	if((k_Min*86400) <= 1)
+	{
+		Message_Dlg("FEHLER!! k_Min ist kleiner als eine Sekunde!!");
+		WriteLog("FEHLER!! k_Min war kleiner als eine Sekunde!!");
+		errC = 1;
+		return (false);
+	}
+
+	
+	//Setzen des Zeitschrittoperators m_pTStep : entspricht der Zeitschrittlaenge dt   
+	//WENN GESETZT - Automatisierte max. Zeitschrittlaengen-Festlegung:
+	if( Parameters("CalcT")->asBool() )
+		m_pTStep = (int)(k_Min * 86400);		//Problem: k_Min nicht zwanglaeufig ein vielfaches von 60, daher m_pTStep ggf. nicht glatt durch 86400 teilbar
+	// WENN NICHT GESETZT : 1) Verwendung der m_pTStep Eingabe - falls nicht zu grosz: -> sonst m_pVTresh = k_Min
+	else
+	{
+		if( m_pTStep >= k_Min * 86400)
+			m_pTStep = (int)(k_Min * 86400);
+	}
+	//
+  //######################################################
+
+
+
+
+
+
+  //######################################################
+	//Speicher, Arrays und Membervariablen initiieren
+	//
+	CreateKArray( NX, NY, 3);
+	CreateNcArray( NX, NY, nMax+1);	// Array mit nMax+1 Speicherwerten (n Speichereintraege + Eintrag ueber Summe der Speicher)
+	//CreatePArray( NX, NY, 1);		//zur Zeit: nicht gesetzt
+	
+	//-----------------------------------------------------
+	//SpeicherArrays initieren
+	//
+	InitKArray();
+	InitNcArray(NX, NY, nMax+1);	//Array mit nMax+1 Speicherwerten (n Speichereintraege + Eintrag ueber Summe der Speicher)
+	//InitPArray(NX, NY, 1);		//zur Zeit: nicht gesetzt
+
+	/**///%%%% Monitoring %%%%%%%%%%
+	/**///Initiierung
+	/**/WSystem = 0;				// Im System befindliches Wasser
+	/**/WSystemInit = 0;			// Anfaenglicher Speicherinhalt WSystem nach Speicherinitilisierung
+	/**/WSystemIn = 0;				// Summe des Wassers was ins System gelangt (Drainage, RunOff)
+	/**/WSystemOut = 0;				// Summe des Wassers welches das System verlaeszt (Systemabfluss)
+	/**/WSystemDayIn = 0;			// Summe des Wassers was am jeweiligen Tag ins System gelangt (Drainage, RunOff)
+	/**/WSystemDayOut = 0;			// Summe des Wassers welches am jeweiligenTag das System verlaeszt (Systemabfluss)
+	/**/WSystemDayWithd = 0;		// Summe allen Wassers, dass dem WSystem pro Tag entnommen wird oder ueber Entnahmefaktor verloren geht
+	/**/RivBas = 0;					// Im RivBasin befindliches Wasser
+	/**/RivBasInit = 0;				// Anfaenglicher Speicherinhalt RivBasin nach Speicherinitilisierung
+	/**/RivBasIn = 0;				// Summe des Wassers was ins RiverBasin gelangt (Drainage, RunOff)
+	/**/RivOut = 0;					// Summe des Wassers welches das RiverBasin ueber den Fluss verlaeszt (Flussabfluss)
+	/**/RivBasDayIn = 0;			// Summe des Wassers was am jeweiligen Tag ins RiverBasin gelangt (Drainage, RunOff)
+	/**/RivDayOut = 0;				// Summe des Wassers welches am je weiligenTag das RiverBasin ueber den Fluss verlaeszt (Flussabfluss)
+	/**/RivMonthOut = 0;			// Summe des Wassers welches im jeweiligen Monat das RiverBasin ueber den Fluss verlaeszt (Flussabfluss)
+	/**/RivBasSink = 0;				// Summe allen Wasser das ueber dem Rechenzeitraum im RivBas in Senken verschwindet (geloescht wird)
+	/**/manWithd = 0;				// Wasser das durch Rasterzellen Manipulation aus dem RivBasinSystem entfernt oder hinzugefuegt wurde
+	/**/WCCache = 0;				// Speicherabbild des Wassers in den Kaskaden Speichern
+	/**/RivBasConMonth = 0;			// Summe der auftretenden Flaechenentnahmen innerhalb des gesamten Flusseinzugsgebietes pro Monat
+	/**/resRivBasConMonth = 0;		// Summe der tatsaechlichen durchgefuehrten Flaechenentnahmen innerhalb des gesamten Flusseinzugsgebietes pro Monat
+	/**/remRivBasConMonth = 0;		// Summe der Entnahmen die dem RivBas nicht entnommen werden konnten (weil resFlow kleiner als m_pCon) pro Monat
+	/**/RivBasDayWithd = 0;			// Summe allen Wassers, dass dem RivBasin pro Tag entnommen wird oder ueber Entnahmefaktor verloren geht
+	/**/SumRDMonth = 0;				//Summe der Runoff und Drainage Werte des Einzugsgebietes eines Monats
+	/**/SumRMonth = 0;				//NUR Summe der Runoff-Werte des Einzugsgebietes eines Monats
+	/**/SumDMonth = 0;				//NUR Summe der Drainage-Werte des Einzugsgebietes eines Monats
+	/**/m_pTestR1m = 0;				//TestRoutine1
+	/**/m_pTestR1RDm = 0;			//TestRoutine1
+	/**/m_pTestR1Cm = 0;			//TestRoutine1
+	/**/m_pTestR1resCm = 0;			//TestRoutine1
+	/**/m_pTestR1remCm = 0;			//TestRoutine1
+
+	/**/SumRD_SubBasin = 0;			//Summe der Runoff und Drainage Werte eines SubBasin [TestRoutine 1]
+	/**/SumCon_SubBasin = 0;		//Summe der beabsichtigten Entnahmen eines SubBasin [TestRoutine 1]
+	/**/SumResCon_SubBasin = 0;		//Summe der tatsaechlichen Entnahmen eines SubBasin [TestRoutine 1]
+	/**/SumRemCon_SubBasin = 0;		//Summe der nicht beruecksichtigten Entnahmen eines SubBasin [TestRoutine 1]
+	/**///%%%%%%%%%%%%%%
+
+	/**///MonitoringLogs initiieren (Legende)
+	/**///Monitoringlog 1 - RivBasine
+	/**/if(var2)
+	/**/{
+	/**/	file0.str("");
+	/**/	file0 << "Tag RivBasDayIn RivDayOut RivBasIn RivOut RivBas DiffInOut RivBasSink RivBasDayWithd ";
+	/**/	file = file0.str();
+	/**/	TestLog1( file );
+	/**/}
+	/**///Monitoringlog 2 - WSystem
+	/**/if(var3)
+	/**/{
+	/**/	file0.str("");
+	/**/	file0 << "Tag WSystemDayIn WSystemDayOut WSystemIn WSystemOut WSystem DiffInOut WCCache WSystemDayWithd";
+	/**/	file = file0.str();
+	/**/	TestLog2( file );
+	/**/}
+	/**///Monitoringlog 3 - RivBasWUse
+	/**/if(var4)
+	/**/{
+	/**/	file0.str("");
+	/**/	file0 << "Jahr Monat RivBasRDMonth RivMonthOut RivBasWUseMonth RivBasResWUseMonth RivBasRemWUseMonth RivBasRMonth RivBasDMonth";
+	/**/	file = file0.str();
+	/**/	TestLog3( file );
+	/**/}
+	/**/
+	/**/if(Parameters("Test1")->asInt() > 0 && m_pRivGrids->asDouble(Parameters("xt1")->asInt(),Parameters("yt1")->asInt()) != 0 )
+	/**/{
+	/**/	file0.str("");
+	/**/	file0 << "Jahr Monat SubRivBasRDMonth SubRivBasOutMonth SubRivBasWUseMonth SubRivBasResWUseMonth SubRivBasRemWUseMonth";
+	/**/	file = file0.str();
+	/**/	TestLog4( file );
+	/**/}
+	/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+	//-----------------------------------------------------
+	//Temporaere Speicher anlegen
+	m_pTempR = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	m_pTempC = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	m_pTempD = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	m_pTempK = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);	// Temporaerer Speicher um je Zeitschritt dt_n den Channelzufluss je Gitterbox zu speichern und zu Anfang von dt_n+1 in den Kaskadenpeicher nCArray[x][y][0] zu schreiben
+	m_pTemp = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);	// Temporaerer Zwischenspeicher
+	m_pSumCon = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	m_pSumRemCon = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	m_pSumResCon = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double);
+	//TestRoutine1
+	if(Parameters("Test1")->asInt() == 2)
+		m_pTestR1Share = SG_Create_Grid(m_pDTM, SG_DATATYPE_Double); //gesammtes Einzugsgebiet zu HG-Rasterzelle (x,y) der TestR1 Routine
+	//-----------------------------------------------------
+
+	m_pChannelFlow->Assign(0.0);							//erste Initiierung des ChannelFlow Grids
+	m_pSumRunoffDrainage->Assign(0.0);						//erste Initiierung des m_pSumRunoffDrainage Grids
+	m_pWConsOut->Assign(0.0);								//erste Initiierung des dynamischen m_pWConsOut Grids
+	m_pTempK->Assign(0.0);									//erste Initiierung
+	m_pSumCon->Assign(0.0);									//erste Initiierung
+	m_pSumRemCon->Assign(0.0);								//erste Initiierung
+	m_pSumResCon->Assign(0.0);								//erste Initiierung
+	
+	//TestRoutine1
+	if(Parameters("Test1")->asInt() == 2)
+	{
+		m_pTestR1Share->Assign(-1.0);	//erste Initiierung
+		TestR1Share( Parameters("xt1")->asInt(), Parameters("yt1")->asInt() ); //EinzugsgebietsRasterzellen BIS Errreichen der HG-Rasterzelle aus TestRoutine1 bestimmen
+	}
+	//------------
+
+	m_pHFlowFac = 1.0;										//Initiierung: Weiterleitungsfaktor des Wasserflusses aus einer Gitzterbox
+	m_pRFlowFac = 1.0;										//Initiierung: Weiterleitungsfaktor des Wasserflusses aus einer Fluss-Gitterbox
+	m_pVRFlowFac = 1.0;										//Initiierung: Zuflussfaktor des vertikalen Zuflusses RunOff
+	m_pVDFlowFac = 1.0;										//Initiierung: Zuflussfaktor der vertikalen Zuflsses Drainage
+	m_pTestR1 = 0;											//Initiierung: SpeicherVariable TestRoutine 1
+	//-----------------------------------------------------
+	
+	
+	//Ggf. Input-Grid-Speicherwerte einlesen
+	//
+	if( Parameters("CacheUse")->asBool() && m_pRCacheIn && m_pDCacheIn && m_pCCacheIn && !m_pNCacheFolder.is_Empty())
+	{
+	//-----------------------------------------------------
+	//Initialisierung der temporaeren Speicher mit voherigen Soeicherwerten
+
+		m_pTempR->Assign(m_pRCacheIn); //Initiierung des temporaeren RunOff-Speichers mit vorhandenen Werten
+		m_pTempD->Assign(m_pDCacheIn); //Initiierung des temporaeren Drainage-Speichers mit vorhandenen Werten
+		m_pCCacheOut->Assign(m_pCCacheIn); //Initiierung des ChannelFlow-Grids mit vorhandenen Werten
+		
+		//RivBas / WSystem Monitoring: Inhalt des RivBas und Wsystem aus Speichern einlesen
+		/**///%%%% Monitoring %%%%%%%%%%
+		/**/
+		/**/for(int x=0; x < NX; x++)
+		/**/{
+		/**/	for(int y=0; y < NY; y++)
+		/**/	{
+		/**/		WSystem = WSystem + m_pTempR->asDouble(x,x) + m_pTempD->asDouble(x,y) + m_pCCacheOut->asDouble(x,y);
+		/**/
+		/**/		if(m_pBasinShare->asDouble(x,y) >= 0 ) //wenn im RivBasin...
+		/**/			RivBas = RivBas + m_pTempR->asDouble(x,x) + m_pTempD->asDouble(x,y) + m_pCCacheOut->asDouble(x,y);
+		/**/	}
+		/**/}
+		/**/RivBasInit = RivBas;
+		/**/WSystemInit = WSystem;
+		//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+		ReadNCacheFile(false, "NcCacheIn.txt", NX, NY, 0, 0, nMax, ' ', 0, false); //nC-Speicherdatei in Array einlesen
+		//-----------------------------------------------------
+	}
+	else
+	{
+		m_pTempR->Assign(0.0);
+		m_pTempD->Assign(0.0);
+		m_pCCacheOut->Assign(0.0); //erste Initiierung des ChannelCache Grids
+	}
+
+	
+	//-----------------------------------------------------
+	//Zeit Membervariablen initiieren [Funktioniert bisher nur fuer 1968-2009]
+	//
+
+	//Simulationsuhr auf 1. Januar Startjahr 00:00:00 gesetzt
+//	CTime timeS(m_sYear0, 1, 1, 0, 0, 0);
+	CSG_DateTime	timeS(1, CSG_DateTime::Jan, m_sYear0, 0, 0, 0);
+
+	dT = 0;		//daytimeCounter - Tageszeitzaehler [s]	(0-86400)
+	dDC = 1;	//dayDataCounter - Datentag-Zaehler [d]	(1-365/366)
+	dC = 1;		//dayCounter - Tageszaehler [d]
+	mYC = 1;	//MonthOfYear Monatszaehler [m]			(1-12)
+	dMC = 1;	//DayOfMonth Tageszaehler [d]			(1-28/29/30/31)
+
+	//UhrzeitTest-Platzhalter
+	double Td = 0;
+	double Tm = 0;
+	double Ty = 0;
+	double Th = 0;
+	double Tmi = 0;
+	//-----------------------
+	
+
+	//Schaltjahr-Bestimmung - statisch fuer Zeitraum 1980 - 2009
+	m_pDDays	= CSG_DateTime::Get_NumberOfDays(m_sYear);
+
+//	if(m_sYear == 1968 || m_sYear == 1972 || m_sYear == 1976 || m_sYear == 1980 || m_sYear == 1984 || m_sYear == 1988 || m_sYear == 1992 || m_sYear == 1996 || m_sYear == 2000 || m_sYear == 2004 || m_sYear ==  2008 )
+//		m_pDDays = 366;
+//	else
+//		m_pDDays = 365;
+
+	numTS = int(86400/m_pTStep);				//Anzahl der Zeitschtritte pro Tag
+	//-----------------------------------------------------
+	
+	//Auslesepunkte - Tagesspeicher
+	//STATISCH
+	double dV1 = 0;
+	double dV2 = 0;	
+	double dV3 = 0;
+	//
+  //######################################################
+
+
+  //######################################################
+	//Ggf. Prozentuale Wasserentnahme initiieren
+	//-----------------------------------------------------
+	//Falls der Inputparameter Wasserentnahmefaktor != Null, berechnen des effektiven Wasserdurchflussfaktors m_pFlowFac
+	//
+	if(var1 && m_pConsFacAll != 0)
+	{
+		/*double pow1 = 1.0 - m_pConsFacAll;
+		double pow2 = 1.0 / numTS;
+	
+		if(m_pConsFac!=0 && m_pConsFac <= 1) 
+			m_pFlowFac = pow( pow1, pow2);		//ZinsesZins-Rechnung
+		*/
+		m_pHFlowFac = 1.0 - m_pConsFacAll;
+	}
+
+	if(var1 && m_pConsFacRiv != 0)
+		m_pRFlowFac = 1.0 - m_pConsFacRiv;
+
+	if(var1 && m_pRedFacR != 0)
+		m_pVRFlowFac = 1.0 - m_pRedFacR;
+
+	if(var1 && m_pRedFacD != 0)
+		m_pVDFlowFac = 1.0 - m_pRedFacD;
+	//
+  //######################################################
+
+	
+
+//######################################################
+	// Hauptfunktionsschleife
+	//######################################################
+	//
+	
+	//LS-Data Grids initiieren und einlesen fuer Tag 1
+	//-----------------------------------------------------
+	CSG_String m_pLSData26File;
+	CSG_String m_pLSData27File;
+	m_pLSData26File.Printf(SG_T("%s/%d/srunoff_%d_%d.sgrd"), m_pLSDataFolder.w_str(), m_sYear, m_sYear, dDC);
+	m_pLSData27File.Printf(SG_T("%s/%d/drainage_%d_%d.sgrd"), m_pLSDataFolder.w_str(), m_sYear, m_sYear, dDC);
+
+	CSG_Grid pRunOff(m_pLSData26File);
+	CSG_Grid pDrainage(m_pLSData27File);
+	//-----------------------------------------------------
+	
+	//Dynamische WCons-Data Grids initiieren und einlesen fuer Tag 1
+	//-----------------------------------------------------
+	if(Parameters("WCons")->asInt() > 0)
+	{
+		m_pWConsFile.Printf(SG_T("%s/TotalWUse_%d_%d.sgrd"), m_pWConDataFolder.w_str(), m_sYear, mYC);
+		pWConsData.Create(m_pWConsFile);
+		//Entnahmen berechnen fuer Monat 1
+		if( !WConsRiv( Parameters("WCons")->asInt() ))
+			Message_Dlg("Fehler beim Berechnen der dynamischen Entnahmen!");
+	}
+	//-----------------------------------------------------
+
+	//######################################################
+	//
+	while(dC <= m_pDays ) // ...so lange Tageszahl kleiner gleich der festgelegten Simulationstage.
+	{				
+		m_pTempC->Assign(0.0);	//temporaerer Speicher zum Berechnen von m_pCCacheOut (Gueltigkeit fuer einen Zeitschritt)
+		m_pTemp->Assign(0.0);	//temporaerer Speicher zum Speichern des Zuflusses pro Gitterbox (Gueltigkeit fuer einen Zeitschritt)
+		
+		//######################################################
+		for(int x=0; x < NX; x++)
+		{
+			for(int y=0; y < NY; y++)
+			{
+				
+				if(Parameters("onlyRB")->asBool() && m_pBasinShare->asDouble(x,y) < 0) //Falls nur im RiverBasin gerechnet werden soll und Koordinaten (x,y) nicht in diesem liegt -> Koordinaten ueberspringen... 
+				{}
+				else
+				{
+					if(m_pDTM->is_NoData(x,y)) 
+					{
+						m_pCCacheOut->Set_NoData(x,y);
+					}
+					else
+					{
+												
+						/**///TEST----
+						/**/double test1 = pRunOff.asDouble(x,y);
+						/**///--------
+
+						//Tageswerte fuer RunOff und Drainage aus Array einlesen und auf Flaeche und Zeitschritt umrechnen
+						//Entsprechende Reduktionen und Offsets beruecksichtigen bzw. ausgleichen.
+						//-----------------------------------------------------
+						m_pRun = ( ( pRunOff.asDouble(x,y) * m_pVRFlowFac * pow(m_pDTM->Get_Cellsize(), 2) ) + m_pOffsetR ) * m_pTStep; // Vertikaler Runoff pro Zellenflaeche (x,y): [m^3] pro Zeitschrittlaenge (Input = m/s) multipliziert mit dem Zuflussfaktor m_pVFlowFac (Moeglichkeit der prozentuelle Reduzierung des Runoff-Zuflusses) + OFFSET
+						
+							//Reduzierungsbetrag RunOff
+							double redSumRunOff = pRunOff.asDouble(x,y) * m_pRedFacR;
+
+						if(Parameters("autoFacD")->asBool())
+							m_pDrain =  ( ( pDrainage.asDouble(x,y) +  redSumRunOff ) * pow(m_pDTM->Get_Cellsize(), 2) ) * m_pTStep; // Vertikale Drainage pro Zellenflaeche (x,y): [m^3] pro Zeitschrittlaenge (Input = m/s) + Reduzierungsbetrag des RunOffs
+						else
+							m_pDrain = ( ( pDrainage.asDouble(x,y) * m_pVDFlowFac * pow(m_pDTM->Get_Cellsize(), 2) ) + m_pOffsetD ) * m_pTStep; // Vertikale Drainage pro Zellenflaeche (x,y): [m^3] pro Zeitschrittlaenge (Input = m/s) multipliziert mit dem Zuflussfaktor m_pVFlowFac (Moeglichkeit der prozentuelle Reduzierung des Drainage-Zuflusses) + OFFSET
+						//-----------------------------------------------------
+						
+						//HAUPTFUNKTION->
+						//######################
+						Calc_MainFlow(x,y);
+						//######################
+						//HAUPTFUNKTION->
+
+					
+						/**///%%%% Monitoring %%%%%%%%%%
+						/**///WCCache Werte Schreiben
+						/**/WCCache = WCCache + nCArray[x][y][nMax];
+						//%%%%%%%%%%%%%%%%%%%%%%%%%%
+					}
+
+				}
+			}
+		}
+			
+		m_pCCacheOut->Assign(m_pTempC); //uebernahme des Flussinhaltes (Gerinne- und Hauptgerinnnerasterzellen) nach einem Zeitschritt dt
+		m_pTempK->Assign(m_pTemp); //Speichern des Gitterboxzuflusses (== Zufluss in Speicherkaskade N) dieses Zeitschritts zur Verwendung im nae Zeitschritt
+		
+		DataObject_Update(m_pCCacheOut);
+		DataObject_Update(m_pChannelFlow);
+
+		Process_Set_Text(CSG_String::Format(SG_T("dt = %d  Dt = %g  Vmax = %g || Tag: %d"), m_pTStep, dT+m_pTStep, vMax, dC));
+		//######################################################
+		
+		
+		//-----------------------------------------------------
+		//Zeitoperation -> naechster Zeitschritt
+		//
+		dT = dT + m_pTStep; //Tageszeitzaehler
+	//	timeS.operator+=(m_pTStep); //SimulationsUhr
+		timeS	+= CSG_TimeSpan(0, 0, m_pTStep); //SimulationsUhr
+		//-----------------------------------------------------
+		
+		
+		//Test---------------------
+		Td = timeS.Get_Day();
+		
+		if(Th != timeS.Get_Hour())
+			Th = timeS.Get_Hour();
+	
+		if(Tmi != timeS.Get_Minute())
+			Tmi = timeS.Get_Minute();
+		
+		if(Tm != timeS.Get_Month())
+			Tm = timeS.Get_Month();
+
+		if(Ty != timeS.Get_Year())
+			Ty = timeS.Get_Year();
+
+		if(timeS.Get_Day() != dMC)
+		//-------------------------
+		
+			
+		//-----------------------------------------------------
+		//TAGESWECHSEL
+		
+		////if(dT > 86400)
+		{
+			/**///%%%% Monitoring %%%%%%%%%%
+			/**///WSystem Werte Schreiben
+			/**/if(var3)
+			/**/{	
+			/**/	file0;
+			/**/	file0.str("");
+			/**/	file0 << dC << " " << WSystemDayIn << " " << WSystemDayOut << " " << WSystemIn << " " << WSystemOut << " " << WSystem << " " << (WSystemIn-WSystemOut) << " " << WCCache << " " << WSystemDayWithd;
+			/**/	file = file0.str();
+			/**/	TestLog2( file );
+			/**/}
+			/**/
+			/**///RivBasin Werte schreiben
+			/**/if(var2)
+			/**/{
+			/**/	file0.str("");
+			/**/	file0 << dC << " " << RivBasDayIn << " " << RivDayOut << " " << RivBasIn << " " << RivOut << " " << RivBas << " " << (RivBasIn - RivOut) << " " << RivBasSink << " " << RivBasDayWithd;
+			/**/	file = file0.str();
+			/**/
+			/**/	TestLog1( file );
+			/**/}
+			/**/
+			/**/WSystemDayOut = 0;	//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			/**/WSystemDayIn = 0;	//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			/**/WSystemDayWithd = 0;//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			/**/RivBasDayIn = 0;	//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			/**/RivDayOut = 0;		//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			/**/RivBasDayWithd = 0;	//Auf Null setzen um naechsten Tageswert erfaassen zu koennen
+			//%%%%%%%%%%%%%%%%%%%%%%%%%%
+			
+
+			//-----------------------------------------------------
+			//AUSLESEN
+			//
+		
+			//Fixe Messstationen (Auslesekoordinaten) - Tagesmittel in [m3/s] berechnen, Werte speichern
+			//Schreiben in Textdatei
+			//
+			/*ELBE1	dV1 = m_pChannelFlow->asDouble(155,698) / 86400; // [m3/s]*/
+			/*ELBE2	dV1 = m_pChannelFlow->asDouble(145,578) / 86400; // [m3/s]*/
+			/*ELBE2_5	dV1 = m_pChannelFlow->asDouble(30,115) / 86400; // [m3/s]*/
+						dV1 = m_pChannelFlow->asDouble(Parameters("EvP1x")->asInt(),Parameters("EvP1y")->asInt()) / 86400;
+						WriteOutput(m_pEvP1s.b_str(), dDC, dV1, -1, -1);
+						dV1 =0;
+			/*Nile	dV1 = m_pChannelFlow->asDouble(222,563) / 86400; // [m3/s]
+						WriteOutput("Dongola.txt",dDC, dV1, -1, -1);
+						dV1 =0;*/
+
+			/*ELBE1	dV2 = m_pChannelFlow->asDouble(278,547) / 86400; // [m3/s]*/
+			/*ELBE2	dV2 = m_pChannelFlow->asDouble(269,428) / 86400; // [m3/s]*/
+			/*ELBE2_5	dV2 = m_pChannelFlow->asDouble(54,85) / 86400; // [m3/s]*/
+						dV2 = m_pChannelFlow->asDouble(Parameters("EvP2x")->asInt(),Parameters("EvP2y")->asInt()) / 86400;
+						WriteOutput(m_pEvP2s.b_str(), dDC, dV2, -1, -1);
+						dV2 =0;
+			/*Nile	dV2 = m_pChannelFlow->asDouble(280,487) / 86400; // [m3/s]
+						WriteOutput("Khartoum.txt",dDC, dV2, -1, -1);
+						dV2 =0;*/
+
+			/*ELBE1	dV3 = m_pChannelFlow->asDouble(399,434) / 86400; // [m3/s]*/
+			/*ELBE2	dV3 = m_pChannelFlow->asDouble(388,327) / 86400; // [m3/s]*/
+			/*ELBE2_5	dV3 = m_pChannelFlow->asDouble(78,65) / 86400; // [m3/s]*/
+						dV3 = m_pChannelFlow->asDouble(Parameters("EvP3x")->asInt(),Parameters("EvP3y")->asInt()) / 86400;
+						WriteOutput(m_pEvP3s.b_str(), dDC, dV3, -1, -1);
+						dV3 =0;
+			/*Nile	dV3 = m_pChannelFlow->asDouble(272,342) / 86400; // [m3/s]
+						WriteOutput("Malakal.txt",dDC, dV3, -1, -1);
+						dV3 =0;*/
+			//-----------------------------------------------------
+		
+		
+					
+					//-----------------------------------------------------
+					//Datei der FlussWasserBilanz pro Kilometer des letzten Simulationstages schreiben
+					if(m_pRivBalanceGrid)
+					{
+						WriteRivBalance(m_sYear, dC, -1, -1);
+
+						int rx, ry;
+
+						for(int l=0; l < m_pDTM->Get_NCells() && Set_Progress_NCells(l); l++) //ueber alle Zellen des m_pDEM-Grids
+						{
+							m_pDTM->Get_Sorted(l, rx, ry); //sortieren der Zellen von hoechster (l=0) nach niedrigster...
+
+							if( m_pRivBalanceGrid->asDouble(rx,ry) != 0)
+								{
+									WriteRivBalance(rx, ry, m_pRivBalanceGrid->asDouble(rx,ry), m_pChannelFlow->asDouble(rx,ry) / 86400 );
+								}
+						}
+
+					}
+					//-----------------------------------------------------
+					
+			dMC++;
+			dDC++;
+			dC++;
+			dT = 0;
+			
+			WCCache = 0; //WCCACHE immer NCache-SpeicherAbbild am Ende jedes Simulationstages - daher nach jedem Tageswechsel wieder auf Null setzten
+			
+			if(m_pWConsD > 0) //Tageszaehler "Vorlauf vor Wasserentnahme" minus einen Tag  
+				m_pWConsD--;
+			
+			//-----------------------------------------------------
+			//MONATSWECHSEL
+			//
+			if(timeS.Get_Month() != mYC)
+			{
+				/**///%%%% Monitoring %%%%%%%%%%
+				/**///monthRivBasCon Werte schreiben
+				/**/if(var4)
+				/**/{
+				/**/	file0.str("");
+				/**/	file0 << m_sYear << " " << mYC << " " <<  SumRDMonth << " " << RivMonthOut << " " << RivBasConMonth << " " << resRivBasConMonth << " " << remRivBasConMonth << " " << SumRMonth << " " << SumDMonth;
+				/**/	file = file0.str();
+				/**/
+				/**/	TestLog3( file );
+				/**/}
+				/**/
+				/**/RivBasConMonth = 0;		//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/RivMonthOut = 0;		//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/resRivBasConMonth = 0;	//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/remRivBasConMonth = 0;	//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/SumRDMonth = 0;			//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/SumRMonth = 0;			//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				/**/SumDMonth = 0;			//Auf Null setzen um naechsten Monatswert erfaassen zu koennen
+				//%%%%%%%%%%%%%%%%%%%%%%%%%%
+				
+				if(Parameters("Test1")->asInt() > 0 && m_pRivGrids->asDouble(Parameters("xt1")->asInt(),Parameters("yt1")->asInt()) != 0 )
+				{
+				/**/SubBasinId(Parameters("xt1")->asInt(), Parameters("yt1")->asInt());
+				/**/
+				/**/	file0.str("");
+				/**/	file0 << m_sYear << " " << mYC << " " << m_pTestR1RDm << " " << m_pTestR1m << " " << m_pTestR1Cm << " " << m_pTestR1resCm << " " << m_pTestR1remCm;
+				/**/	file = file0.str();
+				/**/	TestLog4( file );
+				/**/
+				/**/	m_pTestR1m = 0;
+				/**/	m_pTestR1RDm = 0;
+				/**/	m_pTestR1Cm = 0;
+				/**/	m_pTestR1resCm = 0;
+				/**/	m_pTestR1remCm = 0;
+				}
+				
+								
+				if(mYC >= 12)
+					mYC = 1;
+				else
+					mYC++;
+				
+				dMC = 1;		//auf ersten Tag des Monats setzen
+				
+				//Dynamische WCons-Data Grids fuer neuen Monat berechnen
+				//-----------------------------------------------------
+				if(Parameters("WCons")->asInt() > 0)
+				{
+					int Year;
+					if(m_sYear <= 2000)			//Sicherheitsabfrage fuer WaterGapDaten, die nur bis 2000 vorliegen - falls Jahr groeszer als 2000, werden weiterhin 2000er Daten verwendet
+						Year = m_sYear;
+					else
+						Year = 2000;
+
+					m_pWConsFile.Printf(SG_T("%s/TotalWUse_%d_%d.sgrd"), m_pWConDataFolder.w_str(), Year, mYC);
+					pWConsData.Create(m_pWConsFile);
+
+					if( !WConsRiv( Parameters("WCons")->asInt() ))
+						Message_Dlg("Fehler beim Berechnen der dynamischen Entnahmen!");
+				}
+				//-----------------------------------------------------
+
+			}
+			//-----------------------------------------------------
+
+			//-----------------------------------------------------
+			//JAHRESWECHSEL
+			//
+			if(timeS.Get_Year() > m_sYear)
+			//if(dDC > m_pDDays)
+			{
+				dDC = 1;
+				m_sYear = m_sYear + 1;
+				mYC = 1;
+
+				m_pDDays	= timeS.Get_NumberOfDays(m_sYear);
+			//	if(m_sYear == 1980 || m_sYear == 1984 || m_sYear == 1988 || m_sYear == 1992 || m_sYear == 1996 || m_sYear == 2000 || m_sYear == 2004 || m_sYear ==  2008 )
+			//		m_pDDays = 366;
+			//	else
+			//		m_pDDays = 365;
+			}
+		
+			if(m_sYear > 2009 || dDC > 366) //STATISCHE SICHERHEITSANGABEN
+				break;
+
+			if(dC <= m_pDays)
+			{
+
+				//Aktuelle LS-Data Grids einlesen
+				//-----------------------------------------------------
+				m_pLSData26File.Printf(SG_T("%s/%d/srunoff_%d_%d.sgrd"), m_pLSDataFolder.w_str(), m_sYear, m_sYear, dDC);
+				m_pLSData27File.Printf(SG_T("%s/%d/drainage_%d_%d.sgrd"), m_pLSDataFolder.w_str(), m_sYear, m_sYear, dDC);
+
+				pRunOff.Create(m_pLSData26File);
+				pDrainage.Create(m_pLSData27File);
+				//-----------------------------------------------------
+						
+				m_pChannelFlow->Assign(0.0);
+				m_pTest = 0;
+			}
+			//-----------------------------------------------------
+		}
+		//-----------------------------------------------------
+
+		
+
+	}
+
+	//
+	//######################################################
+	//
+//######################################################
+
+
+	//-----------------------------------------------------
+	// Testroutine 1 durchfuehren
+	if(Parameters("Test1")->asInt() > 0 && m_pRivGrids->asDouble(Parameters("xt1")->asInt(),Parameters("yt1")->asInt()) != 0 )
+		{
+			SubBasinId(Parameters("xt1")->asInt(), Parameters("yt1")->asInt());
+		}
+	//-----------------------------------------------------
+
+
+
+	//-----------------------------------------------------
+	// Speichern in den Ausgabedateien
+	
+	m_pRCacheOut->Assign(m_pTempR); //uebernahme des Gitterboxflusses nach m_pDays Simulationstagen
+	m_pDCacheOut->Assign(m_pTempD); //uebernahme des Gitterboxflusses nach m_pDays Simulationstagen
+
+	if(Parameters("wNC")->asBool())
+		SaveNcCache(nMax);
+	
+	if(Parameters("wP")->asBool())
+		SaveParameters();
+
+	
+	//Speichern der AusgabeGrids in Unterordner "grids"
+	CSG_String SaveAsFile;
+	CSG_String SPath = m_pSPath2.c_str();
+
+	SaveAsFile.Printf(SG_T("%s/CFCache.sgrd"), SPath.w_str());
+	m_pCCacheOut->Save(SaveAsFile);									//GridSave CCCache
+
+	SaveAsFile.Printf(SG_T("%s/OFCache.sgrd"), SPath.w_str());
+	m_pRCacheOut->Save(SaveAsFile);									//GridSave RCache
+
+	SaveAsFile.Printf(SG_T("%s/BFCache.sgrd"), SPath.w_str());
+	m_pDCacheOut->Save(SaveAsFile);									//GridSave DCache
+
+	SaveAsFile.Printf(SG_T("%s/SumRunoffDrainage.sgrd"), SPath.w_str());
+	m_pSumRunoffDrainage->Save(SaveAsFile);							//GridSave SumRunoffDrainage
+
+	SaveAsFile.Printf(SG_T("%s/ChannelFlow.sgrd"), SPath.w_str());
+	m_pChannelFlow->Save(SaveAsFile);								//GridSave ChannelFlow
+	//-----------------------------------------------------
+
+	if(Parameters("Test1")->asInt() == 2)
+	{
+		SaveAsFile.Printf(SG_T("%s/m_pTestR1Share.sgrd"), SPath.w_str());
+		m_pTestR1Share->Save(SaveAsFile);								//GridSave ChannelFlow
+		delete(m_pTestR1Share);
+	}
+
+
+	//-----------------------------------------------------
+	//	Loeschen der temporaeren Speicher
+	//
+	delete(m_pTempR);
+	delete(m_pTempC);
+	delete(m_pTempD);
+	delete(m_pTempK);
+	delete(m_pTemp);
+	delete(m_pSumCon);
+	delete(m_pSumRemCon);
+	delete(m_pSumResCon);
+
+	CLandFlow::DeleteKArray();
+	//CLandFlow::DeleteLSMArray();	//ersetzt durch direktes Laden der LSSchmea-Grids
+	CLandFlow::DeleteNcArray();
+	//CLandFlow::DeletePArray();	// zur Zeit : nicht verwendet
+	//-----------------------------------------------------
+	
+	return( true );
+}
+
+
+//#########################################################
+//---------------------------------------------------------
+//#########################################################
+///////////////////////////////////////////////////////////
+//														 //
+//	Funktionen											 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+//######################################################
+//
+void CLandFlow::Calc_MainFlow(int x, int y)
+{
+	int i = -1;
+	int ix, iy;
+	double c, r, d;
+	stCons = 0;
+	varCons = 0;
+		
+	r = m_pTempR->asDouble(x,y) + m_pRun;	// Einlesen des Inhalts des Runoff-Speichers + Runoff m_pRun des Zeitschritts
+	d = m_pTempD->asDouble(x,y) + m_pDrain; // Einlesen des Inhalts des Drainage-Speichers + Drainage m_pDrain des Zeitschritts
+	c = m_pTempK->asDouble(x,y);			// Einlesens des Inhalts des Gitterboxzuflusses des letzten Zeitschritts
+	
+	/**///%%%% Monitoring %%%%%%%%%%
+	/**/WSystemIn = WSystemIn + m_pRun + m_pDrain;
+	/**/WSystem = WSystem + m_pRun + m_pDrain;
+	/**/
+	/**/WSystemDayIn = WSystemDayIn + m_pRun + m_pDrain;
+	/**/
+	/**/m_pSumRunoffDrainage->Add_Value(x, y, (m_pRun + m_pDrain)); //Grid ueber die Summe aller abflussrelevanten, vertikalen Zufluesse je Gitterzelle (x,y) des gesamten Berechnugszeitraums
+	/**/
+	/**/if(m_pBasinShare->asDouble(x,y) >= 0 ) //Abfrage ob (x,y) Koordinate im RiverBasin liegt
+	/**/{
+	/**/	RivBasIn = RivBasIn + m_pRun + m_pDrain;
+	/**/	RivBas = RivBas + m_pRun + m_pDrain;		
+	/**/
+	/**/	RivBasDayIn = RivBasDayIn + m_pRun + m_pDrain; //Summe der RunOff und DrainagWerte innerhalb des Flusseinzugsgebietes ueber einen Monat
+	/**/	SumRDMonth = SumRDMonth + m_pRun + m_pDrain;
+	/**/	SumRMonth = SumRMonth + m_pRun;
+	/**/	SumDMonth = SumDMonth + m_pDrain;
+	/**/}
+	/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+			
+		
+	
+/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+	//---------------------------------------------------------
+	//Berechnung der Abfluesse
+	m_pGFlow = Calc_GFlow(x, y, r); // Berechnung Oberflaechenabflusses
+	m_pBFlow = Calc_BFlow(x,y,d); // Berechnung Grundwasserabfluss
+		
+	if( Parameters("RivG")->asInt() > 0 && m_pRivGrids->asDouble(x,y) != 0)
+		m_pCFlow = Calc_CFlow(x, y, c, nCr); // Berechnung Hauptgerinnerasterzellen-Abfluss-Speicherkaskade
+	else
+		m_pCFlow = Calc_CFlow(x, y, c, nC); // Berechnung Gerinneabfluss-Speicherkaskade
+	//---------------------------------------------------------
+/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+		/**///TempSpeicherwert
+		/**/double tempN = m_pCFlow;
+		/**/
+		/**///TempSpeicherwerte
+	
+		//%%%%%%%%%%%%%%%%%%%%%%%%%% Punktuelle Abflussmanipulation - Anfang %%%%%%%%%%%%%%%%%%%%%%%%%% 
+		//Rasterzelle 1
+		if( x == Parameters("RM1x")->asInt() && y == Parameters("RM1y")->asInt() && Parameters("vRM1")->asInt() != 0)
+			if(Parameters("vRM1")->asInt() == 1)
+				m_pCFlow = ( m_pCFlow * Parameters("RM1q")->asDouble() ) + (Parameters("RM1a")->asDouble() * m_pTStep); //Abfluss des HD-Modells veraendern
+			else
+				m_pCFlow = ( m_pCCacheOut->asDouble(x,y) * Parameters("RM1q")->asDouble() ) + (Parameters("RM1a")->asDouble() * m_pTStep); //Abfluss aus Speicher manuell vorgeben
+		
+		//Rasterzelle 2
+		if( x == Parameters("RM2x")->asInt() && y == Parameters("RM2y")->asInt() && Parameters("vRM2")->asInt() != 0)
+			if(Parameters("vRM2")->asInt() == 1)
+				m_pCFlow = ( m_pCFlow * Parameters("RM2q")->asDouble() ) + (Parameters("RM2a")->asDouble() * m_pTStep); //Abfluss des HD-Modells veraendern
+			else
+				m_pCFlow = ( m_pCCacheOut->asDouble(x,y) * Parameters("RM2q")->asDouble() ) + (Parameters("RM2a")->asDouble() * m_pTStep); //Abfluss aus Speicher manuell vorgeben
+		
+		if(m_pCFlow < 0)
+		{
+			Message_Dlg("Negativer Abfluss errechnet -> Punktuelle Rasterzellenmanipulation in diesem Schritt auszer Kraft gesetzt");
+			m_pCFlow = tempN;
+		}
+		else		
+			//Monitoring der Manipulierten Wasserflussvolumen (pos. Wert == Wasser hinzugefuegt)
+			manWithd = manWithd + m_pCFlow - tempN;
+		
+		//%%%%%%%%%%%%%%%%%%%%%%%%%% Punktuelle Abflussmanipulation - Ende %%%%%%%%%%%%%%%%%%%%%%%%%% 
+
+	//---------------------------------------------------------
+	//Abfluesse aus den Speichern der Rasterzelle (x,y)
+	m_pTempR->Set_Value( x, y, (r - m_pGFlow) ); // Inhalt Runoff-Speicher der in Zelle (x,y) verbleibt 
+	m_pTempD->Set_Value( x, y, (d - m_pBFlow ) ); // Inhalt Drainage-Speicher der in Zelle (x,y) verbleibt
+	
+	m_pTempC->Add_Value( x, y, (m_pCCacheOut->asDouble(x,y) - m_pCFlow) ); //Add_ist_richtig!! Alter Inhalt des ChannelGitterbox-Speichers minus Abfluss dieses Zeitschritts, gleich: verbleibender Inhalt in der Zelle (x,y) - (Grid: m_pCCacheOut ==  Summe des Volumens aller n Kaskadenspeicher) (Achtung! aus anderen Zellen kann aber immer auch nocht etwas in m_pTempC zuflieszen)
+	//---------------------------------------------------------
+
+
+	//%%%%%%%%%%%%%%%%%%%%%%%%%% EntnahmenCode - Anfang %%%%%%%%%%%%%%%%%%%%%%%%%% 
+		//...aus dem Gesamtabfluss (m_pGFlow + m_pBFlow + m_pCFlow) der rasterzelle (x,y)
+		
+		//---------------------------------------------------------
+		//Wasserentnahme - flaechenbasiert ueber das Flussgrid
+		//
+		//Wenn bei gesetzter Wasserentnahme kein WCons-Grid vorhanden -> Fehlermeldung
+		if(Parameters("WCons")->asInt() > 0 && !pWConsData.is_Valid())
+		{
+			WriteLog("Fehler! Kein WConsDaten als Input!");
+			errC = 1;
+		}
+	
+		m_pCon = 0;
+	
+		//Entnahme statisch (WConsIn) und/oder dynamisch nach Auswahl 1 oder 2 (WConsData)
+		if( m_pWConsIn && m_pWConsD == 0 )
+			m_pCon = (m_pWConsIn->asDouble(x,y) / 1000 ) * pow(m_pDTM->Get_Cellsize(), 2) * m_pTStep;	//Statische Wasserentnahme Eingangsdaten in m3/s -> [0,001m^3 m^-2 s^-1 == 1 mm s^-1] * (Zellgroesze)^2 * Zeitschritt(s)
+	
+		if( Parameters("WCons")->asInt() != 0 && pWConsData.is_Valid() && m_pWConsOut->is_Valid() && m_pWConsD == 0 )
+			if(Parameters("WConUnit")->asInt() == 0)
+				m_pCon = m_pCon + (m_pWConsOut->asDouble(x,y) / 1000 ) * pow(m_pDTM->Get_Cellsize(), 2) * m_pTStep;	//Wasserentnahme Eingangsdaten in m3/s -> [0,001m^3 m^-2 s^-1 == 1 mm s^-1] * (Zellgroesze)^2 * Zeitschritt(s)
+			else
+				m_pCon = m_pCon + (m_pWConsOut->asDouble(x,y) / 1000 / 86400 / 30) * pow(m_pDTM->Get_Cellsize(), 2) * m_pTStep;	//Wasserentnahme Eingangsdaten in m3/Monat, deshalb teilen durch (86400*monthDays) -> [0,001m^3 m^-2 s^-1 == 1 mm s^-1] * (Zellgroesze)^2 * Zeitschritt(s)
+		//---------------------------------------------------------
+
+
+		/**///%%%% Monitoring %%%%%%%%%%
+		/**/if(m_pBasinShare->asDouble(x,y) >= 0 ) //Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+		/**/	RivBasConMonth = RivBasConMonth + m_pCon;
+		/**/m_pSumCon->Add_Value(x, y, m_pCon);
+		/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+		//prozentualle Abflussreduktion vornehmen - abhaengig davon, ob Gitterbox oder Flussgitterbox.
+		if( Parameters("RivG")->asInt() > 0 && m_pRivGrids->asDouble(x,y) != 0)
+			m_pFlowFac = m_pRFlowFac; //Weiterleitungsfaktor-Fluss-Gitterbox setzten
+		else
+			m_pFlowFac = m_pHFlowFac; //Weiterleitungsfaktor-Gitterbox setzen
+		//---------------------------------------------------------
+		
+	
+	i = m_pDTM->Get_Gradient_NeighborDir(x, y); // Falls kein niedrigerer Nachbar -> Wert=-1
+	
+	//Falls Abfluesse stattfinden koennen, weil es eine niedrigere Nachbarzelle gibt bzw. ein Gradient groeszer Null vorliegt...	
+	if( i >= 0 || m_pGrad->asDouble(x,y) > 0) 
+	{
+		ix = Get_xTo(i, x);
+		iy = Get_yTo(i, y);		
+
+	//---------------------------------------------------------
+	//Pruefen ob Zellenabfluss [(m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac] aus Gitterzelle (x,y) kleiner etwaiger Entnahme m_pCon
+	//...wenn der Fall: dann Entnahmen auf Groesze des Zellabflusses setzen -> es resultiert Nullabfluss in diesem Zeitschritt
+		double resFlow = (m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac;
+		
+		//Fall Schwellenwert... -> m_pCon Veraenderung
+		if(m_pWConThres != 0 && Parameters("RivG")->asInt() > 0 && m_pRivGrids->asDouble(x,y) != 0)
+		{
+			if(resFlow >= ( m_pWConThres * m_pTStep))
+			{
+				if( (resFlow - ( m_pWConThres * m_pTStep)) < m_pCon) //wenn resultierender Abfluss nach Abzug des Schwellewertes kleiner als m_pCon, dann Entnahme nur in Hoehe von resFlow - m_pWConThres
+				{	
+					if(Parameters("eP")->asBool() && errC2 == 0)
+					{
+						WriteLog("Warnung! Es wurde in mindestens einem Fall bei Beruecksichtigung des Schwellenwertes und einer Entnaheme, ein negativer Abfluss ermittelt!!");
+						errC2 = -1;
+					}
+					
+					/**///%%%% Monitoring %%%%%%%%%%
+					/**/if(m_pBasinShare->asDouble(x,y) >= 0 )												//Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+					/**/	remRivBasConMonth = remRivBasConMonth + (m_pCon - ( resFlow - ( m_pWConThres * m_pTStep)) );		//Summe der Entnahmen die dem RivBasin nicht entnommen werden konnten (weil resFlow kleiner als m_pCon) pro Monat
+					/**/m_pSumRemCon->Add_Value(x, y, (m_pCon - ( resFlow - ( m_pWConThres * m_pTStep))) );
+					//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 	
+
+					m_pCon = resFlow - ( m_pWConThres * m_pTStep);
+				}
+				//else: m_pCon bleibt unveraendert...
+			}
+			else //Falls Schwellenwert schon hoeher als berechneter Abfluss, keine Entnahme mehr...
+			{
+				if(Parameters("eP")->asBool() && errC3 == 0)
+				{
+					WriteLog("Warnung! In mindestens einem Fall war der resultierdene Abfluss kleiner als der eingestellte Schwellenwert!!");
+					errC3 = -1;
+				}
+				
+				/**///%%%% Monitoring %%%%%%%%%%
+				/**/if(m_pBasinShare->asDouble(x,y) >= 0 )									//Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+				/**/	remRivBasConMonth = remRivBasConMonth + m_pCon;						//Summe der Entnahmen die dem RivBasin nicht entnommen werden konnten (weil resFlow kleiner als m_pCon) pro Monat
+				/**/m_pSumRemCon->Add_Value(x, y, m_pCon);
+				//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 	
+				
+				m_pCon = 0;
+			}
+		}
+		else // falls kein Schwellenwert und/oder keine Hauptgerinnerasterzelle
+			if( resFlow < m_pCon)
+			{
+				if(Parameters("eP")->asBool() && errC4 == 0)
+				{
+					WriteLog("Warnung! Es wurde in mindestens einem Fall ein negativer Abfluss ermittelt!!");
+					errC4 = -1;
+				}
+			
+				/**///%%%% Monitoring %%%%%%%%%%
+				/**/if(m_pBasinShare->asDouble(x,y) >= 0 )												//Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+				/**/	remRivBasConMonth = remRivBasConMonth + (m_pCon - resFlow);						//Summe der Entnahmen die dem RivBasin nicht entnommen werden konnten (weil resFlow kleiner als m_pCon) pro Monat
+				/**/m_pSumRemCon->Add_Value(x, y, (m_pCon - resFlow));
+				//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 			
+			
+				m_pCon = resFlow;
+			}
+		//---------------------------------------------------------
+
+		/**///%%%% Monitoring %%%%%%%%%%
+		/**/WSystemDayWithd = WSystemDayWithd + (m_pGFlow + m_pBFlow + m_pCFlow)*(1-m_pFlowFac);		//faktorielle Tageswasserverluste aus WSystem
+		/**/WSystem = WSystem - (m_pGFlow + m_pBFlow + m_pCFlow)*(1-m_pFlowFac);						//faktorielle Wasserverluste aus WSystem pro Zeitschritt
+		/**/if(m_pBasinShare->asDouble(x,y) >= 0 ) //Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+		/**/{
+		/**/	RivBasDayWithd = RivBasDayWithd + (m_pGFlow + m_pBFlow + m_pCFlow)*(1-m_pFlowFac);		//faktorielle tageswasserverluste aus RivBasin
+		/**/	RivBas = RivBas - (m_pGFlow + m_pBFlow + m_pCFlow)*(1-m_pFlowFac);						//faktorielle Wasserverluste aus RivBasin pro Zeitschritt
+		/**/}
+		/**///%%%%%%%%%%%%%%%%%%%%%%%%%%		
+		
+		/**///%%%% Monitoring %%%%%%%%%%
+		/**/WSystemDayWithd = WSystemDayWithd + m_pCon;												//flaechenbasierte Tagesentnhamen aus WSystem
+		/**/WSystem = WSystem - m_pCon;																//Entnommenes Wasser aus WSystem ueber die Flaeche pro Zeitschritt
+		/**/if(m_pBasinShare->asDouble(x,y) >= 0 )													//Nur Monitoren wenn (x,y) Koordinate im RiverBasin liegt
+		/**/{
+		/**/	RivBasDayWithd = RivBasDayWithd + m_pCon;											//flaecenbasierte Tagesentnahmen aus RivBasin
+		/**/	RivBas = RivBas - m_pCon;															//Entnommenes Wasser aus RivBasin ueber die Flaeche pro Zeitschritt
+		/**/	resRivBasConMonth = resRivBasConMonth + m_pCon;
+		/**/}
+		/**/m_pSumResCon->Add_Value(x, y, m_pCon);
+		/**///%%%%%%%%%%%%%%%%%%%%%%%%%%	
+
+		//FehlerAbfrage!
+		if( (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon) < 0 )
+			Message_Dlg("Negativer Abfluss errechnet -> FEHLER");
+	//%%%%%%%%%%%%%%%%%%%%%%%%%% EntnahmenCode - Ende %%%%%%%%%%%%%%%%%%%%%%%%%% 
+
+		
+	//---------------------------------------------------------
+	//resultierende Zufluesse in die Rasterzelle (ix,iy) entspricht (Abfluss der Rasterzelle (x,y) minus der Entnahmen bzw. faktoriellen Minderungen)
+
+		
+		if( m_pDTM->is_InGrid(ix,iy) && !m_pDTM->is_NoData(ix,iy)) //wenn (ix,iy) im Grid liegen und keine noData-Gitterzellen sind... -> Zufluss in die Zelle (ix,iy) 
+		{
+			m_pChannelFlow->Add_Value(ix, iy, ( (m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon); // GitterboxZUFLUSS in Gitterbox [ix,iy] minus Entnahme (WCon). Es gilt jeweils am Tagesende (da immer bei Tageswechsel Null gesetzt wird): [m3/d]
+			
+			m_pTempC->Add_Value( ix, iy, ( (m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon); // GitterboxZUFLUSS: Zelle (x,y) 'uebergibt' Inhalt (OverlandFlow+BaseFlow+ChannelFlow - Entnahme(WCon) ) an niedrigste Umgebungszelle (ix,iy)
+			m_pTemp->Add_Value (ix, iy , ( (m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon); // Zwischenspeicher GitterboxZUFLUSS minus Entnahme(WCon) um diesen im nae Zeitschritt in den ersten Speicher der ChannelKaskade zu schreiben
+		}
+		else //wenn (ix,iy) nicht im Grid und/oder eine NoData-Gitterzelle ist... -> SYSTEMabfluss (dieser Wasserabfluss wird nicht mehr beruecksichtigt)
+		{
+			/**///%%%% Monitoring %%%%%%%%%% //Da Senke oder Rand -> Speicherrinhalt m_pTempC seit dem letzten Zeitschritts flieszt ab (bzw. wird geloescht). //Fuer das RiverBasin sollte diese bedingung hoechstens fuer die Ausgangsbox des Basin zutreffen (siehe naechsten MonitoringSchritt)
+			/**/WSystemOut = WSystemOut + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+			/**/WSystem = WSystem - (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+			/**/
+			/**/WSystemDayOut = WSystemDayOut + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+			/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+		}
+		//---------------------------------------------------------
+
+
+		/**///%%%% Monitoring %%%%%%%%%% RiverBasin-AUSGANG (Effektiver Abfluss aus Flusseinzugsgebiet)
+		/**/if(x==Parameters("RBMx")->asInt() && y==Parameters("RBMy")->asInt()) //(x==16 && y==121)//Elbe2_5000m | (x==78 && y==607)//Elbe2_1000m | (x==166 && y==843)//Nile_5000m // STATISCH!! Abfrage ob Ausgangsbox aus RiverBasine vorliegt -> RivOut setzen == RiverBasine-Abfluss (Flussabfluss)
+		/**/{
+		/**/RivOut = RivOut + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+		/**/RivBas = RivBas - (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+		/**/
+		/**/RivDayOut = RivDayOut + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+		/**/RivMonthOut = RivMonthOut + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon);
+		/**/}
+		/**///-------------------------------------------------------
+		
+		/**/// TestRoutine 1 ----------------------------------------
+		if(Parameters("Test1")->asInt() > 0 && x == Parameters("xt1")->asInt() && y == Parameters("yt1")->asInt())
+		{//Effektiver Abfluss aus der Hauptgerinnerasterzelle der TestRoutine1 
+			m_pTestR1 = m_pTestR1 + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon); //Summe der errechneten Abfluesse aus Flussrasterzelle (x,y) ueber alle Zeitschritte
+			m_pTestR1m = m_pTestR1m + (((m_pGFlow + m_pBFlow + m_pCFlow)*m_pFlowFac) - m_pCon); //Summe der errechneten Abfluesse aus Flussrasterzelle (x,y) pro Monat		
+		}
+		/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+	}
+	else //Falls KEINE Abfluesse stattfinden koennen, Systemabfluss des Wassers des vorherigen Zeitschritts!!
+	{
+		double outflow1 = r - m_pRun;		//Inhalt von m_pTempR->asDouble(x,y) des letzten Zeitschritts abflieszen lassen	
+		double outflow2 = d - m_pDrain;		//Inhalt von m_pTempD->asDouble(x,y) des letzten Zeitschritts abflieszen lassen
+		double outflow0 = 0;
+		double remWith = 0;					//Wassermenge die nicht entnommen werden kann, weil zuwenig Speicherabfluss nach drauszen	
+
+		if( (m_pCCacheOut->asDouble(x,y) + outflow1 + outflow2) >= m_pCon)
+			outflow0 = (m_pCCacheOut->asDouble(x,y) + outflow1 + outflow2) - m_pCon;
+		else
+			remWith = m_pCon - m_pCCacheOut->asDouble(x,y) + outflow1 + outflow2; //bedeutet: outflow0 == 0
+
+
+		/**///%%%% Monitoring %%%%%%%%%% //Da Senke oder Rand -> Speicherrinhalte seit dem letzten Zeitschritts fliessen ab (bzw. wird geloescht).
+		/**/WSystemOut = WSystemOut + outflow0;
+		/**/WSystem = WSystem - outflow0;
+		/**/
+		/**/WSystemDayOut = WSystemDayOut + outflow0;
+		/**/WSystemDayWithd = WSystemDayWithd + m_pCon - remWith;
+		/**/		
+		/**/if(m_pBasinShare->asDouble(x,y) >= 0 ) //Abfrage ob (x,y) Koordinate im RiverBasin liegt
+		/**/{
+		/**/	RivBas = RivBas - outflow0;
+		/**/	RivBasSink = RivBasSink + outflow0;
+		/**/	RivBasDayWithd = RivBasDayWithd + m_pCon - remWith;
+		/**/	resRivBasConMonth = resRivBasConMonth + m_pCon - remWith;
+		/**/	remRivBasConMonth = remRivBasConMonth + remWith;
+		/**///	m_pSumRemCon->Add_Value(x,y,remWith);						//aeNDERUNG: 081114 - Anscheinden doppelter Eintrag s. Zeilen drunter (verantwortlich fuer Fehler in der Bilanz?)
+		/**/}
+		/**/m_pSumRemCon->Add_Value(x, y, remWith);
+		/**/m_pSumResCon->Add_Value(x, y, m_pCon - remWith);
+		/**///%%%%%%%%%%%%%%%%%%%%%%%%%%		
+		
+		m_pTempR->Set_Value(x, y, m_pRun);		//Speicher nur auf verikalen Zufluss dieses Zeitschritts setzen
+		m_pTempD->Set_Value(x, y, m_pDrain);	//Speicher nur auf verikalen Zufluss dieses Zeitschritts setzten
+		m_pCCacheOut->Set_Value( x, y, 0);		// Wenn Senke vorliegt (haeufig am Rande des Grids der Fall), wird Inhalt des letzten Zeitschrittes dt_n-1 (m_pCCacheOut(x,y)) geloescht (forcierter Abfluss nach auszen). Zufluss in die Box waehrend des jeweiligen Zeitschrittes dt_n (aus anderen Zellen in m_pTempC(x,y)) wird aber reingeschrieben.
+	}
+	
+}
+//
+//######################################################
+
+
+
+//######################################################
+//
+double CLandFlow::Calc_GFlow(int x, int y, double f) //OverlandFlow	ACHTUNG!! Funktioniert so nur mit nO = 1 !!
+{
+	double g = 0.0;
+	int i;
+	
+	if(kArray[x][y][0] > 0)
+	{
+		for(i=0; i < nG; i++) 
+		{
+			//--Test
+			double w = kArray[x][y][0];
+			double q = CalcRet(kArray[x][y][0], nG);
+			//--Test
+
+			g = f / CalcRet(kArray[x][y][0], nG);
+		}
+	}
+
+	return( g );
+}
+//
+//######################################################
+
+
+
+//######################################################
+//
+double CLandFlow::Calc_CFlow(int x, int y, double f, int n) //ChannelFlow/Gerinneabfluss
+{
+	double g = 0.0;
+	double h = 0.0;
+	int i;
+	
+	/**///%%%% Monitoring %%%%%%%%%%
+	/**/nCArray[x][y][nMax] = 0;
+	/**///%%%%%%%%%%%%%%%%%%%%%%%%%%
+	
+	if(kArray[x][y][1] > 0 )
+	{
+		g = f; // Gitterboxzufluss des letzten Zeitschritts in den ersten Kaskadenspeicher [0]
+		
+		for(i=0; i < n; i++)
+		{
+			
+			h = (nCArray[x][y][i] + g); // Speicherinhalt + Zufluss   //Entnahme wird bisher immer beim Gitterboxzufluss (hier Eingangswert f) des letzten Zeitschritts beruecksichtigt!!
+
+			if(n == 1 && f > 0) //testStop
+			{
+				int ay = 1;
+			}
+
+			if(h< 0) //testStop
+			{
+				int ay = 1;
+			}
+
+			//--Test
+			double w = kArray[x][y][1];
+			double q = CalcRet(kArray[x][y][1], n);
+			//--Test
+
+			if( h >= 0)
+				g = h / CalcRet(kArray[x][y][1], n);	//Abfluss aus Speicher
+			else										
+			{
+				g = 0;
+				if(Parameters("eP")->asBool())
+					WriteLog("FEHLER errC! Negativer Abfluss ermittelt - Abfluss fuer diesen Zeitschritt auf Null gesetzt");
+	
+				errC = 1;
+			}
+
+			if( (h-g) < 0) //testStop
+			{
+				int az = 1;
+			}
+
+			nCArray[x][y][i] = h - g; //verbleibender Speicherinhalt -> g == Zufluss des naechsten Speichers
+
+			/**///%%%% Monitoring %%%%%%%%%%
+			/**/nCArray[x][y][nMax] = nCArray[x][y][nMax] + nCArray[x][y][i];
+			/**///%%%%%%%%%%%%%%%%%%%%%%%%%%	
+
+		}
+	}
+
+
+	if(g < 0)	//Falls kein positiver Abfluss aus letztem Speicher -> Abfluss gleich Null 
+		g = 0;
+
+	return( g ); //Abfluss des letzten Speichers == Abfluss der Gitterbox in diesem Zeitschritt 
+}
+//
+//######################################################
+
+
+
+//######################################################
+double CLandFlow::Calc_BFlow(int x, int y, double f) //BaseFlow/Grundwasserabfluss ACHTUNG!! Funktioniert so nur mit nB = 1 !!
+{
+	double g = 0.0;
+		
+	if(kArray[x][y][2] > 0)
+	{
+		//--Test
+		double w = kArray[x][y][2];
+		double q = CalcRet(kArray[x][y][2], 1);
+		//--Test
+
+		g = f / CalcRet(kArray[x][y][2], 1);
+	}
+	
+	return( g );
+}
+//######################################################
+
+
+
+
+
+//######################################################
+double CLandFlow::CalcRet(double q, int n)
+{
+	return(q * 86400 / m_pTStep); // f[d] und m_pTSTep [s] - ACHTUNG n hier NICHT mehr miteinbezogen (17.02.14) [vormals: q * 86400 / m_pTStep*n ]  
+}
+//######################################################
+
+
+
+//SubBasinId
+//######################################################
+bool CLandFlow::SubBasinId(int x, int y)
+//Funktion gibt aus dem m_pSumRunoffDrainage-Raster die Summe der RunOff und Drainage Werte aller Rasterzellen des Teileinzugsgebiets der Flussrasterzelle (x,y),
+//ODER aller Rasterzellen des Abflusspfades bis zum Erreichen der HG-Rasterzelle   
+{
+	//KoordinatenDouble erzeugen FORMAT: xxxxyyyy
+	double r = 0;
+	int u = 10000*x + y;
+	r = u; //Koordinate der Flussrasterzelle des Teileinzugsgebietes - FORMAT: xxxxyyyy 
+
+	NumGridsTestR1 = 1; //entspricht zumindest einer HG-Raterzelle im Teileinzugsgebiet/Einzugsgebiet
+
+	double SumRD = m_pSumRunoffDrainage->asDouble(x,y); //als erstes die Summe der RunOff und Drainage Werte der Muendungs-HG-Rasterzelle des Teileinzugsgebiets/Einzugsgebiets setzten
+	double SumCon = m_pSumCon->asDouble(x,y);
+	double SumResCon = m_pSumResCon->asDouble(x,y);
+	double SumRemCon = m_pSumRemCon->asDouble(x,y);
+
+	
+	if(Parameters("Test1")->asInt() == 1)
+	{
+		if(m_pBasinShare)
+		{
+			for(int ix=0; ix < NX; ix++)
+			{
+				for(int iy=0; iy < NY; iy++)
+				{
+					if(!m_pDTM->is_NoData(ix,iy) && m_pBasinShare->asDouble(ix,iy) == r)
+					{
+						SumRD = SumRD + m_pSumRunoffDrainage->asDouble(ix,iy);
+						SumCon = SumCon + m_pSumCon->asDouble(ix,iy);
+						SumResCon = SumResCon + m_pSumResCon->asDouble(ix,iy);
+						SumRemCon = SumRemCon + m_pSumRemCon->asDouble(ix,iy);
+
+						NumGridsTestR1++;
+					}
+				}
+			}
+		}
+		else
+			return(false);
+	}
+
+	if(Parameters("Test1")->asInt() == 2)
+	{
+		if(m_pTestR1Share)
+		{
+			for(int ix=0; ix < NX; ix++)
+			{
+				for(int iy=0; iy < NY; iy++)
+				{
+					if(!m_pDTM->is_NoData(ix,iy) && m_pTestR1Share->asDouble(ix,iy) == r)
+					{
+						SumRD = SumRD + m_pSumRunoffDrainage->asDouble(ix,iy);
+						SumCon = SumCon + m_pSumCon->asDouble(ix,iy);
+						SumResCon = SumResCon + m_pSumResCon->asDouble(ix,iy);
+						SumRemCon = SumRemCon + m_pSumRemCon->asDouble(ix,iy);
+
+						NumGridsTestR1++;
+					}
+				}
+			}
+		}
+		else
+			return(false);
+	}
+
+	m_pTestR1RDm = SumRD - SumRD_SubBasin;
+	m_pTestR1Cm = SumCon - SumCon_SubBasin;
+	m_pTestR1resCm = SumResCon - SumResCon_SubBasin;
+	m_pTestR1remCm = SumRemCon - SumRemCon_SubBasin;
+
+	SumRD_SubBasin = SumRD;
+	SumCon_SubBasin = SumCon;
+	SumResCon_SubBasin = SumResCon;
+	SumRemCon_SubBasin = SumRemCon;
+	
+	return(true);
+}
+//######################################################
+
+
+//######################################################
+//Gesamtes Einzugsgebiet der HG-Rasterzelle (HGx,HGy) von TestR1 bestimmen
+void CLandFlow::TestR1Share(int HGx, int HGy)
+{
+	int x, y;
+	
+	//KoordinatenDouble der HG-Rasterzelle erzeugen FORMAT: xxxxyyyy
+	double r = 0;
+	int u = 10000*HGx + HGy;
+	//
+	
+	r = u; //Wert der gesetzt wird : FORMAT: xxxxyyyy (Koordinate der "Ziel"HG-Rasterzelle in alle im Abflusspfad voherigen Rasterzellen muenden)
+	
+	
+	if(m_pTestR1Share)
+	{
+		for(int l=0; l < m_pDTM->Get_NCells() && Set_Progress_NCells(l); l++) //ueber alle Zellen des m_pDEM-Grids
+		{
+			m_pDTM->Get_Sorted(l, x, y); //sortieren der Zellen von hoechster (l=0) nach niedrigster - 1.Durchlauf um zu gucken, ob Abflusspfad in (HGx, HGy) endet
+
+			while( !m_pDTM->is_NoData(x,y) && ( x != HGx || y != HGy ) )
+			{
+				int i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+				
+				if(i >= 0) //es gibt eine niedrigere Nachbarzelle...
+				{
+					x = Get_xTo(i, x);
+					y = Get_yTo(i, y);
+				
+					if(x == HGx && y == HGy)
+					{
+						m_pDTM->Get_Sorted(l, x, y);		//2.Durchlauf um Abflusspfad mit den koordinaten der HG-Rasterzelle (HGx, HGy) zu markieren.
+
+						while( !m_pDTM->is_NoData(x,y) && ( x != HGx || y != HGy )  )
+						{
+							int j = m_pDTM->Get_Gradient_NeighborDir(x, y);
+			
+							if(j >= 0) //es gibt eine niedrigere Nachbarzelle...
+							{
+								m_pTestR1Share->Set_Value(x, y, r); //Koordinaten der Ziel-Flussgridbox werden gesetzt
+								
+								x = Get_xTo(j, x);
+								y = Get_yTo(j, y);
+							}
+							else
+								{break;} //Nur fuer den Fall; j = -1 sollte eigentlich nicht mehr moeglich sein, da letzte Gridbox ja HG-Rasterzelle...
+						}
+					}
+				}
+				else
+					break; //Senke liegt vor
+			}
+		}
+	}
+}
+//######################################################
+
+
+
+//
+//######################################################
+bool CLandFlow::WConsRiv(int i)		//Berechnung der dynamschen Wasserentnahmewerte nach Funktionsauswahl 1 oder 2 (bisher auf Monatsbasis)
+{
+	double SumCons = 0;
+	double SumInFlow = 0;
+	double valTest = 0;
+	double BasinCon = 0;
+	int m = 1; //Multiplikativer Faktor fuer die Wasserentnahme (NUR fuer Entnahme aus HG-Rasterzelle) - PARAMETERWAHL wird bisher NICHT gelogt!
+
+	m_pWConsOut->Assign(0.0);
+	
+	if(i == 3) // falls Entnahme Funktion 3 (Entnahme des genauen Wertes der Eingangsdaten aus jeder Raterzelle) -> dann entspricht WasserentnahmeRaster genau den Eingangsdaten  
+		m_pWConsOut->Assign(&pWConsData);
+	else
+		if(m_pNumInFlow && m_pBasinShare)
+		{
+			//FlussGrids Identifizieren und damit jeweiliges Teileinzugsgebiet bestimmen
+			for(int x=0; x < NX; x++)
+			{
+				for(int y=0; y < NY; y++)
+				{
+					if( m_pRivGrids && Parameters("RivG")->asInt() > 0 && m_pRivGrids->asDouble(x,y) != 0) //Wenn HG-Rasterzelle
+					{
+						double r = 0;					//KoordinatenDouble erzeugen FORMAT: xxxxyyyy
+						int u = 10000*x + y;
+						r = u; //Wert der gesetzt wird : FORMAT: xxxxyyyy (Koordinate der Flussrasterzelle des Teileinzugsgebietes)
+					
+						//Falls Entnahme Funktion 1: Entnahme des Teileinzugsgebietes NUR aus der HauptgerinneRasterzelle
+						if(i == 1)
+						{
+							m_pWConsOut->Add_Value(x, y, m*pWConsData.asDouble(x, y)); //Entnahmewert der HG-Rasterzelle aus HG-Rasterzelle entnehmen
+							BasinCon = BasinCon + m*pWConsData.asDouble(x, y);		 //Aufsummierung der Entnahme im gesamten Einzugsgebiet 
+							
+							for(int ix=0; ix < NX; ix++)
+							{	
+								for(int iy=0; iy < NY; iy++)
+								{
+									if(!m_pDTM->is_NoData(ix,iy) && m_pBasinShare->asDouble(ix,iy) == r)
+										m_pWConsOut->Add_Value(x, y, (m*pWConsData.asDouble(ix, iy)) ); //Entnahmewert der Teileinzugsgebiets-Rasterzelle aus HG-Rasterzelle entnehemn
+										BasinCon = BasinCon + (m*pWConsData.asDouble(ix, iy));		  //Aufsummierung der Entnahme im gesamten Einzugsgebiet 
+								}
+							}
+						}
+
+						//Falls Entnahme Funktion 2: Entnahme des Teileinzugsgebietes ANTEILIG aus jeder Rasterzelle des Teileinzuggebietes
+						//Berechnugsparameter bestimmen:
+						//SumCons=Summe aller Ennahmen des Teileinzuggebietes (inkl HG-Rasterzelle)
+						//SumInFlow=Aufsummierte InFlowCell Werte aller Rasterzellen des Teileinzuggebietes
+						if(i == 2)
+						{
+							SumCons = pWConsData.asDouble(x, y);					//Entnahmen im Teileinzugsgebiet: Entnahme der HG-Rasterzelle (x,y) setzten
+							SumInFlow = m_pNumInFlow->asDouble(x, y);
+		
+							for(int ix=0; ix < NX; ix++)
+							{
+								for(int iy=0; iy < NY; iy++)
+								{
+									if(!m_pDTM->is_NoData(ix,iy) && m_pBasinShare->asDouble(ix,iy) == r)
+									{
+										//TEST
+										double Tst = pWConsData.asDouble(ix, iy);
+										double Tst2 = m_pNumInFlow->asDouble(ix, iy);
+
+										SumCons = SumCons + pWConsData.asDouble(ix, iy);
+										SumInFlow = SumInFlow + m_pNumInFlow->asDouble(ix, iy);
+									}
+								}
+							}
+
+							BasinCon = BasinCon + SumCons;		  //Aufsummierung der Entnahme im gesamten Einzugsgebiet
+								
+							//Auf Basis des Entnahmeanteils P = m_pNumInFlow(Rasterzelle) / SumInFlow , bestimmen des Entnahmewertes ueber P*SumCons und schreiben in m_pWConsOut
+							if(m_pNumInFlow->asDouble(x, y) == 0)	//Wenn SONDERFALL: HG-Rasterzelle hat keine Zufluesse, daher m_pNumInFlow und SumInFlow == 0 -> keine antielige sonder absolute Entnahme!
+							{
+								m_pWConsOut->Set_Value(x, y, SumCons); //...bestimmen des Entnahmewertes der HG-Zelle
+								valTest = SumCons;						//Validierungstest: Summe der anteiligen Entnahmen im Teileinzugsgebiet
+							}
+							else //anteilige Entnahme
+							{
+								m_pWConsOut->Set_Value(x, y, (m_pNumInFlow->asDouble(x, y) / SumInFlow * SumCons)); //...bestimmen des Entnahmewertes der HG-Zelle
+								valTest = m_pNumInFlow->asDouble(x, y) / SumInFlow * SumCons;						//Validierungstest: Summe der anteiligen Entnahmen im Teileinzugsgebiet
+							}
+
+							for(int ix=0; ix < NX; ix++)
+							{
+								for(int iy=0; iy < NY; iy++)
+								{
+									if(!m_pDTM->is_NoData(ix,iy) && m_pBasinShare->asDouble(ix,iy) == r && m_pNumInFlow->asDouble(x, y) > 0)
+									{
+										double partCon = (m_pNumInFlow->asDouble(ix, iy) / SumInFlow * SumCons);
+										valTest = valTest + partCon;				//Validierungstest: Summe der anteiligen Entnahmen im Teileinzugsgebiet
+										m_pWConsOut->Set_Value(ix, iy, partCon);	//...bestimmen des Entnahmewertes der uebrigen Rasterzelle
+									}
+								}
+							}				
+						}
+						
+					}
+				}
+			}
+		}		//valTest Breakpoint: valTest ungefaehr SumCons ??
+		else
+			return(false);
+
+	return(true);
+}
+//######################################################
+
+
+
+
+
+
+
+//#########################################################
+//---------------------------------------------------------
+//#########################################################
+
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//	Sekundaer-Funktionen									 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------
+//Initiierungsfunktionen
+//---------------------------------------------------------
+//
+void CLandFlow::InitKArray() //Warnung : Funktion statisch auf Grid m_pGrad eingestellt
+{
+	double Cx;
+	int nCx;
+	
+	for(int x=0; x < NX; x++)
+		{
+			for(int y=0; y < NY; y++)
+			{
+				if(m_pGrad->is_NoData(x,y) || m_pGrad->asDouble(x,y) == 0)
+				{
+					kArray[x][y][0] = -1;
+					kArray[x][y][1] = -1;
+					kArray[x][y][2] = -1;
+				}
+				
+				else
+				{
+					if( Parameters("RivG")->asInt() > 0 && m_pRivGrids->asDouble(x,y) != 0) // falls Flusssgrids beruecksichtigt werden und Flussgrid...
+					{
+						Cx = C0r;
+						nCx = nCr;
+					}
+					else
+					{
+						Cx = C0;
+						nCx = nC;
+					}
+
+					double kG = G0/(nG*2) * (m_pDTM->Get_Cellsize() / 1000 ) / pow(m_pGrad->asDouble(x,y), 0.1 ); // *0* DEFAULT:  pG = 17.87e-2*dx/(grad)^0.1 -> dx in km
+					double kC = Cx/(nCx*2) * (m_pDTM->Get_Cellsize() / 1000 ) / pow(m_pGrad->asDouble(x,y), 0.1 ); // *1* DEFAULT: pC = 9.92e-4*dx/(grad)^0.1 -> dx in km
+					double kB = pB * (m_pDTM->Get_Cellsize() / 1000 ) / 50; // *2* kB [d], dx [km] / d0=50000 m )
+					
+					
+					if( kG > kMinG )	
+						kArray[x][y][0] = kG;
+					else
+						kArray[x][y][0] = kMinG;
+					
+					if( kC > kMinC )	
+						kArray[x][y][1] = kC;
+					else
+						kArray[x][y][1] = kMinC;
+
+					if ( kB > kMinB )	
+						kArray[x][y][2] = kB;
+					else
+						kArray[x][y][2] = kMinB;
+				}
+			}
+		}
+}
+
+
+void CLandFlow::InitNcArray(int p1, int p2, int p3)
+{
+	// Initiieren mit Wert Null
+	for(int x=0; x < p1; x++)
+	{
+		for(int y=0; y < p2; y++)
+		{
+			for(int i = 0; i < p3; i++)
+			{
+				nCArray[x][y][i] = 0;
+			}
+		}
+	}
+}
+
+
+/*void CLandFlow::InitPArray(int p1, int p2, int p3) //zur Zeit: nicht gesetzt
+{
+	// Initiieren mit Wert Null
+	for(int x=0; x < p1; x++)
+	{
+		for(int y=0; y < p2; y++)
+		{
+			for(int i = 0; i < p3; i++)
+			{
+				pArray[x][y][i] = 0;
+			}
+		}
+	}
+}*/
+
+
+
+//---------------------------------------------------------
+//Speicherfunktionen bzw. Schreibefunktion
+//---------------------------------------------------------
+//
+bool CLandFlow::SaveNcCache(int nMax) 
+{
+	int i = 0;
+	int o = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\NcCache.txt";
+	path = path0.str();
+
+	int d = NX * NY;
+	fstream myfile;
+	myfile.open(path.c_str(), ios::out|ios::trunc);
+	
+	for(int x = 0; x < NX; x++)
+	{
+		for(int y = 0; y < NY; y++)
+		{
+			myfile << x << " " << y;
+
+			for(o = 0; o < nMax; o++)
+			{
+/**/			if(o == 0 && m_pTempK->asDouble(x,y) >= 0) // aenderung 181114: Gitterboxzufluss des letzten Zeitschritts wird im ersten Speicher gerspeichert...
+/**/				myfile << " " << ( nCArray[x][y][o] + m_pTempK->asDouble(x,y) );
+/**/			else			
+					myfile << " " << nCArray[x][y][o]; 
+			}
+
+			myfile << "\n";
+			i++;
+			Process_Set_Text(CSG_String::Format(SG_T("NcCache || Schreibe Datensatz %d von %d"),i ,d));
+		}
+	}
+
+	myfile.close();
+
+return true;
+}
+
+
+bool CLandFlow::SaveParameters()
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\SimParameters.txt";
+	path = path0.str();
+
+	int d = NX * NY;
+	time_t rawtime;
+	time(&rawtime);
+	fstream myfile;
+	myfile.open(path.c_str(), ios::out|ios::trunc);
+
+	myfile << "KALIBRIERUNGSVERSION des Programms! EingangsPARAMETER C0, C0r und G0 unabhaengig von n." << "\n\n";
+	myfile << "Basierend auf: ProgrammBuild " << cVers << "\n";
+	myfile << "TimeStamp: " << ctime(&rawtime) << "\n\n";
+	myfile << "Parameter:\n\n";
+	myfile << "Startjahr = " << m_sYear0 << "\n";
+	myfile << "Simulation mit Speicherwerten initialisieren [0 = nein, 1 = ja]: " << Parameters("CacheUse")->asBool() << "\n";
+	myfile << "Wasservolumen in den Systemspeichern zu Beginn der Simulation: RivBasInit = " << RivBasInit << " und WSystemInit = " << WSystemInit << "\n";
+
+	myfile << "Rechentage [d] = " << m_pDays << "\n";
+	myfile << "Schrittlaenge [s] = " << m_pTStep << "\n\n";
+	myfile << "vMax [km/h] = " << vMax << "\n";
+	myfile << "Aufloesung [m] = " << m_pDTM->Get_Cellsize() << "\n";
+	myfile << "Anzahl der Reihen NX = " << NX << "\n";
+	myfile << "Anzahl der Zeilen NY = " << NY << "\n";
+	myfile << "Anzahl der Rasterzellen des DTM (ohne NoDataZellen): " << NumGrids << "\n";
+	myfile << "Anzahl der Rasterzellen im Flusseinzugsgebiet: " << NumRBGrids << "\n\n";
+	myfile << "LSSchemaDaten-Dateipfad [Ordner]: " << m_pLSDataFolder.b_str() << "\n";
+	myfile << "WaterGapDaten-Dateipfad [Ordner]: " << m_pWConDataFolder.b_str() << "\n"; 
+	myfile << "Datenpfad wo gespeicher werden soll: " << m_pDataSaveFolder.b_str() << "\n";
+	myfile << "Absoluter SpeicherDateipfad: " << m_pSPath << "\n\n";
+	
+
+	myfile << "nG = " << nC << "\n";
+	myfile << "nHG = " << nCr << "\n";
+	myfile << "nO = " << nG << "\n";
+	myfile << "cG = " << C0 << "\n";
+	myfile << "cHG = " << C0r << "\n";
+	myfile << "cO = " << G0 << "\n";
+	myfile << "pB = " << pB << "\n\n";
+	
+	myfile << "Fester Reduzierungsfaktor des Surface Runoff [%/100] = " << m_pRedFacR << "\n";
+	myfile << "Fester Reduzierungsfaktor der Drainage [%/100] = " << m_pRedFacD << "\n";
+	myfile << "Ausgleich der Surface Runoff Reduktion = " << Parameters("autoFacD")->asBool() << "\n2";
+	myfile << "Offsetwert Surface Runoff [m3/s] = " << m_pOffsetR << "\n";
+	myfile << "Offsetwert Drainage [m3/s] = " << m_pOffsetD << "\n";myfile << "Flussgrid-Beruecksichtigung/Bestimmung = " << Parameters("RivG")->asInt() << "\n";
+	
+	myfile << "kMinG [d] = " << kMinC << "\n";
+	myfile << "kMinHG [d] = " << kMinCr << "\n";
+	myfile << "kMinO [d] = " << kMinG << "\n";
+	myfile << "kMinB [d] = " << kMinB << "\n";
+	myfile << "vMaxG [km/h] = " << vMaxC << "\n";
+	myfile << "vMaxHG [km/h] = " << vMaxCr << "\n";
+	myfile << "vMaxO [km/h] = " << vMaxG << "\n";
+	myfile << "Berechnung NUR im RiverBasin = " << Parameters("onlyRB")->asBool() << "\n\n";
+
+	myfile << "Flaechenwasserentnahme - Auswahl [0=keine] = " << Parameters("WCons")->asInt() << "\n";
+	myfile << "Fester Gitterbox-Wasserentnahmefaktor [%] = " << m_pConsFacAll << "\n";
+	myfile << "Fester FlussGitterbox-Wasserentnahmefaktor [%] = " << m_pConsFacRiv << "\n";
+	myfile << "Vorlauftage bevor Wasserentnahme beruecksichtigt wird [d] = " << m_pWConsDIn << "\n\n";
+	myfile << "Schwellenwert ab dem eine Entnahem erst vorgenommen wird [m3/s] = " << m_pWConThres << "\n";
+	myfile << "Einheit der eingelesenen WaterGapDaten ([m3/s] = 0, [m3/Monat] = 1): " << Parameters("WConUnit")->asInt() << "\n\n";
+
+	myfile << "m_pVTresh erzwingen = " << Parameters("EnfVmax")->asBool() << "\n";
+	myfile << "m_pVTresh [km/h] = " << m_pVTresh << "\n";
+	myfile << "Autom. Zeitschrittlaenge = " << Parameters("CalcT")->asBool() << "\n";
+	myfile << "k_Min [d] = " << k_Min << "\n\n";
+	
+	myfile << "ErrorCode = " << errC << "\n\n";
+
+	myfile << "Evaluierungspunkte:" << "\n";
+	myfile << "Evaluierungspunkt 1 - " << m_pEvP1s.b_str() << ", x=" << Parameters("EvP1x")->asInt() << ", y=" << Parameters("EvP1y")->asInt() << "\n";
+	myfile << "Evaluierungspunkt 2 - " << m_pEvP2s.b_str() << ", x=" << Parameters("EvP2x")->asInt() << ", y=" << Parameters("EvP2y")->asInt() << "\n";
+	myfile << "Evaluierungspunkt 3 - " << m_pEvP3s.b_str() << ", x=" << Parameters("EvP3x")->asInt() << ", y=" << Parameters("EvP3y")->asInt() << "\n";
+	myfile << "Ausgangsrasterzelle des Flusseinzugsgebiet: " << "x=" << Parameters("RBMx")->asInt() << ", y=" << Parameters("RBMy")->asInt() << "\n\n";
+
+	if(Parameters("vRM1")->asInt() > 0 || Parameters("vRM2")->asInt() > 0)
+	{
+		myfile << "Abflussmanipulation Rasterzelle 1 - Manipulation des berechnteen Abflusses [1], Abfluss aus Speicher vorgeben [2]: " << Parameters("vRM1")->asInt() << "\n";
+		myfile << "Koordinate: x = " << Parameters("RM1x")->asInt() << ", y = " << Parameters("RM1y")->asInt() << "\n";
+		myfile << "Faktor q = " << Parameters("RM1q")->asDouble() << " und Offset a = " <<  Parameters("RM1a")->asDouble() << "\n\n";
+		
+		myfile << "Abflussmanipulation Rasterzelle 2 - Manipulation des berechnteen Abflusses [1], Abfluss aus Speicher vorgeben [2]: " << Parameters("vRM2")->asInt() << "\n";
+		myfile << "Koordinate: x = " << Parameters("RM2x")->asInt() << ", y = " << Parameters("RM2y")->asInt() << "\n";
+		myfile << "Faktor q = " << Parameters("RM2q")->asDouble() << " und Offset a = " <<  Parameters("RM2a")->asDouble() << "\n\n";
+
+		myfile << "Gesamtmenge des Wassers, die waehrend des Simualtionszeitraumes durch die Rasterzellenmanipulation dem RivBasin hinzugefuegt (+) oder entnommen (-) wurde: " << manWithd << "\n\n";
+	}
+
+	if(Parameters("Test1")->asInt() > 0)
+	{
+		myfile << "TestRoutine [1]: 1) nur fuer Teileinzugsgebiet der HG-Rasterzelle oder [2] fuer das Flusseinzugsgebiet bis zum Erreichen der HG-Rasterzelle: " << Parameters("Test1")->asInt() << "\n\n";
+		myfile << "TestRoutine 1: Flusseinzugsgebiet der Flussrasterzelle (" << Parameters("xt1")->asInt() << "," << Parameters("yt1")->asInt() << ")\n";
+	
+		if(SumRD_SubBasin >= 0)
+		{	
+			myfile << "Anzahl der Rasterzellen des Teileinzugsgebietes: " << NumGridsTestR1 << "\n";
+			myfile << "Summe der vertikalen Zufluesse im Teileinzugsgebiet ueber den gesamten Simulationszeitraum: " << SumRD_SubBasin << "\n";
+			myfile << "Summe der Abfluesse aus der Flussrasterzelle ueber den gesamten Simulationszeitraum: " << m_pTestR1 << "\n";
+			myfile << "Differenz: " << SumRD_SubBasin - m_pTestR1 << "\n\n";
+		}
+		else
+			myfile << "FEHLER beim Ausfuehren der TestRoutine 1.\n\n";
+	}
+
+
+	/*myfile << "x | y | kG | kC | kB | Wcons" << "\n";			//Schreiben aller K-Werte zu den jeweiligen (x,y) Koordinaten
+	
+	for(int x = 0; x < NX; x++)
+	{
+		for(int y = 0; y < NY; y++)
+		{
+			myfile << x << " " << y;
+			myfile << " " << kArray[x][y][0];
+			myfile << " " << kArray[x][y][1];
+			myfile << " " << kArray[x][y][2];
+	
+			if( Parameters("WCons")->asBool() )
+				myfile << " " << (m_pWCons->asDouble(x,y) / 1000) * pow(m_pDEM->Get_Cellsize(), 2) * m_pTStep;
+			
+			myfile << "\n";
+			i++;
+			Process_Set_Text(CSG_String::Format("Parameters || Schreibe Datensatz %d von %d",i ,d));
+		}
+	}*/
+
+	myfile.close();
+
+return true;
+}
+
+
+bool CLandFlow::WriteOutput(string s, double p1, double p2, int x, int y)
+{
+	int i = 0;
+	
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\" << s ;
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+	
+	if(x >= 0 && y >= 0 )
+		myfile << x << " " << y << " " << p1 << " " <<  p2 << "\n";
+	else
+		myfile << p1 << " " << p2 << "\n";
+	
+	myfile.close();
+
+return true;
+}
+
+
+bool CLandFlow::WriteRivBalance(int i1, int i2, double p1, double p2)
+{
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath3 << "\\" << "RivWaterBalance_" << m_sYear << "-" <<  dC << ".txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+	
+	if(p1 < 0 && p2 < 0 ) //nur schreiben des headers
+	{
+		myfile << "Jahr:" << i1 << "    Tag:" << i2 << "\n";
+		myfile << "Koordinate    Flusskilometer    m3/s" << "\n";
+	}
+	else
+		myfile << "(" << i1 << "," << i2 << ") " << p1 << " " << p2 << "\n";
+	
+	myfile.close();
+
+return true;
+}
+
+
+//---------------------------------------------------------
+// Logeintraege
+//---------------------------------------------------------
+//
+bool CLandFlow::TestLog1(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\Monitoring_RivBasin.txt";
+	path = path0.str();
+	
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
+
+bool CLandFlow::TestLog2(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\Monitoring_WSystem.txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
+
+bool CLandFlow::TestLog3(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\Monitoring_monthWUseRivBasin.txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
+
+bool CLandFlow::TestLog4(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\TestRoutine1.txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
+
+
+bool CLandFlow::WriteLog(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pSPath << "\\ErrorLog.txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
+
+
+//-----------------------------------------------------
+//	ReadCacheFile Functions
+//-----------------------------------------------------
+//
+double CLandFlow::ReadNCacheFile(bool p0, string s1, int p1, int p2, int p3, int p4, int p5, char p6, int p7, bool p8)
+{
+	//p0 -	false : Opt1 (Datei in Array einelsen)		/	true : Opt2 (Spez Wert zu Koord (x,y) einlesen)						
+	//p1 -	Anzahl der x-Eintraege						/	Anzahl der x-Eintraege
+	//p2 -	Anzahl der y-Eintraege						/	Anzahl der y-Eintraege
+	//p3 -	0											/	x-Koordinate (x0 = 0)
+	//p4 -	0											/	y-Koordinate (y0 = 0)
+	//p5 -	Anzahl der Speicherwerte pro x,y Koordinate	/	Anzahl n der Speicherwerte pro x,y Koordinate
+	//p6 -	Trennzeichen [char]							/	Trennzeichen [char]
+	//p7 -	0											/	spez einzulesender Speicherwert s von n
+	//p8 -	if(true) - erste Zeile enthaelt Sonderinf.	/	false 
+	
+	int x = 0;
+	int y = 0;
+	int o = 0;
+	int r = 0;
+	std::string transfer;
+	char a;
+	double ret = -1;
+	
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << m_pNCacheFolder.b_str();
+	path = path0.str();
+
+	ifstream myfile;
+	myfile.open(path.c_str(), ios_base::in);
+	
+	if( myfile.is_open() && !myfile.eof() )
+	{
+		if(p0 == false) //p0 -	false : Opt1 (Datei in Array einelsen)
+		{
+			if(p8 == true)
+				getline(myfile, transfer, '\n');
+
+			for(int x = 0; x < p1; x++)
+			{
+				for(int y = 0; y < p2; y++)
+				{
+					if(!myfile.eof())
+					{
+						for(int m = 0; m < 2; m++)
+						{
+							while( (a = myfile.get()) != p6 && a != '\n')
+							{}
+						}
+					
+						for(o = 0; o < p5; o++)
+						{		
+							if(a != 0)
+							{
+								if(o<p5-1)
+									getline(myfile, transfer, p6);
+								else
+									getline(myfile, transfer, '\n');
+
+								nCArray[x][y][o] = atof(transfer.c_str());
+							}
+							else
+							{
+								WriteLog("FEHLER!! Datei hat zu wenig Speichereintraege - ABBRUCH");
+								return ret;
+							}
+						}
+						r++;
+						Process_Set_Text(CSG_String::Format(SG_T("NC Datensatz %d wurde eingelesen"),r));
+					}
+					else
+					{
+						WriteLog("FEHLER!! Anzahl der angegebenen (x,y) Koordinaten und Anzahl der Speichereintraege der NC-Speicherdatei stimmen nicht ueberein - ABBRUCH");
+						return ret;
+					}
+				}
+			}
+			ret = 0;
+		}
+		else //	true : Opt2 (Spez Wert zu Koord (x,y) einlesen)
+		{
+			for(int x = 0; x < p1; x++)
+			{
+				for(int y = 0; y < p2; y++)
+				{
+					if( !myfile.eof() )
+					{
+						if(x == p3 && y == p4)
+						{
+						
+							/*int diff = (p1+1)-(p3+1);
+
+							int pos = p3*(p2+1)+(p4+1);
+
+							for(int i = 0; i < pos; i++)
+							{
+								while(myfile.get() != '\n')
+								{}							
+							}*/
+
+							if(p5-p6 >= 0)
+							{
+								for(int m = 0; m < (2+p6-1); m++)
+								{
+									while( (a = myfile.get()) != p6)
+									{}
+
+									if(a == '\n')
+									{
+										WriteLog("FEHLER!! Angabe der Anzahl der Speicherwerte pro Koordinate ist nicht korrekt - ABBRUCH");
+										return ret;
+									}
+								}
+					
+								if(p5 - p6 > 0)
+									getline(myfile, transfer, p6);
+								else
+									getline(myfile, transfer, '\n');
+						
+								ret = atof(transfer.c_str());
+								return ret;
+							}
+							else
+							{
+								WriteLog("FEHLER!! Einzulesend Speicherwert existiert nicht - ABBRUCH");
+								return ret;
+							}
+						}
+						else
+						{
+							getline(myfile, transfer, '\n');
+							//ret = atof(transfer.c_str()); // testzwecke
+						}
+					}
+					else
+					{
+						WriteLog("FEHLER!! Datei enthaelt weniger Speichereintraege als abgefragt werden - ABBRUCH");
+						return ret;
+					}
+				}
+			}
+		}
+	}
+	else
+	{
+		WriteLog("FEHLER!! Dateifehler - Datei NC konnte nicht geoeffnet werden - ABBRUCH.");
+		return ret;
+	}	
+	
+	myfile.close();
+
+	return ret;
+}
+
+//-----------------------------------------------------
+//	CreateArray Functions
+//-----------------------------------------------------
+//
+void CLandFlow::CreateKArray(int p1, int p2, int p3)
+{
+		kArray = new double**[p1];
+		for (int i = 0; i < p1; i++)
+		{
+			kArray[i] = new double*[p2];
+			for (int j = 0; j < p2; j++)
+				kArray[i][j] = new double[p3];
+		}
+}
+
+
+void CLandFlow::CreateLSMArray(int p1, int p2, int p3)
+{
+		lsMArray = new double**[p1];
+		for (int i = 0; i < p1; i++)
+		{
+			lsMArray[i] = new double*[p2];
+			for (int j = 0; j < p2; j++)
+				lsMArray[i][j] = new double[p3];
+		}
+}
+
+void CLandFlow::CreateNcArray(int p1, int p2, int p3)
+{
+	nCArray = new double**[p1];
+		for (int i = 0; i < p1; i++)
+		{
+			nCArray[i] = new double*[p2];
+			for (int j = 0; j < p2; j++)
+				nCArray[i][j] = new double[p3]; 
+		}
+}
+
+
+void CLandFlow::CreatePArray(int p1, int p2, int p3)
+{
+	pArray = new double**[p1];
+		for (int i = 0; i < p1; i++)
+		{
+			pArray[i] = new double*[p2];
+			for (int j = 0; j < p2; j++)
+				pArray[i][j] = new double[p3];
+		}
+}
+
+
+
+//-----------------------------------------------------
+//	DeleteArray Functions
+//-----------------------------------------------------
+//ACHTUNG : statisch auf NX/NY festgelegt - Fehlerpotential, weil keine Groeszenabfrage
+void CLandFlow::DeleteKArray()
+{
+	for(int x = 0; x < NX; x++)
+	{
+		for(int y = 0; y < NY; y++)
+		{
+				delete [] kArray[x][y];
+		}
+		delete [] kArray[x];
+	}
+	delete [] kArray;
+
+	kArray = NULL; 
+}
+
+
+void CLandFlow::DeletePArray()
+{
+	for(int x = 0; x < NX; x++)
+	{
+		for(int y = 0; y < NY; y++)
+		{
+				delete [] pArray[x][y];
+		}
+		delete [] pArray[x];
+	}
+	delete [] pArray;
+
+	pArray = NULL;
+}
+
+void CLandFlow::DeleteNcArray()
+{
+	for(int x = 0; x < NX; x++)
+	{
+		for(int y = 0; y < NY; y++)
+		{
+				delete [] nCArray[x][y];
+		}
+		delete [] nCArray[x];
+	}
+	delete [] nCArray;
+
+	nCArray = NULL;
+}
+
+//#########################################################
+//---------------------------------------------------------
+//#########################################################
+
+//###################################################################################################
+// Vorlage
+//###################################################################################################
+
+////////////////TEST
+/*			if( dC >9 && dC > 12 && x == 145 && y == 578)
+			{	
+				double pTest = m_pCCacheOut->asDouble(x,y) - m_pCFlow;
+				
+				std::stringstream file0;
+				file0.str("");
+				file0 << "Neu Darchau-Cache: Tag = " << dC << ", Zeitschritt = " << dT << ", Entnahme m_pCFlow = " << m_pCFlow << ", Speicherwert = " << pTest;
+				std::string file = file0.str();
+				
+				TestLog1( file );
+			}
+			
+			if( dC >9 && dC > 12 && ix == 145 && iy == 578)
+			{	
+				m_pTest = m_pTest + (m_pGFlow + m_pBFlow + m_pCFlow - m_pCon)*m_pStCons;
+
+				std::stringstream file0;
+				file0.str("");
+				file0 << "Neu Darchau-InFlow: Tag = " << dC << ", Zeitschritt = " << dT << ", InFlow in TStep = " << o << ", Entnahme WCons = " << varCons << ", Sum InFlow = " << m_pTest;
+				std::string file = file0.str();
+
+				TestLog2( file );
+			}*/
+///////////////
+
+
+
diff --git a/src/modules/simulation/sim_rivflow/LandFlow.h b/src/modules/simulation/sim_rivflow/LandFlow.h
new file mode 100644
index 0000000..720b864
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/LandFlow.h
@@ -0,0 +1,294 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      LandFlow.h                       //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__LandFlow_H
+#define HEADER_INCLUDED__LandFlow_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+#include <string>
+using namespace std;
+//---------------------------------------------------------
+//#########################################################
+
+class CLandFlow : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CLandFlow(void);							// constructor
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute	(void);		// always overwrite this function
+
+
+private: ///// private members and functions: /////////////
+
+/// Members
+//Grids
+	CSG_Grid *m_pDTM;
+	CSG_Grid *m_pGrad;
+	CSG_Grid *m_pDirec;
+	CSG_Grid *m_pRFlow;
+	CSG_Grid *m_pDFlow;
+	CSG_Grid *m_pWConsIn;				//statisches WaterConsumption Grid in [kg m-2 s-1]
+	CSG_Grid *m_pWConsOut;				//dynamisch generiertes WaterConsumption Grid in [kg m-2 s-1]
+	CSG_Grid *m_pCCacheIn;
+	CSG_Grid *m_pRCacheIn;
+	CSG_Grid *m_pDCacheIn;
+	CSG_Grid *m_pCCacheOut;
+	CSG_Grid *m_pRCacheOut;
+	CSG_Grid *m_pDCacheOut;
+	CSG_Grid *m_pTempR;
+	CSG_Grid *m_pTempC;
+	CSG_Grid *m_pTempD;
+	CSG_Grid *m_pChannelFlow;
+	CSG_Grid *m_pSumRunoffDrainage;
+	CSG_Grid *m_pTemp;
+	CSG_Grid *m_pTempK;
+	CSG_Grid *m_pRivGrids;
+	CSG_Grid *m_pRivGrad;
+	CSG_Grid *m_pBasinShare;
+	CSG_Grid *m_pRivBalanceGrid;
+	CSG_Grid *m_pNumInFlow;
+	CSG_Grid *m_pSumCon;				//eigentliche Entnahme
+	CSG_Grid *m_pSumResCon;				//resultierende Entnahme 
+	CSG_Grid *m_pSumRemCon;				//nicht ber�cksichtigte Entnahmen 
+	CSG_Grid *m_pTestR1Share;			//gesammtes Einzugsgebiet zu HG-Rasterzelle (x,y) der TestR1 Routine
+	CSG_Grid pWConsData;
+
+
+	CSG_String m_pWConsFile;
+	CSG_String m_pLSDataFolder;
+	CSG_String m_pDataSaveFolder;
+	CSG_String m_pWConDataFolder;
+	CSG_String m_pNCacheFolder;
+	CSG_String m_pDateipfad;
+	//CSG_String m_pLSData26File;
+	//CSG_String m_pLSData27File;
+	CSG_String m_pEvP1s;
+	CSG_String m_pEvP2s;
+	CSG_String m_pEvP3s;
+
+	std::string m_pSPath;
+	std::string m_pSPath2;
+	std::string m_pSPath3;
+	//std::string m_pLPath;
+
+//Int
+	int m_pDays;					//Festgelegte Anzahl an Simulationstagen (Input Parameter)
+	int nC;							//Anzahl der Speicherkaskaden des ChannelFlow Speichers
+	int nCr;						//Anzahl der Speicherkaskaden des ChannelFlow River-Speichers
+	int nMax;
+	int nG;
+	int NX;
+	int NY;
+	int dC;							//dayCounter - Tagesz�hler [d]
+	int dDC;						//dayDataCounter - Datentag-Z�hler [d] (1-365/366)
+	int mYC;						//MonthOfYear Monatsz�hler (1-12)
+	int dMC;						//DayOfMonth Tagesz�hler [d]			(1-28/29/30/31)
+	int m_pDDays;
+	int m_pTStep;					//Zeitschrittl�nge dt
+	int errC;
+	int errC2;
+	int errC3;
+	int errC4;
+	int m_sYear0;
+	int m_sYear;
+	int m_pWConsD;					// verbleibende Tage bevor Entnahme (Operator) es gilt: m_pWConsD <= m_pWConsDIn, m_pWConsD--
+	int m_pWConsDIn;				// Tage bevor jedwede Entnahme beginnt (Input-Variable)
+	int numTS;						// Anzahl der Zeitschritte pro Tag
+	int NumRBGrids;					//Anzahl der Rasterzellen im Flusseinzugsgebiet
+	int NumGrids;					//Anzahl der Rasterzellen des DTM (ohne NoDataValues)
+	int NumGridsTestR1;			//Anzahl der Rasterzellen des Teileinzugsgebietes der TestRoutine1
+
+	int var1;						//Programmvariable : Prozentuale Wasserentnahme initiieren
+	int var2;						//Programmvariable : Testlog 1
+	int var3;						//Programmvariable : Testlog 2
+	int var4;						//Programmvariable : 
+
+//double
+	double cVers;					//Compelierungs-Version
+	double m_pGFlow;
+	double m_pCFlow;
+	double m_pBFlow;
+	double m_pRun;
+	double m_pDrain;
+	double m_pVTresh;
+	double k_Min;
+	double kMinG;
+	double kMinC;
+	double kMinCr;
+	double kMinB;
+	double vMaxC;
+	double vMaxCr;
+	double vMaxG;
+	double vMax;
+	double dT;						//daytimeCounter - Tageszeitz�hler [s]
+	double G0;
+	double C0;
+	double C0r;						//Parameter f�r ChannelFlow im River [optional]
+	double pB;
+	double m_pCon;					//Fl�chenbasierte Entnahmen (absoluter Wert)
+	double m_pConsFacAll;			//Entnahmefaktor aus Gitterboxen [%]/[dt]
+	double m_pConsFacRiv;			//Entnahmefaktor aus Fluss-Gitterboxen [%]/[dt]
+	double m_pRedFacR;				//Reduzierungsfaktor RunOff [%]/[dt]
+	double m_pRedFacD;				//Reduzierungsfaktor Drainage [%]/[dt]
+	double m_pHFlowFac;				//Weiterleitungsfaktor des Abfluss aus Gitterboxen in % des tats�chlichen Abflusses
+	double m_pRFlowFac;				//Weiterleitungsfaktor des Fluss-Gitterboxen in % des tats�chlichen Abflusses
+	double m_pVRFlowFac;			//reduzierter vertikaler Zufluss (Runnoff) in % des tats�chlichen RunOff-Zuflusses
+	double m_pVDFlowFac;			//reduzierter vertikaler Zufluss (Drainage) in % des tats�chlichen Drainage-Zuflusses
+	double m_pFlowFac;				//Abfrageplatzhalter f�r m_pHFlowFac oder m_pRFlowFac
+	double m_pTest;
+	double stCons;
+	double varCons;
+	double SumRDMonth;				//Summe der Runoff und Drainage Werte des Einzugsgebietes eines Monats
+	double SumRMonth;				//NUR Summe der Runoff-Werte des Einzugsgebietes eines Monats
+	double SumDMonth;				//NUR Summe der Drainage-Werte des Einzugsgebietes eines Monats
+	double SumRD_SubBasin;			//Summe der Runoff und Drainage Werte eines SubBasin [TestRoutine 1]
+	double SumCon_SubBasin;			//Summe der beabsichtigten Entnahmen eines SubBasin [TestRoutine 1]
+	double SumResCon_SubBasin;		//Summe der tats�chlichen Entnahmen eines SubBasin [TestRoutine 1]
+	double SumRemCon_SubBasin;		//Summe der nicht ber�cksichtigten Entnahmen eines SubBasin [TestRoutine 1]
+	double m_pTestR1;				//SpeicherVariable TestRoutine 1
+	double m_pTestR1m;				//SpeicherVariable TestRoutine 1
+	double m_pTestR1RDm;			//SpeicherVariable TestRoutine 1
+	double m_pTestR1Cm;				//SpeicherVariable TestRoutine 1
+	double m_pTestR1resCm;			//SpeicherVariable TestRoutine 1
+	double m_pTestR1remCm;			//SpeicherVariable TestRoutine 1
+	double m_pWConThres;			//Schwellenwert f�r HG-Abfluss der auch bei Entnahmen nicht unterschritten werden soll
+	double m_pOffsetR;				//Offsetwert auf den vertikalen Zufluss 'RunOff' pro Rasterzelle in m�/s
+	double m_pOffsetD;				//Offsetwert auf den vertikalen Zufluss 'Drainage' pro Rasterzelle in m�/s
+	
+	double WSystemDayWithd;			//Summe allen Wassers, dass dem WSystem pro Tag entnommen wird oder �ber Entnahmefaktor verloren geht
+	double WSystem;					// Im System befindliches Wasser
+	double WSystemInit;				// Anf�nglicher Speicherinhalt WSystem nach Speicherinitilisierung
+	double WSystemIn;				// Summe des Wassers was ins System gelangt (Drainage, RunOff)
+	double WSystemOut;				// Summe des Wassers welches das System verl��t (Systemabfluss)
+	double WSystemDayIn;			// Summe des Wassers was am jeweiligen Tag ins System gelangt (Drainage, RunOff)
+	double WSystemDayOut;			// Summe des Wassers welches am je weiligenTag das System verl��t (Systemabfluss)
+	
+	double RivBas;					// Im RivBasin befindliches Wasser
+	double RivBasInit;				// Anf�nglicher Speicherinhalt RivBasin nach Speicherinitilisierung
+	double RivBasIn;				// Summe des Wassers was ins RiverBasin gelangt (Drainage, RunOff)
+	double RivOut;					// Summe des Wassers welches das RiverBasin �ber den Fluss verl��t (Flussabfluss)
+	double RivBasDayIn;				// Summe des Wassers was am jeweiligen Tag ins RiverBasin gelangt (Drainage, RunOff)
+	double RivDayOut;				// Summe des Wassers welches am jeweiligen Tag das RiverBasin �ber den Fluss verl��t (Flussabfluss)
+	double RivMonthOut;				// Summe des Wassers welches im jeweiligen Monat das RiverBasin �ber den Fluss verl��t (Flussabfluss)
+	double WCCache;					// Speicherabbild des Wassers in den Kaskaden Speichern
+	double RivBasSink;				// Summe allen Wasser das �ber dem Rechenzeitraum im RivBas in Senken verschwindet (gel�scht wird)
+	double RivBasDayWithd;			// Summe allen Wassers, dass dem RivBasin pro Tag entnommen wird oder �ber Entnahmefaktor verloren geht
+	double RivBasConMonth;			// Summe der auftretenden Fl�chenentnahmen innerhalb des gesamten Flusseinzugsgebietes pro Monat
+	double resRivBasConMonth;		// Summe der tats�chlichen durchgef�hrten Fl�chenentnahmen innerhalb des gesamten Flusseinzugsgebietes pro Monat
+	double remRivBasConMonth;		// Summe der Entnahmen die dem RivBasin nicht entnommen werden konnten (weil resFlow kleiner als m_pCon) pro Monat
+	double manWithd;				// Wasser das durch Rasterzellen Manipulation aus dem RivBasinSystem entfernt oder hinzugef�gt wurde
+
+	double ***kArray;				
+	double ***nCArray;				//Array von n-ChannelFlow-Speichern je (x,y) Koordinate
+	double ***lsMArray;
+	double ***pArray;
+
+/// Functions
+	void Calc_MainFlow(int x, int y);	
+
+	double Calc_GFlow(int x, int y, double f);
+	double Calc_CFlow(int x, int y, double f, int n);
+	double Calc_BFlow(int x, int y, double f);
+	double CalcRet(double f, int n);
+	
+	bool SubBasinId(int x, int y);								//Funktion gibt aus dem m_pSumRunoffDrainage-Raster die Summe der RunOff und Drainage Werte aller Rasterzellen des Teileinzugsgebiets der Flussrasterzelle (x,y)   
+	bool WConsRiv(int i);
+	void TestR1Share(int HGx, int HGy);
+
+	void InitKArray();
+	void InitNcArray(int p1, int p2, int p3);			//Array von n-Speichern je (x,y) Koordinate 
+	void InitPArray(int p1, int p2, int p3);
+
+	void CreateKArray(int p1, int p2, int p3);
+	void CreateLSMArray(int p1, int p2, int p3);
+	void CreateNcArray(int p1, int p2, int p3);
+	void CreatePArray(int p1, int p2, int p3);
+
+	void DeleteKArray();
+	void DeleteLSMArray();
+	void DeleteNcArray();
+	void DeletePArray();
+
+	double ReadNCacheFile(bool p0, string s1, int p1, int p2, int p3, int p4, int p5, char p6, int p7, bool p8);
+	double ReadLSMCacheFile(bool p0, string s1, int p1, int p2, int p3, int p4, int p5, char p6, int p7, bool p8);
+//	double ReadDNCacheFile(bool p0, string s1, int p1, int p2, int p3, int p4, int p5, char p6, int p7, bool p8);
+
+	bool SaveNcCache(int n);
+	bool SaveParameters();
+
+	bool WriteLog(string s);
+	bool TestLog1(string s);
+	bool TestLog2(string s);
+	bool TestLog3(string s);
+	bool TestLog4(string s);
+	bool WriteOutput(string s, double p1, double p2, int x, int y);
+	bool WriteRivBalance(int i1, int i2, double p1, double p2);
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__LandFlow_H
\ No newline at end of file
diff --git a/src/modules/io/io_grid_image/MLB_Interface.cpp b/src/modules/simulation/sim_rivflow/MLB_Interface.cpp
similarity index 65%
copy from src/modules/io/io_grid_image/MLB_Interface.cpp
copy to src/modules/simulation/sim_rivflow/MLB_Interface.cpp
index 4ccb281..2e604a0 100644
--- a/src/modules/io/io_grid_image/MLB_Interface.cpp
+++ b/src/modules/simulation/sim_rivflow/MLB_Interface.cpp
@@ -1,132 +1,134 @@
-/**********************************************************
- * Version $Id: MLB_Interface.cpp 2281 2014-10-09 15:49:41Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                       image_io                        //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   MLB_Interface.cpp                   //
-//                                                       //
-//                 Copyright (C) 2005 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    SAGA User Group Association            //
-//                Institute of Geography                 //
-//                University of Goettingen               //
-//                Goldschmidtstr. 5                      //
-//                37077 Goettingen                       //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//			The Module Link Library Interface			 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-// 1. Include the appropriate SAGA-API header...
-
-#include "MLB_Interface.h"
-
-
-//---------------------------------------------------------
-// 2. Place general module library informations here...
-
-CSG_String Get_Info(int i)
-{
-	switch( i )
-	{
-	case MLB_INFO_Name:	default:
-		return( _TL("Images") );
-
-	case MLB_INFO_Category:
-		return( _TL("Import/Export") );
-
-	case MLB_INFO_Author:
-		return( SG_T("O. Conrad (c) 2005") );
-
-	case MLB_INFO_Description:
-		return( _TL("Image Import/Export.") );
-
-	case MLB_INFO_Version:
-		return( SG_T("1.0") );
-
-	case MLB_INFO_Menu_Path:
-		return( _TL("File|Grid") );
-	}
-}
-
-
-//---------------------------------------------------------
-// 3. Include the headers of your modules here...
-
-#include "grid_export.h"
-#include "grid_import.h"
-#include "grid_to_kml.h"
-
-
-//---------------------------------------------------------
-// 4. Allow your modules to be created here...
-
-CSG_Module *		Create_Module(int i)
-{
-	switch( i )
-	{
-	case 0:	return( new CGrid_Export );
-	case 1:	return( new CGrid_Import );
-	case 2:	return( new CGrid_to_KML );
-	}
-
-	return( NULL );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-//{{AFX_SAGA
-
-	MLB_INTERFACE
-
-//}}AFX_SAGA
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   MLB_Interface.cpp                   //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//			The Module Link Library Interface			 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+
+//---------------------------------------------------------
+//#########################################################
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// 1. Include the appropriate SAGA-API header...
+
+#include <saga_api/saga_api.h>
+
+
+//---------------------------------------------------------
+// 2. Place general module library informations here...
+
+CSG_String Get_Info(int i)
+{
+	switch( i )
+	{
+	default:
+	case MLB_INFO_Name:			return( _TL("RivFlow") );
+	case MLB_INFO_Category:		return( _TL("Simulation") );
+	case MLB_INFO_Author:		return( "Christian Alwardt" );
+	case MLB_INFO_Description:	return( _TL("RivFlow.") );
+	case MLB_INFO_Version:		return( "3.1" );
+	case MLB_INFO_Menu_Path:	return( _TL("Simulation|Hydrology|RivFlow") );
+	}
+}
+
+
+//---------------------------------------------------------
+// 3. Include the headers of your modules here...
+
+#include "RivBasin.h"
+#include "LandFlow.h"
+#include "RivCourseImpr.h"
+#include "RivGridPrep.h"
+#include "GridComb.h"
+
+//---------------------------------------------------------
+// 4. Allow your modules to be created here...
+
+CSG_Module *		Create_Module(int i)
+{
+	// Don't forget to continuously enumerate the case switches
+	// when adding new modules! Also bear in mind that the
+	// enumeration always has to start with [case 0:] and
+	// that [default:] must return NULL!...
+
+	switch( i )
+	{
+	case 0:	return( new CRivBasin );
+	case 1: return( new CLandFlow );
+	case 2: return( new CRivCourseImpr );
+	case 3: return( new CRivGridPrep );
+	case 4: return( new CGridComb );
+	}
+
+	return( NULL );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+//{{AFX_SAGA
+
+	MLB_INTERFACE
+
+//}}AFX_SAGA
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/simulation/sim_rivflow/MLB_Interface.h
similarity index 73%
copy from src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
copy to src/modules/simulation/sim_rivflow/MLB_Interface.h
index ea810a2..453054e 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/simulation/sim_rivflow/MLB_Interface.h
@@ -1,98 +1,84 @@
 /**********************************************************
- * Version $Id: pc_from_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: MLB_Interface.cpp 911 2011-11-11 11:11:11Z oconrad $
  *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   pointcloud_tools                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   pc_from_shapes.h                    //
-//                                                       //
-//                 Copyright (C) 2009 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__PC_From_Shapes_H
-#define HEADER_INCLUDED__PC_From_Shapes_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPC_From_Shapes : public CSG_Module
-{
-public:
-	CPC_From_Shapes(void);
-
-	virtual CSG_String			Get_MenuPath	(void)	{	return( _TL("R:Conversion") );	}
-
-
-protected:
-
-	virtual bool				On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__PC_From_Shapes_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    MLB_Interface.h                    //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__Template_MLB_Interface_H
+#define HEADER_INCLUDED__Template_MLB_Interface_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+#ifdef Template_EXPORTS
+	#define	Template_EXPORT	_SAGA_DLL_EXPORT
+#else
+	#define	Template_EXPORT	_SAGA_DLL_IMPORT
+#endif
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__Template_MLB_Interface_H
diff --git a/src/modules/simulation/sim_rivflow/Makefile.am b/src/modules/simulation/sim_rivflow/Makefile.am
new file mode 100644
index 0000000..69a0d26
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/Makefile.am
@@ -0,0 +1,32 @@
+#
+# $Id: Makefile.am 1537 2012-11-19 20:05:19Z reklov_w $
+#
+if DEBUG
+DBGFLAGS = -g -DDEBUG
+endif
+if SAGA_UNICODE
+UC_DEFS = -D_SAGA_UNICODE
+endif
+DEF_SAGA           = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+CXX_INCS           = -I$(top_srcdir)/src/saga_core
+AM_CXXFLAGS        = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS         = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_rivflow.la
+libsim_rivflow_la_SOURCES =\
+DataTrans.cpp\
+GridComb.cpp\
+LandFlow.cpp\
+MLB_Interface.cpp\
+RivBasin.cpp\
+RivCourseImpr.cpp\
+RivGridPrep.cpp\
+DataTrans.h\
+GridComb.h\
+LandFlow.h\
+MLB_Interface.h\
+RivBasin.h\
+RivCourseImpr.h\
+RivGridPrep.h
+
+libsim_rivflow_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+
diff --git a/src/modules/pointcloud/pointcloud_tools/Makefile.in b/src/modules/simulation/sim_rivflow/Makefile.in
similarity index 87%
copy from src/modules/pointcloud/pointcloud_tools/Makefile.in
copy to src/modules/simulation/sim_rivflow/Makefile.in
index ccdb7cb..d8cdd86 100644
--- a/src/modules/pointcloud/pointcloud_tools/Makefile.in
+++ b/src/modules/simulation/sim_rivflow/Makefile.in
@@ -78,7 +78,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = src/modules/pointcloud/pointcloud_tools
+subdir = src/modules/simulation/sim_rivflow
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -125,14 +125,11 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
-libpointcloud_tools_la_DEPENDENCIES =  \
+libsim_rivflow_la_DEPENDENCIES =  \
 	$(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
-am_libpointcloud_tools_la_OBJECTS = MLB_Interface.lo \
-	pc_attribute_calculator.lo pc_cluster_analysis.lo pc_cut.lo \
-	pc_drop_attribute.lo pc_from_grid.lo pc_from_shapes.lo \
-	pc_merge.lo pc_reclass_extract.lo pc_thinning_simple.lo \
-	pc_to_grid.lo pc_to_shapes.lo pc_transform.lo
-libpointcloud_tools_la_OBJECTS = $(am_libpointcloud_tools_la_OBJECTS)
+am_libsim_rivflow_la_OBJECTS = DataTrans.lo GridComb.lo LandFlow.lo \
+	MLB_Interface.lo RivBasin.lo RivCourseImpr.lo RivGridPrep.lo
+libsim_rivflow_la_OBJECTS = $(am_libsim_rivflow_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -189,8 +186,8 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libpointcloud_tools_la_SOURCES)
-DIST_SOURCES = $(libpointcloud_tools_la_SOURCES)
+SOURCES = $(libsim_rivflow_la_SOURCES)
+DIST_SOURCES = $(libsim_rivflow_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -363,46 +360,34 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+
+#
+# $Id: Makefile.am 1537 2012-11-19 20:05:19Z reklov_w $
+#
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
- at SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS)
- at SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS)
- at SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs`
- at SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs`
 @SAGA_UNICODE_TRUE at UC_DEFS = -D_SAGA_UNICODE
 DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
 CXX_INCS = -I$(top_srcdir)/src/saga_core
-AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
-AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG)
-pkglib_LTLIBRARIES = libpointcloud_tools.la
-libpointcloud_tools_la_SOURCES = \
+AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS)
+AM_LDFLAGS = -fPIC -shared -avoid-version
+pkglib_LTLIBRARIES = libsim_rivflow.la
+libsim_rivflow_la_SOURCES = \
+DataTrans.cpp\
+GridComb.cpp\
+LandFlow.cpp\
 MLB_Interface.cpp\
-pc_attribute_calculator.cpp\
-pc_cluster_analysis.cpp\
-pc_cut.cpp\
-pc_drop_attribute.cpp\
-pc_from_grid.cpp\
-pc_from_shapes.cpp\
-pc_merge.cpp\
-pc_reclass_extract.cpp\
-pc_thinning_simple.cpp\
-pc_to_grid.cpp\
-pc_to_shapes.cpp\
-pc_transform.cpp\
+RivBasin.cpp\
+RivCourseImpr.cpp\
+RivGridPrep.cpp\
+DataTrans.h\
+GridComb.h\
+LandFlow.h\
 MLB_Interface.h\
-pc_attribute_calculator.h\
-pc_cluster_analysis.h\
-pc_cut.h\
-pc_drop_attribute.h\
-pc_from_grid.h\
-pc_from_shapes.h\
-pc_merge.h\
-pc_reclass_extract.h\
-pc_thinning_simple.h\
-pc_to_grid.h\
-pc_to_shapes.h\
-pc_transform.h
-
-libpointcloud_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
+RivBasin.h\
+RivCourseImpr.h\
+RivGridPrep.h
+
+libsim_rivflow_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la
 all: all-am
 
 .SUFFIXES:
@@ -416,9 +401,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_tools/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/modules/simulation/sim_rivflow/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/modules/pointcloud/pointcloud_tools/Makefile
+	  $(AUTOMAKE) --foreign src/modules/simulation/sim_rivflow/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -473,8 +458,8 @@ clean-pkglibLTLIBRARIES:
 	  rm -f $${locs}; \
 	}
 
-libpointcloud_tools.la: $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_DEPENDENCIES) $(EXTRA_libpointcloud_tools_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_LIBADD) $(LIBS)
+libsim_rivflow.la: $(libsim_rivflow_la_OBJECTS) $(libsim_rivflow_la_DEPENDENCIES) $(EXTRA_libsim_rivflow_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libsim_rivflow_la_OBJECTS) $(libsim_rivflow_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -482,19 +467,13 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/DataTrans.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GridComb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LandFlow.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MLB_Interface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_attribute_calculator.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_cluster_analysis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_cut.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_drop_attribute.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_from_grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_from_shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_merge.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_reclass_extract.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_thinning_simple.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_to_grid.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_to_shapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc_transform.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RivBasin.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RivCourseImpr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/RivGridPrep.Plo at am__quote@
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
diff --git a/src/modules/simulation/sim_rivflow/RivBasin.cpp b/src/modules/simulation/sim_rivflow/RivBasin.cpp
new file mode 100644
index 0000000..38e70c4
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/RivBasin.cpp
@@ -0,0 +1,594 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     RivBasin.cpp                      //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "RivBasin.h"
+#include <math.h>
+#include <sstream>
+#include <fstream>
+
+//ACHTUNG
+//////////////////////////////////////////////////////////////////////
+//Das Schreiben von  Koordinaten als Gridboxwert ist zur			//
+//Zeit auf VIER Stellen beschraenkt -> DoubleFormat == [XXXXYYYY]	//
+//Bei der Programmierung beruecksichtigen!!!							//
+//																	//
+//////////////////////////////////////////////////////////////////////
+
+
+//---------------------------------------------------------
+//#########################################################
+
+CRivBasin::CRivBasin(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("RiverBasin");
+	Set_Author		("Christian Alwardt");
+	Set_Description	("Parameters of RiverBasin");
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "INPUT"	, "DTM",
+		"Digitales Gelaendemodell des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "INPUT2"	, "HGGrid",
+		"Eingaberaster der Hauptgerinnerasterzellen des Flussnetzwerkes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "INPUT3"	, "statisches Entnahmeraster",
+		"Eingaberaster mit Angaben zur statischen Flaechenwasserentnahme.",
+		PARAMETER_INPUT_OPTIONAL
+		//Jahreswerte 	//ACHTUNG auf optionale Eingabe gesetzt -> 'Sicherheits-'Abfrage einbauen
+	);
+
+	Parameters.Add_Value(
+		NULL, "WCons", "Anteilige Flaechenwasserentnahme",
+		"Wenn gesetzt, werden die Werte des statischen Entahmerasters anteilig entnommen und als Raster statWUse ausgegeben",		PARAMETER_TYPE_Bool, false
+	); 
+
+	Parameters.Add_Choice(
+		Parameters("WTHD_NODE")	, "WCons2"	, _TL("Dynamische Flaechenwassernutzung..."),
+		_TL("Auswahl der Art der anteiligen Flaechenwasserwasserentnahme."),
+		CSG_String::Format(SG_T("%s|%s"),
+			_TL("...anteilig aus den Flussrasterzellen"),
+			_TL("...anteilig aus Rasterzellen der Teileinzugegebiete")
+		), 0
+	);
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT2"	, "Grad",
+		"Ausgabe der Abflussgradienten jeder Rasterzelle",
+		PARAMETER_OUTPUT
+	); // Gradient in Abflussrichtung
+
+		Parameters.Add_Grid(
+		NULL, "OUTPUT3"	, "Direc",
+		"Ausgabe der Abflussrichtung fuer jede Rasterzelle",
+		PARAMETER_OUTPUT
+	); // Flussrichtung 0-7		// 7|0 |1
+								// 6|-1|2
+								// 5|4 |3
+	Parameters.Add_Grid(
+		NULL, "OUTPUT4"	, "HGGrad",
+		"Ausgabe der Abflussgradienten jeder Hauptgerinnerasterzelle",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT5"	, "RivSpeed",
+		"Ausgabe Flussgeschwindigkeiten der Hauptgerinnerasterzellen (siehe Parametereinstellungen)",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT6"	, "Coordinates",
+		"Ausgabe der Koordinatenwerte der Rasterzellen im Format xxxx.yyyy",
+		PARAMETER_OUTPUT
+	); // Konvention des Rasterzahlenwertes: xxxx.yyyy [x,y-Koordinate]
+
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT7"	, "BasinShare",
+		"Ausagbe der Rasterzellen des Flusseinzugsgebiets",
+		PARAMETER_OUTPUT
+	); // Grids die in Fluss mueden [>0 = Flussgridkoordinate] , Flussgrids [=0] , keine Flussgrid [-1]
+	
+	Parameters.Add_Grid(
+		NULL, "OUTPUT8"	, "statWUse",
+		"Ausagbe der anteiligen Flaechenwasserentnahme je Rasterzelle",
+		PARAMETER_OUTPUT_OPTIONAL
+	); // Flussgrids [>=0] , keine Flussgrid [-1]
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT9"	, "NumInFlowCells",
+		"Ausgaberaster mit Angabe ueber die Anzahl der Rasterzellen, die in eine spezifische Rasterzelle (x,y) abflieszen",
+		PARAMETER_OUTPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "pCr"	, "Hauptgerinne-Parameter pHG",
+		"Parameter pHG zur Berechnung der Lagtime kHG des Hauptgerinneabflusses",
+		PARAMETER_TYPE_Double, 0.0035, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "nCr"	, "Hauptgerinne-Speicherkaskade nHG",
+		"Festlegen, wieviele Speicher die ChannelFlow River-Speicherkaskade enthaelt",
+		PARAMETER_TYPE_Int, 1, 1, true		
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "EnfVmax", "Maximal Geschwindigkeit des Hauptgerinnes beruecksichtigen",
+		"Angegebene Maximalgeschwindigkeit im Hauptgerinne bei der Berechnung der durchschnittlichen Flieszgeschwindigkeit des Hauptgerinnes beruecksichtigen.",
+		PARAMETER_TYPE_Bool, true
+	);
+
+	Parameters.Add_Value(
+		Parameters("FLOW_NODE"), "VTresh" , "Maximalgeschwindigkeit im Hauptgerinne in km/h",
+		"Festlegung der maximalen Wasserflussgeschwindigkeit im Hauptgerinne in km/h (oberer Grenzwert)",
+		PARAMETER_TYPE_Double, 4, 0, true, 10, true		//Achtung!! Obergrenze statisch eingestellt
+	);
+
+
+}
+
+
+//---------------------------------------------------------
+//#########################################################
+bool CRivBasin::On_Execute(void)
+{
+	int x, y;
+	BasinGrids = 0;
+	statV = 0;
+	statN = 0;
+
+	//-----------------------------------------------------
+	// Get the parameter settings...
+
+	m_pDTM = Parameters("INPUT")->asGrid();
+	m_pRivGrids = Parameters("INPUT2")->asGrid();
+	m_pWCons = Parameters("INPUT3")->asGrid(); //statisches WaterConsumption Grid (Jahreswerte) in [kg m-2 s-1]
+	m_pGrad = Parameters("OUTPUT2")->asGrid();
+	m_pDirec = Parameters("OUTPUT3")->asGrid();
+	m_pRivGrad = Parameters("OUTPUT4")->asGrid(); //Gibt Grid aus, welches nur die Werte des Flussgefaelles enhaelt -> damit spaeter auschlieszliche Berechnug des max Flussgefaelles moeglich 
+	m_pRSpeed = Parameters("OUTPUT5")->asGrid();
+	m_pRaster = Parameters("OUTPUT6")->asGrid();
+	m_pBasinShare = Parameters("OUTPUT7")->asGrid();
+	m_pSharedRivCons = Parameters("OUTPUT8")->asGrid();
+	m_pNumInFlowCells = Parameters("OUTPUT9")->asGrid();
+	pCr = Parameters("pCr")->asDouble();
+	nCr = Parameters("nCr")->asInt();
+	m_pVTresh = Parameters("VTresh")->asDouble(); // [km/h]
+
+	//-----------------------------------------------------
+	// Do something...
+	
+	m_pGrad->Assign(0.0);
+	m_pDirec->Assign(-1.0);
+	m_pRivGrad->Assign(0.0);
+	m_pRSpeed->Assign(0.0);
+	m_pNumInFlowCells->Assign(0.0);
+	m_pBasinShare->Assign(-1.0); // Vorab Werte -1 (kein Flussbasin); Wenn Grid in Fluss muendet > 0 (entspricht Koordinate) oder =0 wenn Flussgrid (>=0 entspricht Flussbasin)
+	
+	if(m_pSharedRivCons)
+		m_pSharedRivCons->Assign(0.0);
+
+	for(x=0; x < m_pDTM->Get_NX(); x++)
+	{
+		for(y=0; y < m_pDTM->Get_NY(); y++)
+		{
+			double r = x + 0.0001*y;				// Konvention des Rasterzahlenwertes: xxxx.yyyy [x,y-Koordinate]
+			m_pRaster->Set_Value(x, y, r);
+			
+			if(m_pDTM->is_NoData(x,y))
+			{
+					m_pGrad->Set_NoData(x,y);
+					m_pDirec->Set_NoData(x,y);
+					m_pRivGrad->Set_NoData(x,y);
+			}
+			else
+				Set_RivParam(x,y);
+		}
+	}
+
+	//Durchnittsgeschwindigkeit in Log-Datei schreiben
+	double res = statV / statN;
+	std::stringstream lStr0;
+	std::string lStr;
+	lStr0.str("");
+	lStr0 << "Durschnittsgeschwindigkeit fuer pHG = " << pCr << ": " << res;
+	lStr = lStr0.str();
+
+	WriteLog(lStr);
+	//------------------------------------------------
+
+
+	if(!CRivBasin::Set_BasinShare()) //SetBasin Aufruf
+		Message_Dlg("Achtung, Fehler beim Erzeugen der Flussabhaengigen-Anteile wegen nicht gesezter FlussGrids");
+
+	if( !m_pRivGrids )
+	{
+		m_pRivGrad->Destroy();
+		m_pRSpeed->Destroy();
+		m_pNumInFlowCells->Destroy();
+		m_pBasinShare->Destroy();
+	}
+
+	if( (!m_pWCons || !m_pRivGrids) && m_pSharedRivCons)
+		m_pSharedRivCons->Destroy();
+
+
+	//-----------------------------------------------------
+	// Return 'true' if everything is okay...
+
+		return( true );
+}
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+
+void CRivBasin::Set_RivParam(int x, int y)
+{
+	int i, ix, iy;
+	double z, dzMax, l;
+
+
+	z = m_pDTM->asDouble(x,y);
+	
+	dzMax = 0.0;
+
+	i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+	
+	if( i >=0)
+	{
+		ix = Get_xTo(i, x); //x-Wert niedrigste Nachbarzelle
+		iy = Get_yTo(i, y); //y-Wert niedrigste Nachbarzelle
+		
+		l = Get_Length(i);	//Weg Mittelpunkt Gitterbox (x,y) nach Gitterboxmitte (ix,iy)
+	
+		dzMax = (z - m_pDTM->asDouble(ix, iy)) / l; //Steigung dz/l entspricht tan(Steigungswinkel) ->Gefaelle in Abflussrichtung
+
+	}
+	else // Senke!!
+		dzMax = 0;
+
+	
+	
+	if( m_pRivGrids && m_pRivGrids->asDouble(x,y) != 0) // Wenn bei (x,y) Flussgrid vorliegt...
+	{
+		double vMax2 =  pow(dzMax, 0.1 ) / pCr / nCr / 24;
+
+		//--- Werte zur Berechnung der Durchschnittsgeschwindigkeit im HG erfasse
+		if(Parameters("EnfVmax")->asInt() && vMax2 > m_pVTresh)
+			statV = statV + m_pVTresh;	//Falls vMax2 groeszer als Geschwindigkeitsgrenze m_pVTresh, auf m_pVTresh setzten
+		else
+			statV = statV + vMax2;
+		
+		statN = statN + 1;
+		//-------------------------
+
+
+		m_pRivGrad->Set_Value( x, y, dzMax );	//Flussbezogene Grids: Flussgefaelle; (x,y) nach (ix,iy) -> Extra RivGrad-Grid das nur die Gradienten der Fluss-Rasterzellen enthaelt, damit in LandFlow einfach der MaximalGradient bzw. kmin der Fluss-Rasterzellen bestimmt werden kann  ???
+		m_pRSpeed->Set_Value(x, y, vMax2);		//Flussbezogene Grids: Flieszgeschwindigkeit der Flussgrids (lt. vorgegebenen pCr und nCr); (x,y) nach (ix,iy)
+		m_pGrad->Set_Value( x, y, dzMax);		//Allgemeine Grids: Flussgefaellewert wird auch in der allgemeinen Gefaelledatei gesetzt; (x,y) nach (ix,iy)
+		m_pDirec->Set_Value( x, y, i);			//Allgemeine Grids: Flieszrichtung Gitterbox; (x,y) nach (ix,iy)
+	}
+	else
+	{
+		m_pGrad->Set_Value( x, y, dzMax);		//Allgemeine Grids: Flussgefaellewert wird gesetzt; (x,y) nach (ix,iy)
+		m_pDirec->Set_Value( x, y, i);			//Allgemeine Grids: Flieszrichtung Gitterbox; (x,y) nach (ix,iy)
+	}
+}
+
+
+//---------------------------------------------------------
+//#########################################################
+
+
+bool CRivBasin::Set_BasinShare(void) //Fuer alle Werte innerhalb des RiverBasin gilt: Riverbox: Wert==0, Zuflussbox: Wert==>>Riverbox-Koordinate [xxxxyyyy] || alle Boxen Ausserhalb RiverBasin: Wert==-1
+{
+	if(m_pRivGrids)
+	{
+		m_pNumInFlowCells->Assign(0.0);
+
+		int NX = m_pDTM->Get_NX();	//Anzahl der Reihen x
+		int NY = m_pDTM->Get_NY();	//Anzahl der Zeilen y
+		double CellNum0 = 0;
+		double CellNum = 0;
+
+		int x, y;
+		int i = -1;
+
+
+		
+		//Gesamt-Flusseinzugsgebiet und einzelne Flussrasterzelleneinzuggebiete bestimmen und jeweilige Koordinate der Ziel-Flussrasterzelle setzten
+		//---------------------------------------------------------
+
+		for(int l=0; l < m_pDTM->Get_NCells() && Set_Progress_NCells(l); l++) //ueber alle Zellen des m_pDEM-Grids
+		{
+			m_pDTM->Get_Sorted(l, x, y); //sortieren der Zellen von hoechster (l=0) nach niedrigster...
+			
+			CellNum = 1; //Initialisierung der Zaehlung "vorherigerNachbarzellen" fuer erste Nachbarzelle (falls folgende if-Bedingung nicht erfuellt -> "gegenstandlos")
+			CellNum0 = 0;
+
+			//Erster Durchlauf: Zu "Gipfelzelle l" wird anhand des Abflusses die Muendungszelle im Flussgrid bestimmt (entspricht dem (x,y) fuer das gilt: m_pRivGrids->asDouble(x,y) != 0 )... 
+			if(m_pNumInFlowCells->asDouble(x,y) == 0 && !m_pDTM->is_NoData(x,y)) //starten nur wenn Gipfelzelle (enstspricht: m_pNumInputCells->asDouble(x,y) == 0); falls != gab es schon eine Zelle die hoeher war u damit wurde der Zweig schon abgegangen 
+			{
+				while( !m_pDTM->is_NoData(x,y) && m_pRivGrids->asDouble(x,y) == 0 )
+				{
+
+					i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+					
+					if(i >= 0) //es gibt eine niedrigere Nachbarzelle...
+					{
+											
+						x = Get_xTo(i, x);
+						y = Get_yTo(i, y);
+						
+						if(m_pNumInFlowCells->asDouble(x,y) <= 0) //Wenn Null -> erstes Durchlaufen dieses Astes -> immer plus 1 fuer Naechstebarchbarzelle
+						{
+							CellNum0 = CellNum;
+							CellNum = CellNum + 1;
+						}
+						else //Ast wurde vorher schon durchlaufen -> vorherige DurchlaufWerte plus die statische Anzahl der Zellen (CellNum) des noch nicht durchlaufenden Astabschnittes 
+							CellNum0 = m_pNumInFlowCells->asDouble(x,y) + CellNum;
+												
+						m_pNumInFlowCells->Set_Value(x, y, CellNum0); //Anzahl voheriger Zellen im Abflusverlauf werden gesetzt... vorher bereits Durchlaufene "aeste" sind beruecksichtigt
+
+					}
+					else		//Senke liegt vor
+					{
+						CellNum0 = m_pNumInFlowCells->asDouble(x,y) * -1;
+						m_pNumInFlowCells->Set_Value(x, y, CellNum0);
+						break;
+					}
+
+				}
+
+				// Bei Zelle (x,y) handelt es sich nun um eine Flussrasterzelle oder eine Senke...
+				
+				if(m_pRivGrids->asDouble(x,y) != 0) //Wenn es eine Flussrasterzelle (also Muendungszelle) ist, Wert fuer alle alle Flaechenrasterzellen setzen, die in die Flussrasterzelle (x,y) muenden
+				{
+					
+					m_pBasinShare->Set_Value(x, y, 0); //Muendungsrasterzelle wird auf Null gesetzt
+									
+					//KoordinatenDouble erzeugen FORMAT: xxxxyyyy
+					double r = 0;
+					int u = 10000*x + y;
+					//
+										
+					r = u; //Wert der gesetzt wird : FORMAT: xxxxyyyy (Koordinate der "Ziel"Flussgridbox in die voherige Gitterboxen muenden)
+					
+					m_pDTM->Get_Sorted(l, x, y); //selber Durchlauf nochmal;  von der l-ten Gridbox bis Ziel-Flussfgridbox
+					
+					//Zweiter Durchlauf: Wiederum bei "Gipfelzelle l" beginnend wird nun fuer alle Gitterzellen auf dem Weg zur Muendungszelle der KoordinatenWert r gesetzt
+					while( !m_pDTM->is_NoData(x,y) && m_pRivGrids->asDouble(x,y) == 0 )
+					{
+						i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+
+						if(i >= 0)
+						{
+							m_pBasinShare->Set_Value(x, y, r); //Koordinaten der Ziel-Flussgridbox werden gesetzt
+
+							x = Get_xTo(i, x);
+							y = Get_yTo(i, y);						
+						}
+						else
+							{break;} //Nur fuer den Fall; i = -1 sollte eigentlich nicht mehr moeglich sein, da letzte Gridbox ja Flussgridbox...
+					}
+				}
+				else
+					{}
+			}
+
+
+			if(m_pDTM->is_NoData(x,y))
+			{
+				m_pNumInFlowCells->Set_NoData(x,y);
+				m_pBasinShare->Set_NoData(x,y);
+			}
+		}
+		//---------------------------------------------------------
+		//#########################################################
+
+
+
+		//-----------------------------------------------------
+		// Anzahl der Gridboxes des Einzugsgebietes zaehlen:
+		for(x=0; x < NX; x++)
+		{
+			for(y=0; y < NY; y++)
+			{
+				if(!m_pDTM->is_NoData(x,y) && m_pBasinShare->asDouble(x,y) != -1)
+					BasinGrids++;
+			}
+		}
+		
+
+		//-----------------------------------------------------
+		//Absolute Entnahmen in den Flussrasterzellen-Einzugsgebieten (Teileinzugsgebiet) berechnen und dort anteilig entnehmen
+
+		if(Parameters("WCons")->asBool() && m_pWCons && m_pSharedRivCons)
+		{
+			for(x=0; x < NX; x++)
+			{
+				for(y=0; y < NY; y++)
+				{
+					if(!m_pDTM->is_NoData(x,y) && m_pRivGrids->asDouble(x,y) > 0 ) 
+					{
+						// Wenn Flussrasterzelle...
+						int sx = 0;
+						int sy = 0;
+						double sum = 0;			//Summe der Rasterzellen des Teileinzuggebiets (ohne Flussrasterzelle)
+						int u;
+						double r = 0;
+						double conSum = 0;		//Summe der Verbrauchswerte des Teileinzugsgebiets
+						double conShare = 0;	//Berechnen der anteiligen Entnahme der Flussrasterzelle / Rasterzellen
+						double cellShare = 0;	//Summe aller InFlowCell-Werte des Teileinzuggebiets
+						double testSum = 0;
+					
+						conSum = m_pWCons->asDouble(x, y); //Summe der Verbrauchswerte des Teileinzugsgebiets (hier Flussrasterzelle)
+						cellShare = m_pNumInFlowCells->asDouble(x, y); //Summe aller InFlowCell-Werte des Teileinzuggebiets (hier Flussrasterzelle)
+
+						//KoordinatenDouble der derzeitigen Flussrasterzelle erzeugen - FORMAT: xxxxyyyy
+						u = 10000*x + y;
+						r = u;
+
+						//alle Rasterzellen finden die in die Flussrasterzelle muenden
+						for(int sx=0; sx < NX; sx++)
+						{
+							//#pragma omp parallel for //TEST hier nicht anwendbar
+							for(int sy=0; sy < NY; sy++)
+							{
+								//Wasserverbrauchswerte alle Rasterzellen die in Flussrasterzelle (x,y) muenden addieren...
+								if(!m_pDTM->is_NoData(sx,sy) && m_pRivGrids->asDouble(sx,sy) == 0 && m_pBasinShare->asDouble(sx,sy) == r )
+								{
+									if( m_pWCons)
+										conSum = conSum + m_pWCons->asDouble(sx,sy); //Summe der Verbrauchswerte des Teileinzugsgebiets (hier uebrige Rasterzellen)
+
+									sum = sum + 1; //Summe der Rasterzellen des Teileinzuggebiets (ohne Flussrasterzelle)
+
+									cellShare = cellShare + m_pNumInFlowCells->asDouble(sx, sy);	//Summe aller InFlowCell-Werte des Teileinzuggebiets (hier uebrige Rasterzellen)
+								}
+							}
+						}
+
+						if(cellShare > 0)
+						{
+							if(!Parameters("WCons2")->asBool())
+							//1) Gesammte Verbrauchssumme aus der jeweiligen Flussrasterzelle entnehmen
+								m_pSharedRivCons->Set_Value(x, y, conSum);
+							else
+							{
+								//2) Prozemtuale, anteilige Entnahme ueber das gesamte Teileinzugsgebiet
+												
+								conShare = ( m_pNumInFlowCells->asDouble(x, y) / cellShare ) * conSum;	//Berechnen der anteiligen Entnahme der Flussrasterzelle:
+																										//Summe aller InFlowCell-Werte des Teileinzugsgebiets geteilt durch NumInFlowCells der Flussrasterzelle (x,y) -> Anteilieg Entnahme in Prozent;
+																										//dann mit Gesamtennehame des Teileinzuggebiets conSum multiplizieren -> anteilige Entnahme
+							
+								m_pSharedRivCons->Set_Value(x, y, conShare);							//Setzen der anteiligen Entnahme der Flussrasterzelle 
+								testSum = testSum + conShare;											//PruefSumme
+
+								//Anteilige Entname aller anderen Rasterzellen des Teileinzuggebiets setzen, das in Flussrasterzelle (x,y) muenden
+								for(int sx=0; sx < NX; sx++)
+								{
+									//#pragma omp parallel for //TEST hier nicht anwendbar
+									for(int sy=0; sy < NY; sy++)
+									{
+										if(!m_pDTM->is_NoData(sx,sy) && m_pRivGrids->asDouble(sx,sy) == 0 && m_pBasinShare->asDouble(sx,sy) == r )
+										{
+											conShare = ( m_pNumInFlowCells->asDouble(sx, sy) / cellShare) * conSum;	//Berechnen der anteiligen Entnahme der Rasterzellen (Methode s. Flussrasterzelle oben)
+											m_pSharedRivCons->Set_Value(sx, sy, conShare);								//Setzen der anteiligen Entnahme der Flussrasterzelle 
+											testSum = testSum + conShare;												//PruefSumme		
+										}
+									}
+								}
+
+								//if( testSum != conSum ) //durch Rundungsdifferenzen kommt es bei dieser TestAbfrage zu unberechtigten Fehlermeldungen
+								//	Message_Dlg("Fehler! Gesamtentnahme aus Teileinzugsgebiet entspricht nicht der Summe der berechneten anteiligen Entnahmen");
+											
+							//m_pNumInputCells->Set_Value(x, y, sum); //NUR zu Testzwecken
+							//m_pBasinShare->Set_Value(x, y, sum/BasinGrids ); //Anzahl der Einzugsgebietszellen (anteilig) die in diese Flussgrid (x,y) fliessen
+							}
+						}
+						else
+							m_pSharedRivCons->Set_Value(x, y, conSum);
+					}
+				}
+			}
+		}
+		return (true);
+	}
+	else
+		return (false);
+}
+
+
+bool CRivBasin::WriteLog(string s)
+{
+	int i = 0;
+
+	std::stringstream path0;
+	std::string path;
+	path0.str("");
+	path0 << "e:" << "\\Log.txt";
+	path = path0.str();
+
+	ofstream myfile;
+	myfile.open(path.c_str(), ios_base::app);
+
+			myfile << s << "\n";
+			Process_Set_Text(CSG_String::Format(SG_T("Schreibe in Logdatei")));
+
+	myfile.close();
+
+return true;
+}
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.h b/src/modules/simulation/sim_rivflow/RivBasin.h
similarity index 64%
copy from src/modules/shapes/shapes_lines/line_split_with_lines.h
copy to src/modules/simulation/sim_rivflow/RivBasin.h
index c4229fc..b2facdb 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.h
+++ b/src/modules/simulation/sim_rivflow/RivBasin.h
@@ -1,108 +1,96 @@
-/**********************************************************
- * Version $Id: line_split_with_lines.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     shapes_lines                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                line_split_with_lines.h                //
-//                                                       //
-//                 Copyright (C) 2014 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__line_split_with_lines_H
-#define HEADER_INCLUDED__line_split_with_lines_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CLine_Split_with_Lines : public CSG_Module  
-{
-public:
-	CLine_Split_with_Lines(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	bool					Get_Intersection	(CSG_Shape *pLine, CSG_Shape_Part *pSplit);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__line_split_with_lines_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      RivBasin.h                       //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__RivBasin_H
+#define HEADER_INCLUDED__RivBasin_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+#include <string>
+using namespace std;
+//---------------------------------------------------------
+//#########################################################
+
+class CRivBasin : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CRivBasin(void);							// constructor
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute	(void);		// always overwrite this function
+
+
+private: ///// private members and functions: /////////////
+	CSG_Grid *m_pDTM, *m_pGrad, *m_pDirec, *m_pRivGrids, *m_pRivGrad, *m_pRaster, *m_pRSpeed, *m_pBasinShare, *m_pSharedRivCons, *m_pWCons, *m_pNumInFlowCells;
+	double pCr, BasinGrids,	statV, m_pVTresh;
+	int nCr, statN;
+	void Set_RivParam(int x, int y);
+	bool Set_BasinShare(void);
+	bool WriteLog(string s);
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__RivBasin_H
diff --git a/src/modules/simulation/sim_rivflow/RivCourseImpr.cpp b/src/modules/simulation/sim_rivflow/RivCourseImpr.cpp
new file mode 100644
index 0000000..24be480
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/RivCourseImpr.cpp
@@ -0,0 +1,192 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   RivCourseImpr.cpp                   //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "RivCourseImpr.h"
+#include <saga_api/module.h>
+
+
+//---------------------------------------------------------
+//#########################################################
+
+CRivCourseImpr::CRivCourseImpr(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("GridManipulation");
+	Set_Author		("Christian Alwardt");
+	Set_Description	("Improve RiverCourse by MouseClicks");
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "Input1"	, "Gel�ndemodell (DTM)",
+		"Digitales Gel�ndemodell des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Value(
+		NULL, "diffH"	, "H�hendifferenz",
+		"H�he in [m] um die der Wert der Zelle erniedrigt (positiver Wert) oder erh�ht (negativer Wert) wird. ",
+		PARAMETER_TYPE_Double, 1	
+	);
+
+	Parameters.Add_Value(
+		NULL, "true", "Zufluss aus Nachbarzellen erzwingen",
+		"Der Zufluss aus allen Nachbarzellen - ausgenommen die Zelle in die Wasser abflie�t - wird erzwungen. Hierbei wird die gew�hlte Zelle um obigen H�hendifferenzwert kleiner, als alle Nachbarzellen gesetzt.",
+		PARAMETER_TYPE_Bool, false
+	);
+	
+}
+
+
+bool CRivCourseImpr::On_Execute(void){
+	
+	
+	m_pDTM = Parameters("Input1")->asGrid(); 
+	m_pDiffH = Parameters("diffH")->asDouble();
+
+	return (true);
+
+}
+
+
+bool CRivCourseImpr::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode)
+{	
+	int iX, iY;		
+
+	//-----------------------------------------------------
+	if(	Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iX, iY) )
+	{
+		return( false );
+	}
+
+	double dValue = m_pDTM->asDouble(iX,iY); //Wert der ausgew�hlten Zelle
+
+	if( Parameters("true")->asBool() )
+	{
+		minVal = m_pDTM->asDouble(iX, iY); //minVal zun�chst auf Wert der ausgw�hlten Zelle gesetzt
+		int iN = m_pDTM->Get_Gradient_NeighborDir(iX, iY);//falls iN = -1 liegt Senke vor!!
+		nX = Get_xTo(iN, iX);//Koordinaten der niedrigsten Nachbarzelle (ist niedriger als ausgew�hlte Zelle)
+		nY = Get_yTo(iN, iY);
+		double vN = m_pDTM->asDouble(nX, nY); //Wert der niedrigsten Nachbarzelle (ist niedriger als ausgew�hlte Zelle)
+		double setVal;
+
+		if(iN >= 0)
+		{
+			for(int i = 0; i < 7; i ++)
+			{
+				if(i != iN)													
+					getNeighFlowGridValue(iX, iY, minVal);				
+			}
+		
+			if(minVal > vN)
+			{
+				setVal = minVal - m_pDiffH;
+
+				if(setVal <= vN  )
+					setVal = minVal + ((minVal - vN) * 0.9999);
+			}
+			else
+			{
+				Message_Dlg("Achtung, eine Senke wurde generiert!", SG_T("caption"));
+				setVal = minVal * 1.0001;
+			}
+
+			m_pDTM->Set_Value( iX, iY, setVal );
+		}
+		else
+			m_pDTM->Set_Value( iX, iY, minVal );
+	
+		DataObject_Update(m_pDTM, SG_UI_DATAOBJECT_UPDATE_ONLY);
+	}
+	else
+	{
+		m_pDTM->Set_Value( iX, iY, dValue - m_pDiffH );
+		DataObject_Update(m_pDTM, SG_UI_DATAOBJECT_UPDATE_ONLY);
+	}
+
+	return (true);
+
+}
+
+
+void CRivCourseImpr::getNeighFlowGridValue(int x, int y, double kVal)
+{
+	int i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+	int ix = Get_xTo(i, x);
+	int iy = Get_yTo(i, y);
+	
+	if(i >= 0)
+	{
+		if( ix == nX && iy == nY)
+		{}
+		else
+		{
+			if (m_pDTM->asDouble(ix, iy) <= kVal)
+				minVal = m_pDTM->asDouble(ix, iy);
+		}
+	}
+}
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h b/src/modules/simulation/sim_rivflow/RivCourseImpr.h
similarity index 67%
copy from src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
copy to src/modules/simulation/sim_rivflow/RivCourseImpr.h
index ea810a2..b452cbf 100644
--- a/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h
+++ b/src/modules/simulation/sim_rivflow/RivCourseImpr.h
@@ -1,98 +1,91 @@
-/**********************************************************
- * Version $Id: pc_from_shapes.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                   pointcloud_tools                    //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                   pc_from_shapes.h                    //
-//                                                       //
-//                 Copyright (C) 2009 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__PC_From_Shapes_H
-#define HEADER_INCLUDED__PC_From_Shapes_H
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CPC_From_Shapes : public CSG_Module
-{
-public:
-	CPC_From_Shapes(void);
-
-	virtual CSG_String			Get_MenuPath	(void)	{	return( _TL("R:Conversion") );	}
-
-
-protected:
-
-	virtual bool				On_Execute		(void);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__PC_From_Shapes_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                   RivCourseImpr.h                     //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__RivCourseImpr_H
+#define HEADER_INCLUDED__RivCourseImpr_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+//#########################################################
+
+class CRivCourseImpr : public CSG_Module_Grid_Interactive {
+
+public:
+	CRivCourseImpr(void);
+
+protected:
+	virtual bool On_Execute(void);
+	virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode);
+
+private:
+	CSG_Grid *m_pDTM;
+	double m_pDiffH, minVal;
+	int nX, nY;
+	void getNeighFlowGridValue(int x, int y, double minVal);
+
+
+};
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__RivCourseImpr_H
diff --git a/src/modules/simulation/sim_rivflow/RivGridPrep.cpp b/src/modules/simulation/sim_rivflow/RivGridPrep.cpp
new file mode 100644
index 0000000..d662454
--- /dev/null
+++ b/src/modules/simulation/sim_rivflow/RivGridPrep.cpp
@@ -0,0 +1,221 @@
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    RivGridPrep.cpp                    //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+#include "RivGridPrep.h"
+
+
+//---------------------------------------------------------
+//#########################################################
+
+CRivGridPrep::CRivGridPrep(void)
+{
+	//-----------------------------------------------------
+	// Modul information
+
+	Set_Name		("RiverGridGeneration");
+	Set_Author		("Christian Alwardt");
+	Set_Description	("Generation of RiverCourse-GridCells");
+
+	//-----------------------------------------------------
+	// Define your parameters list...
+
+	Parameters.Add_Grid(
+		NULL, "INPUT"	, "Gel�ndemodell (DTM)",
+		"Digitales Gel�ndemodell des Flusseinzugsgebietes",
+		PARAMETER_INPUT
+	);
+
+	Parameters.Add_Grid(
+		NULL, "OUTPUT"	, "HG Raster",
+		"Schrittweise Ausgabe der gew�nschten Abflusspfade des Hauprgerinnerasters",
+		PARAMETER_OUTPUT
+	); // Flussgrids [!=0] , keine Flussgrid [0]
+
+
+	Parameters.Add_Value(
+		NULL, "SX"	, "Abflusspfad-Quelle, x-Wert",
+		"X-Wert der Quellen-Rasterzelle",
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "SY"	, "Abflusspfad-Quelle, y-Wert",
+		"Y-Wert der Quellen-Rastertzelle",
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "MX"	, "Abflusspfad-M�ndung, x-Wert",
+		"X-Wert des M�ndungs-Rasterzelle",
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "MY"	, "Abflusspfad-M�ndung, y-Wert",
+		"Y-Wert des M�ndungsRasterzelle",
+		PARAMETER_TYPE_Int, 0, 0, true
+	);
+
+	Parameters.Add_Value(
+		NULL, "Owrite", "Overwrite RiverGridCells",
+		"Bereits existierende RiverGridCells werden �berschrieben (Wenn nicht gesetzt: Abflusspfadende, wenn eine existierende RiverGridCell erreicht wird -> zB bei Fluss mit zwei Quellen sinnvoll).",
+		PARAMETER_TYPE_Bool, false
+	);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//	Hauptfunktion										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+bool CRivGridPrep::On_Execute(void)
+{
+	//-----------------------------------------------------
+	// Get the parameter settings...
+
+	m_pDTM = Parameters("INPUT")->asGrid();
+	m_pRivGridCells = Parameters("OUTPUT")->asGrid();
+	m_pSX = Parameters("SX")->asInt();
+	m_pSY = Parameters("SY")->asInt();
+	m_pMX = Parameters("MX")->asInt();
+	m_pMY = Parameters("MY")->asInt();
+		
+	//-----------------------------------------------------
+	// Do something...
+	
+
+	if(!Set_RivGridCells(m_pSX, m_pSY, m_pMX, m_pMY))
+		Message_Dlg("Achtung, Fehler beim Erzeugen des Flussgrids");
+
+	//-----------------------------------------------------
+	// Return 'true' if everything is okay...
+
+	return( true );
+}
+
+
+
+//#########################################################
+//---------------------------------------------------------
+//#########################################################
+///////////////////////////////////////////////////////////
+//														 //
+//	Funktionen											 //
+//														 //
+///////////////////////////////////////////////////////////
+
+
+//######################################################
+//
+bool CRivGridPrep::Set_RivGridCells(int sx, int sy, int mx, int my )
+{
+	//Identifizierung der Flussgrids und setzen des Flusskilometerwertes - immer von Gitterboxmittelpunkt zu Mittelpunkt
+	
+	
+//	if( Parameters("Owrite")->asBool() )
+//		m_pRivGrids->Assign(0.0);
+	
+	int x = sx;
+	int y = sy;
+	int i = -1;
+	double dist = m_pDTM->Get_Cellsize() / 2;	// Wert Flusskilomter der ersten Flussgitterboxmitte
+	m_pRivGridCells->Set_Value(x, y, dist); // setzen der Kilometer bis zur Mitte der ersten Flussgitterbox
+
+	while( !m_pDTM->is_NoData(x,y))
+	{
+		i = m_pDTM->Get_Gradient_NeighborDir(x, y);
+
+		if(i >= 0)
+		{
+			dist = dist + Get_Length(i);				//bisheriger FlusskilometerWert + Weg zur n�chsten Gitterboxmitte (abh�ngig ob Wasser diagonal oder rechtwinklig in n�chste Gitterbox flie�t) am Ende der Gridbox wird in FlussGitterbox geschrieben (!=0) 
+
+			x = Get_xTo(i, x);
+			y = Get_yTo(i, y);
+			
+			if(!Parameters("Owrite")->asBool() && m_pRivGridCells->asDouble(x,y) != 0) //falls "�berschreiben" nicht gesetzt, bricht Funktion ab sobald ein Grid != 0 erreicht wird.
+				return(true);
+			
+			if(x == mx && y == my)
+			{
+				m_pRivGridCells->Set_Value(x, y, dist); // setzen der Kilometer bis zur Mitte der letzten Flussgitterbox
+
+				DataObject_Update(m_pRivGridCells);
+				return (true);
+			}
+			else
+				m_pRivGridCells->Set_Value(x, y, dist);	//FlusskilometerWert der n�chsten Gridbox(mitte) wird in n�chste FlussGitterbox i (ix,iy) geschrieben (!=0)
+
+			DataObject_Update(m_pRivGridCells);
+		
+
+		}
+		else
+			return(false);
+	}
+	
+	return (false);
+}
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/modules/shapes/shapes_lines/line_split_with_lines.h b/src/modules/simulation/sim_rivflow/RivGridPrep.h
similarity index 66%
copy from src/modules/shapes/shapes_lines/line_split_with_lines.h
copy to src/modules/simulation/sim_rivflow/RivGridPrep.h
index c4229fc..5822ca7 100644
--- a/src/modules/shapes/shapes_lines/line_split_with_lines.h
+++ b/src/modules/simulation/sim_rivflow/RivGridPrep.h
@@ -1,108 +1,94 @@
-/**********************************************************
- * Version $Id: line_split_with_lines.h 1921 2014-01-09 10:24:11Z oconrad $
- *********************************************************/
-
-///////////////////////////////////////////////////////////
-//                                                       //
-//                         SAGA                          //
-//                                                       //
-//      System for Automated Geoscientific Analyses      //
-//                                                       //
-//                    Module Library:                    //
-//                     shapes_lines                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//                line_split_with_lines.h                //
-//                                                       //
-//                 Copyright (C) 2014 by                 //
-//                      Olaf Conrad                      //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-// This file is part of 'SAGA - System for Automated     //
-// Geoscientific Analyses'. SAGA is free software; you   //
-// can redistribute it and/or modify it under the terms  //
-// of the GNU General Public License as published by the //
-// Free Software Foundation; version 2 of the License.   //
-//                                                       //
-// SAGA is distributed in the hope that it will be       //
-// useful, but WITHOUT ANY WARRANTY; without even the    //
-// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
-// PARTICULAR PURPOSE. See the GNU General Public        //
-// License for more details.                             //
-//                                                       //
-// You should have received a copy of the GNU General    //
-// Public License along with this program; if not,       //
-// write to the Free Software Foundation, Inc.,          //
-// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
-// USA.                                                  //
-//                                                       //
-//-------------------------------------------------------//
-//                                                       //
-//    e-mail:     oconrad at saga-gis.org                   //
-//                                                       //
-//    contact:    Olaf Conrad                            //
-//                Institute of Geography                 //
-//                University of Hamburg                  //
-//                Germany                                //
-//                                                       //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//                                                       //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#ifndef HEADER_INCLUDED__line_split_with_lines_H
-#define HEADER_INCLUDED__line_split_with_lines_H
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#include "MLB_Interface.h"
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-class CLine_Split_with_Lines : public CSG_Module  
-{
-public:
-	CLine_Split_with_Lines(void);
-
-
-protected:
-
-	virtual bool			On_Execute			(void);
-
-
-private:
-
-	bool					Get_Intersection	(CSG_Shape *pLine, CSG_Shape_Part *pSplit);
-
-};
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-#endif // #ifndef HEADER_INCLUDED__line_split_with_lines_H
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//                    Module Library:                    //
+//                       RivFlow                         //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                    RivGridPrep.h                      //
+//                                                       //
+//                 Copyright (C) 2014 by                 //
+//                   Christian Alwardt                   //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'. SAGA is free software; you   //
+// can redistribute it and/or modify it under the terms  //
+// of the GNU General Public License as published by the //
+// Free Software Foundation; version 2 of the License.   //
+//                                                       //
+// SAGA is distributed in the hope that it will be       //
+// useful, but WITHOUT ANY WARRANTY; without even the    //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU General Public        //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU General    //
+// Public License along with this program; if not,       //
+// write to the Free Software Foundation, Inc.,          //
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307,   //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    e-mail:     alwardt at ifsh.de                        //
+//                                                       //
+//    contact:    Christian Alwardt                      //
+//                Institute for Peace Research           //
+//                and Security Policy (IFSH)             //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//														 //
+//		RivTool 0.1										 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__RivGridPrep_H
+#define HEADER_INCLUDED__RivGridPrep_H
+
+//---------------------------------------------------------
+#include <saga_api/saga_api.h>
+
+//---------------------------------------------------------
+//#########################################################
+
+class CRivGridPrep : public CSG_Module_Grid
+{
+public: ////// public members and functions: //////////////
+
+	CRivGridPrep(void);							// constructor
+
+
+protected: /// protected members and functions: ///////////
+
+	virtual bool		On_Execute	(void);		// always overwrite this function
+
+
+private: ///// private members and functions: /////////////
+	CSG_Grid *m_pDTM, *m_pRivGridCells;
+	int m_pSX, m_pSY, m_pMX, m_pMY;
+
+	bool Set_RivGridCells(int sx, int sy, int mx, int my );
+
+};
+
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                                                       //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__RivGrids_H
diff --git a/src/modules/statistics/statistics_kriging/kriging_base.cpp b/src/modules/statistics/statistics_kriging/kriging_base.cpp
index 42f9239..c59ce8a 100644
--- a/src/modules/statistics/statistics_kriging/kriging_base.cpp
+++ b/src/modules/statistics/statistics_kriging/kriging_base.cpp
@@ -156,7 +156,7 @@ CKriging_Base::CKriging_Base(void)
 
 	///////////////////////////////////////////////////////
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")), false);
+	m_Grid_Target.Create(&Parameters, false, NULL, "TARGET_");
 
 	m_Grid_Target.Add_Grid("PREDICTION", _TL("Prediction"     ), false);
 	m_Grid_Target.Add_Grid("VARIANCE"  , _TL("Quality Measure"), true);
diff --git a/src/modules/statistics/statistics_kriging/kriging_regression.cpp b/src/modules/statistics/statistics_kriging/kriging_regression.cpp
index 5ffc969..34a1232 100644
--- a/src/modules/statistics/statistics_kriging/kriging_regression.cpp
+++ b/src/modules/statistics/statistics_kriging/kriging_regression.cpp
@@ -161,13 +161,13 @@ CKriging_Regression::CKriging_Regression(void)
 	{
 		Parameters.Add_Value(
 			NULL	, "VAR_MAXDIST"		, _TL("Maximum Distance"),
-			_TL(""),
+			_TL("maximum distance for variogram estimation"),
 			PARAMETER_TYPE_Double, -1.0
 		);
 
 		Parameters.Add_Value(
 			NULL	, "VAR_NCLASSES"	, _TL("Lag Distance Classes"),
-			_TL("initial number of lag distance classes"),
+			_TL("initial number of lag distance classes for variogram estimation"),
 			PARAMETER_TYPE_Int, 100, 1, true
 		);
 
@@ -178,9 +178,9 @@ CKriging_Regression::CKriging_Regression(void)
 		);
 
 		Parameters.Add_String(
-			NULL	, "VAR_MODEL"		, _TL("Model"),
+			NULL	, "VAR_MODEL"		, _TL("Variogram Model"),
 			_TL(""),
-			SG_T("a + b * x")
+			"a + b * x"
 		);
 	}
 
@@ -304,53 +304,30 @@ bool CKriging_Regression::On_Execute(void)
 
 	m_OK.Set_Manager(NULL);
 
-	if( !SG_UI_Get_Window_Main() )	// saga_cmd
-	{
-		if( !m_OK.Set_Parameter("POINTS"           , &Points)
-		||  !m_OK.Set_Parameter("FIELD"            , 2)	// residual
-		||  !m_OK.Set_Parameter("LOG"              , Parameters("LOG"              ))
-		||  !m_OK.Set_Parameter("BLOCK"            , Parameters("BLOCK"            ))
-		||  !m_OK.Set_Parameter("DBLOCK"           , Parameters("DBLOCK"           ))
-		||  !m_OK.Set_Parameter("SEARCH_RANGE"     , Parameters("SEARCH_RANGE"     ))
-		||  !m_OK.Set_Parameter("SEARCH_RADIUS"    , Parameters("SEARCH_RADIUS"    ))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_ALL", Parameters("SEARCH_POINTS_ALL"))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_MIN", Parameters("SEARCH_POINTS_MIN"))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_MAX", Parameters("SEARCH_POINTS_MAX"))
-		||  !m_OK.Set_Parameter("SEARCH_DIRECTION" , Parameters("SEARCH_DIRECTION" ))
-		||  !m_OK.Set_Parameter("VAR_MAXDIST"      , Parameters("VAR_MAXDIST"      ))
-		||  !m_OK.Set_Parameter("VAR_NCLASSES"     , Parameters("VAR_NCLASSES"     ))
-		||  !m_OK.Set_Parameter("VAR_NSKIP"        , Parameters("VAR_NSKIP"        ))
-		||  !m_OK.Set_Parameter("VAR_MODEL"        , Parameters("VAR_MODEL"        ))
-		||  !m_OK.Set_Parameter("TARGET_DEFINITION", 1)	// grid or grid system
-		||  !m_OK.Set_Parameter("TARGET_PREDICTION", pResiduals)
-		||  !m_OK.Set_Parameter("TARGET_VARIANCE"  , pVariance ) )
-		{
-			Error_Set(CSG_String::Format(SG_T("%s [%s].[%s]"), _TL("could not initialize tool"), SG_T("statistics_regression"), m_OK.Get_Name().c_str()));
-
-			return( false );
-		}
-	}
-	else
+	if( !m_OK.Set_Parameter("POINTS"           , &Points)
+	||  !m_OK.Set_Parameter("FIELD"            , 2)	// residual
+	||  !m_OK.Set_Parameter("LOG"              , Parameters("LOG"              ))
+	||  !m_OK.Set_Parameter("BLOCK"            , Parameters("BLOCK"            ))
+	||  !m_OK.Set_Parameter("DBLOCK"           , Parameters("DBLOCK"           ))
+	||  !m_OK.Set_Parameter("SEARCH_RANGE"     , Parameters("SEARCH_RANGE"     ))
+	||  !m_OK.Set_Parameter("SEARCH_RADIUS"    , Parameters("SEARCH_RADIUS"    ))
+	||  !m_OK.Set_Parameter("SEARCH_POINTS_ALL", Parameters("SEARCH_POINTS_ALL"))
+	||  !m_OK.Set_Parameter("SEARCH_POINTS_MIN", Parameters("SEARCH_POINTS_MIN"))
+	||  !m_OK.Set_Parameter("SEARCH_POINTS_MAX", Parameters("SEARCH_POINTS_MAX"))
+	||  !m_OK.Set_Parameter("SEARCH_DIRECTION" , Parameters("SEARCH_DIRECTION" ))
+	||  !m_OK.Set_Parameter("TARGET_DEFINITION", 1)	// grid or grid system
+	||  !m_OK.Set_Parameter("PREDICTION"       , pResiduals)
+	||  !m_OK.Set_Parameter("VARIANCE"         , pVariance )
+
+	|| (!SG_UI_Get_Window_Main() && (	// saga_cmd
+	    !m_OK.Set_Parameter("VAR_MAXDIST"      , Parameters("VAR_MAXDIST"      ))
+	||  !m_OK.Set_Parameter("VAR_NCLASSES"     , Parameters("VAR_NCLASSES"     ))
+	||  !m_OK.Set_Parameter("VAR_NSKIP"        , Parameters("VAR_NSKIP"        ))
+	||  !m_OK.Set_Parameter("VAR_MODEL"        , Parameters("VAR_MODEL"        )))) )
 	{
-		if( !m_OK.Set_Parameter("POINTS"           , &Points)
-		||  !m_OK.Set_Parameter("FIELD"            , 2)	// residual
-		||  !m_OK.Set_Parameter("LOG"              , Parameters("LOG"              ))
-		||  !m_OK.Set_Parameter("BLOCK"            , Parameters("BLOCK"            ))
-		||  !m_OK.Set_Parameter("DBLOCK"           , Parameters("DBLOCK"           ))
-		||  !m_OK.Set_Parameter("SEARCH_RANGE"     , Parameters("SEARCH_RANGE"     ))
-		||  !m_OK.Set_Parameter("SEARCH_RADIUS"    , Parameters("SEARCH_RADIUS"    ))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_ALL", Parameters("SEARCH_POINTS_ALL"))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_MIN", Parameters("SEARCH_POINTS_MIN"))
-		||  !m_OK.Set_Parameter("SEARCH_POINTS_MAX", Parameters("SEARCH_POINTS_MAX"))
-		||  !m_OK.Set_Parameter("SEARCH_DIRECTION" , Parameters("SEARCH_DIRECTION" ))
-		||  !m_OK.Set_Parameter("DEFINITION"       , 1)	// grid or grid system
-		||  !m_OK.Set_Parameter("PREDICTION"       , pResiduals)
-		||  !m_OK.Set_Parameter("VARIANCE"         , pVariance ) )
-		{
-			Error_Set(CSG_String::Format(SG_T("%s [%s].[%s]"), _TL("could not initialize tool"), SG_T("statistics_regression"), m_OK.Get_Name().c_str()));
-
-			return( false );
-		}
+		Error_Set(CSG_String::Format(SG_T("%s [%s].[%s]"), _TL("could not initialize tool"), SG_T("statistics_regression"), m_OK.Get_Name().c_str()));
+
+		return( false );
 	}
 
 	if( !m_OK.Execute() )
diff --git a/src/modules/statistics/statistics_regression/gw_multi_regression.cpp b/src/modules/statistics/statistics_regression/gw_multi_regression.cpp
index 4a06051..93c666f 100644
--- a/src/modules/statistics/statistics_regression/gw_multi_regression.cpp
+++ b/src/modules/statistics/statistics_regression/gw_multi_regression.cpp
@@ -109,7 +109,7 @@ CGW_Multi_Regression::CGW_Multi_Regression(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")), false);
+	m_Grid_Target.Create(&Parameters, false, NULL, "TARGET_");
 
 	m_Grid_Target.Add_Grid("QUALITY"  , _TL("Quality"  ), false);
 	m_Grid_Target.Add_Grid("INTERCEPT", _TL("Intercept"), false);
diff --git a/src/modules/statistics/statistics_regression/gw_regression.cpp b/src/modules/statistics/statistics_regression/gw_regression.cpp
index d0ed972..b794c90 100644
--- a/src/modules/statistics/statistics_regression/gw_regression.cpp
+++ b/src/modules/statistics/statistics_regression/gw_regression.cpp
@@ -100,7 +100,7 @@ CGW_Regression::CGW_Regression(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 
 	m_Grid_Target.Add_Grid("INTERCEPT", _TL("Intercept"), false);
 	m_Grid_Target.Add_Grid("SLOPE"    , _TL("Slope"    ), false);
diff --git a/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp b/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp
index e2d40a5..7dd7084 100644
--- a/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp
+++ b/src/modules/statistics/statistics_regression/point_multi_grid_regression.cpp
@@ -610,50 +610,24 @@ bool CPoint_Multi_Grid_Regression::Set_Residual_Corr(CSG_Grid *pRegression, CSG_
 	//-----------------------------------------------------
 	switch( Parameters("RESIDUAL_COR")->asInt() )
 	{
-	default:	// Multleve B-Spline Interpolation
-		if( !SG_UI_Get_Window_Main() )	// saga_cmd
-		{
-			SG_RUN_MODULE_ExitOnError("grid_spline", 4,
-				   SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
-				&& SG_MODULE_PARAMETER_SET("FIELD"            , 2)
-				&& SG_MODULE_PARAMETER_SET("TARGET_DEFINITION", 1)	// grid or grid system
-				&& SG_MODULE_PARAMETER_SET("TARGET_OUT_GRID"  , pCorrection)
-			);
-		}
-		else
-		{
-			SG_RUN_MODULE_ExitOnError("grid_spline", 4,
-				   SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
-				&& SG_MODULE_PARAMETER_SET("FIELD"            , 2)
-				&& SG_MODULE_PARAMETER_SET("DEFINITION"       , 1)	// grid or grid system
-				&& SG_MODULE_PARAMETER_SET("OUT_GRID"         , pCorrection)
-			);
-		}
+	default:	// Multlevel B-Spline Interpolation
+		SG_RUN_MODULE_ExitOnError("grid_spline", 4,
+				SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
+			&&  SG_MODULE_PARAMETER_SET("FIELD"            , 2)
+			&&  SG_MODULE_PARAMETER_SET("TARGET_DEFINITION", 1)	// grid or grid system
+			&&  SG_MODULE_PARAMETER_SET("TARGET_OUT_GRID"  , pCorrection)
+		);
 		break;
 
 	case  1:	// Inverse Distance Weighted
-		if( !SG_UI_Get_Window_Main() )	// saga_cmd
-		{
-			SG_RUN_MODULE_ExitOnError("grid_gridding", 1,
-				   SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
-				&& SG_MODULE_PARAMETER_SET("FIELD"            , 2)
-				&& SG_MODULE_PARAMETER_SET("TARGET_DEFINITION", 1)	// grid or grid system
-				&& SG_MODULE_PARAMETER_SET("TARGET_OUT_GRID"  , pCorrection)
-				&& SG_MODULE_PARAMETER_SET("SEARCH_RANGE"     , 1)	// global
-				&& SG_MODULE_PARAMETER_SET("SEARCH_POINTS_ALL", 1)	// all points within search distance
-			);
-		}
-		else
-		{
-			SG_RUN_MODULE_ExitOnError("grid_gridding", 1,
-				   SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
-				&& SG_MODULE_PARAMETER_SET("FIELD"            , 2)
-				&& SG_MODULE_PARAMETER_SET("DEFINITION"       , 1)
-				&& SG_MODULE_PARAMETER_SET("OUT_GRID"         , pCorrection)
-				&& SG_MODULE_PARAMETER_SET("SEARCH_RANGE"     , 1)	// global
-				&& SG_MODULE_PARAMETER_SET("SEARCH_POINTS_ALL", 1)	// all points within search distance
-			);
-		}
+		SG_RUN_MODULE_ExitOnError("grid_gridding", 1,
+				SG_MODULE_PARAMETER_SET("SHAPES"           , pResiduals)
+			&&  SG_MODULE_PARAMETER_SET("FIELD"            , 2)
+			&&  SG_MODULE_PARAMETER_SET("TARGET_DEFINITION", 1)	// grid or grid system
+			&&  SG_MODULE_PARAMETER_SET("TARGET_OUT_GRID"  , pCorrection)
+			&&  SG_MODULE_PARAMETER_SET("SEARCH_RANGE"     , 1)	// global
+			&&  SG_MODULE_PARAMETER_SET("SEARCH_POINTS_ALL", 1)	// all points within search distance
+		);
 		break;
 	}
 
diff --git a/src/modules/statistics/statistics_regression/point_trend_surface.cpp b/src/modules/statistics/statistics_regression/point_trend_surface.cpp
index 0d55af6..c50202b 100644
--- a/src/modules/statistics/statistics_regression/point_trend_surface.cpp
+++ b/src/modules/statistics/statistics_regression/point_trend_surface.cpp
@@ -137,7 +137,7 @@ CPoint_Trend_Surface::CPoint_Trend_Surface(void)
 	);
 
 	//-----------------------------------------------------
-	m_Grid_Target.Create(SG_UI_Get_Window_Main() ? &Parameters : Add_Parameters("TARGET", _TL("Target System"), _TL("")));
+	m_Grid_Target.Create(&Parameters, true, NULL, "TARGET_");
 }
 
 
diff --git a/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
index a448118..c4e0a6b 100644
--- a/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
+++ b/src/modules/terrain_analysis/ta_morphometry/ProtectionIndex.cpp
@@ -4,7 +4,7 @@
 /*******************************************************************************
     ProtectionIndex.cpp
     Copyright (C) Victor Olaya
-    
+
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
@@ -18,7 +18,7 @@
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA
-*******************************************************************************/ 
+*******************************************************************************/
 
 #include "ProtectionIndex.h"
 
@@ -32,26 +32,26 @@ CProtectionIndex::CProtectionIndex(void){
         "This algorithm analyses the immediate surrounding of each cell up to an given distance and evaluates how the relief protects it.\n"
          "It is equivalent to the positive openness described in: Visualizing Topography by Openness: A New Application of Image Processing to Digital Elevation Models, Photogrammetric Engineering and Remote Sensing(68), No. 3, March 2002, pp. 257-266."));
 
-	Parameters.Add_Grid(NULL, 
+	Parameters.Add_Grid(NULL,
 						"DEM",
-						_TL("Elevation"), 						
-						_TL(""), 
+						_TL("Elevation"),
+						_TL(""),
 						PARAMETER_INPUT);
 
-	Parameters.Add_Grid(NULL, 
-						"PROTECTION", 
-						_TL("Protection Index"), 
-						_TL(""), 
-						PARAMETER_OUTPUT, 
-						true, 
+	Parameters.Add_Grid(NULL,
+						"PROTECTION",
+						_TL("Protection Index"),
+						_TL(""),
+						PARAMETER_OUTPUT,
+						true,
 						SG_DATATYPE_Float);
 
-	Parameters.Add_Value(NULL, 
-						"RADIUS", 
-						_TL("Radius"), 
-						_TL(""), 
-						PARAMETER_TYPE_Double, 2000, 
-						0.0, 
+	Parameters.Add_Value(NULL,
+						"RADIUS",
+						_TL("Radius"),
+						_TL("The radius in map units"),
+						PARAMETER_TYPE_Double, 2000,
+						0.0,
 						true);
 
 }//constructor
@@ -60,15 +60,15 @@ CProtectionIndex::~CProtectionIndex(void)
 {}
 
 bool CProtectionIndex::On_Execute(void){
-	
+
 	int x,y;
 	double dProtectionIndex;
 	CSG_Grid* pProtectionIndex = Parameters("PROTECTION")->asGrid();
-	
+
 	m_dRadius = Parameters("RADIUS")->asDouble();
-	m_pDEM = Parameters("DEM")->asGrid(); 
+	m_pDEM = Parameters("DEM")->asGrid();
 
-    for(y=0; y<Get_NY() && Set_Progress(y); y++){		
+    for(y=0; y<Get_NY() && Set_Progress(y); y++){
 		for(x=0; x<Get_NX(); x++){
 			dProtectionIndex = getProtectionIndex(x,y);
 			if (dProtectionIndex == NO_DATA){
@@ -78,8 +78,8 @@ bool CProtectionIndex::On_Execute(void){
 				pProtectionIndex->Set_Value(x,y, dProtectionIndex);
 			}//else
 		}//for
-	}//for	
-	
+	}//for
+
 	return true;
 
 }//method
@@ -106,7 +106,7 @@ double CProtectionIndex::getProtectionIndex(int x, int y){
 			else{
 				return NO_DATA;
 			}
-			dDifHeight = m_pDEM->asDouble(x + iDifX[i] * j, y + iDifY[i] * j) 
+			dDifHeight = m_pDEM->asDouble(x + iDifX[i] * j, y + iDifY[i] * j)
 						 - m_pDEM->asDouble(x,y);
 			dAngle = atan (dDifHeight / dDist);
 			if (dAngle > aAngle[i]){
diff --git a/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
index 704ccae..c034947 100644
--- a/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
+++ b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp
@@ -69,14 +69,156 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CTC_Texture::CTC_Texture(void)
+CTC_Parameter_Base::CTC_Parameter_Base(void)
+{}
+
+//---------------------------------------------------------
+void CTC_Parameter_Base::On_Construction(void)
+{
+	Parameters.Add_Value(
+		NULL	, "SCALE"		, _TL("Scale (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10, 1, true
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "METHOD"		, _TL("Method"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("counting cells"),
+			_TL("resampling")
+		), 1
+	);
+
+	m_Kernel.Get_Weighting().Set_Weighting(SG_DISTWGHT_GAUSS);
+	m_Kernel.Get_Weighting().Set_BandWidth(0.7);
+	m_Kernel.Get_Weighting().Create_Parameters(&Parameters, false);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+int CTC_Parameter_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "METHOD") )
+	{
+		pParameters->Set_Enabled("DISTANCE_WEIGHTING", pParameter->asInt() == 0);
+	}
+
+	m_Kernel.Get_Weighting().Enable_Parameters(pParameters);
+
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CTC_Parameter_Base::Get_Parameter(CSG_Grid *pValues, CSG_Grid *pParameter)
+{
+	DataObject_Set_Colors(pParameter, 10, SG_COLORS_RED_GREY_BLUE, true);
+
+	//-----------------------------------------------------
+	if( Parameters("METHOD")->asInt() == 0 )
+	{
+		m_Kernel.Get_Weighting().Set_Parameters(&Parameters);
+		m_Kernel.Get_Weighting().Set_BandWidth(Parameters("SCALE")->asDouble() * m_Kernel.Get_Weighting().Get_BandWidth());
+		m_Kernel.Set_Radius(Parameters("SCALE")->asDouble());
+
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			#pragma omp parallel for
+			for(int x=0; x<Get_NX(); x++)
+			{
+				if( pValues->is_NoData(x, y) )
+				{
+					pParameter->Set_NoData(x, y);
+				}
+				else
+				{
+					double	d, w, nTotal = 0.0, nValid = 0.0;
+
+					for(int i=0, ix, iy; i<m_Kernel.Get_Count(); i++)
+					{
+						if( m_Kernel.Get_Values(i, ix = x, iy = y, d, w, true) && pValues->is_InGrid(ix, iy) )
+						{
+							nTotal	+= w;
+
+							if( pValues->asInt(ix, iy) != 0 )
+							{
+								nValid	+= w;
+							}
+						}
+					}
+
+					pParameter->Set_Value(x, y, nTotal > 0.0 ? 100.0 * nValid / nTotal : 0.0);	// make percentage
+				}
+			}
+		}
+
+		m_Kernel.Destroy();
+	}
+
+	//-----------------------------------------------------
+	else
+	{
+		double		Cellsize	= Parameters("SCALE")->asInt() * Get_Cellsize();
+
+		if( Cellsize > 0.5 * SG_Get_Length(Get_System()->Get_XRange(), Get_System()->Get_YRange()) )
+		{
+			Error_Set(_TL("resampling cell size is too large"));
+
+			return( false );
+		}
+
+		CSG_Grid	Values(CSG_Grid_System(Cellsize, Get_XMin(), Get_YMin(), Get_XMax(), Get_YMax()), SG_DATATYPE_Float);
+
+		Values.Assign(pValues, GRID_INTERPOLATION_Mean_Cells);
+
+		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
+		{
+			double	py	= Get_YMin() + y * Get_Cellsize();
+
+			#pragma omp parallel for
+			for(int x=0; x<Get_NX(); x++)
+			{
+				double	z, px	= Get_XMin() + x * Get_Cellsize();
+
+				if( pValues->is_NoData(x, y) || !Values.Get_Value(px, py, z, GRID_INTERPOLATION_BSpline) )
+				{
+					pParameter->Set_NoData(x, y);
+				}
+				else
+				{
+					pParameter->Set_Value(x, y, 100.0 * z);	// make percentage
+				}
+			}
+		}
+	}
+
 	//-----------------------------------------------------
-	// 1. Info...
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
 
+//---------------------------------------------------------
+CTC_Texture::CTC_Texture(void)
+{
+	//-----------------------------------------------------
 	Set_Name		(_TL("Terrain Surface Texture"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
+	Set_Author		("O.Conrad (c) 2012");
 
 	Set_Description	(_TW(
 		"Terrain surface texture as proposed by Iwahashi & Pike (2007) for subsequent terrain classification.\n"
@@ -87,10 +229,7 @@ CTC_Texture::CTC_Texture(void)
 		"Geomorphology, Vol. 86, pp. 409�440\n"
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Parameters...
-
 	Parameters.Add_Grid(
 		NULL	, "DEM"			, _TL("Elevation"),
 		_TL(""),
@@ -104,12 +243,16 @@ CTC_Texture::CTC_Texture(void)
 	);
 
 	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Radius"),
-		_TL(""),
-		PARAMETER_TYPE_Int, 10, 1, true
+		NULL	, "EPSILON"		, _TL("Flat Area Threshold"),
+		_TL("maximum difference between original and median filtered elevation (3x3 moving window) that still is recognized flat"),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
 	);
+
+	//-----------------------------------------------------
+	On_Construction();
 }
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
@@ -118,108 +261,59 @@ CTC_Texture::CTC_Texture(void)
 bool CTC_Texture::On_Execute(void)
 {
 	//-----------------------------------------------------
-	int			y;
-
 	CSG_Grid	Noise(*Get_System(), SG_DATATYPE_Char);
-	m_pNoise	= &Noise;
-
-	m_pDEM		= Parameters("DEM"    )->asGrid();
-	m_pTexture	= Parameters("TEXTURE")->asGrid();
 
-	DataObject_Set_Colors(m_pTexture, 100, SG_COLORS_RED_GREY_BLUE, true);
+	double	Epsilon	= Parameters("EPSILON")->asDouble();
 
-	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			Noise.Set_Value(x, y, Get_MedianDiff(x, y));
-		}
-	}
+	m_pDEM	= Parameters("DEM")->asGrid();
 
 	//-----------------------------------------------------
-	m_Kernel.Set_Radius(Parameters("RADIUS")->asInt());
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 	{
 		#pragma omp parallel for
 		for(int x=0; x<Get_NX(); x++)
 		{
-			Get_Texture(x, y);
+			if( m_pDEM->is_NoData(x, y) )
+			{
+				Noise.Set_NoData(x, y);
+			}
+			else
+			{
+				Noise.Set_Value(x, y, Get_Noise(x, y, Epsilon));
+			}
 		}
 	}
 
-	m_Kernel.Destroy();
-
 	//-----------------------------------------------------
-	return( true );
+	return( Get_Parameter(&Noise, Parameters("TEXTURE")->asGrid()) );
 }
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CTC_Texture::Get_MedianDiff(int x, int y)
-{
-	int		n	= 0;
-
-	if( m_pDEM->is_InGrid(x, y) )
-	{
-		double	z	= m_pDEM->asDouble(x, y);
-
-		for(int iy=y-1; iy<=y+1; iy++)
-		{
-			for(int ix=x-1; ix<=x+1; ix++)
-			{
-				if( (ix != x || iy != y) && m_pDEM->is_InGrid(ix, iy) )
-				{
-					double	iz	= m_pDEM->asDouble(ix, iy);
-
-					n	= z < iz ? n + 1
-						: z > iz ? n - 1 : n;
-				}
-			}
-		}
-	}
-
-	return( n );
-}
-
+// returns 1 if the cell represents a 'peak/crest' or
+// if the cell is a 'pit/trough' based on the difference to
+// median of a 3x3 neighbourhood
 //---------------------------------------------------------
-int CTC_Texture::Get_Texture(int x, int y)
+int CTC_Texture::Get_Noise(int x, int y, double Epsilon)
 {
-	if( m_pDEM->is_InGrid(x, y) )
-	{
-		int		nNoise	= 0;
-		int		nTotal	= 0;
+	CSG_Simple_Statistics	s(true);
 
-		for(int i=0; i<m_Kernel.Get_Count(); i++)
+	for(int iy=y-1; iy<=y+1; iy++)
+	{
+		for(int ix=x-1; ix<=x+1; ix++)
 		{
-			int	ix	= m_Kernel.Get_X(i, x);
-			int	iy	= m_Kernel.Get_Y(i, y);
-
-			if( m_pNoise->is_InGrid(ix, iy) )
+			if( m_pDEM->is_InGrid(ix, iy) )
 			{
-				nTotal++;
-
-				if( m_pNoise->asDouble(ix, iy) != 0.0 )
-				{
-					nNoise++;
-				}
+				s	+= m_pDEM->asDouble(ix, iy);
 			}
 		}
-
-		m_pTexture->Set_Value(x, y, nNoise / (double)nTotal);
-
-		return( true );
 	}
 
-	//-----------------------------------------------------
-	m_pTexture->Set_NoData(x, y);
-
-	return( false );
+	return( fabs(m_pDEM->asDouble(x, y) - s.Get_Median()) > Epsilon ? 1 : 0 );
 }
 
 
@@ -233,11 +327,9 @@ int CTC_Texture::Get_Texture(int x, int y)
 CTC_Convexity::CTC_Convexity(void)
 {
 	//-----------------------------------------------------
-	// 1. Info...
-
 	Set_Name		(_TL("Terrain Surface Convexity"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
+	Set_Author		("O.Conrad (c) 2012");
 
 	Set_Description	(_TW(
 		"Terrain surface convexity as proposed by Iwahashi & Pike (2007) for subsequent terrain classification.\n"
@@ -248,10 +340,7 @@ CTC_Convexity::CTC_Convexity(void)
 		"Geomorphology, Vol. 86, pp. 409�440\n"
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Parameters...
-
 	Parameters.Add_Grid(
 		NULL	, "DEM"			, _TL("Elevation"),
 		_TL(""),
@@ -259,16 +348,38 @@ CTC_Convexity::CTC_Convexity(void)
 	);
 
 	Parameters.Add_Grid(
-		NULL	, "CONVEX"		, _TL("Convexity"),
+		NULL	, "CONVEXITY"	, _TL("Convexity"),
 		_TL(""),
 		PARAMETER_OUTPUT
 	);
 
+	Parameters.Add_Choice(
+		NULL	, "KERNEL"		, _TL("Laplacian Filter Kernel"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|",
+			_TL("conventional four-neighbourhood"),
+			_TL("conventional eight-neihbourhood"),
+			_TL("eight-neihbourhood (distance based weighting)")
+		)
+	);
+
+	Parameters.Add_Choice(
+		NULL	, "TYPE"		, _TL("Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("convexity"),
+			_TL("concavity")
+		)
+	);
+
 	Parameters.Add_Value(
-		NULL	, "RADIUS"		, _TL("Radius"),
+		NULL	, "EPSILON"		, _TL("Flat Area Threshold"),
 		_TL(""),
-		PARAMETER_TYPE_Int, 10, 1, true
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
 	);
+
+	//-----------------------------------------------------
+	On_Construction();
 }
 
 
@@ -280,110 +391,63 @@ CTC_Convexity::CTC_Convexity(void)
 bool CTC_Convexity::On_Execute(void)
 {
 	//-----------------------------------------------------
-	int			y;
+	const double	Kernels[3][2]	= { { 1, 0 }, { 1, 1 }, { 1, 1 / sqrt(2.0) } };
 
-	CSG_Grid	Laplace(*Get_System(), SG_DATATYPE_Char);
-	m_pLaplace	= &Laplace;
+	int	Kernel	= Parameters("KERNEL")->asInt();
 
-	m_pDEM			= Parameters("DEM"   )->asGrid();
-	m_pConvexity	= Parameters("CONVEX")->asGrid();
+	//-----------------------------------------------------
+	CSG_Grid	Laplace(*Get_System(), SG_DATATYPE_Char);
 
-	DataObject_Set_Colors(m_pConvexity, 100, SG_COLORS_RED_GREY_BLUE, true);
+	double	Epsilon	= Parameters("EPSILON")->asDouble();
+	int		Type	= Parameters("TYPE"   )->asInt   ();
 
-	switch( 0 )
-	{
-	case 0:	m_dLaplace[0]	= 1;	m_dLaplace[1]	= 0;	break;
-	case 1:	m_dLaplace[0]	= 1;	m_dLaplace[1]	= 1;	break;
-	case 2:	m_dLaplace[0]	= 2;	m_dLaplace[1]	= 1;	break;
-	}
+	m_pDEM	= Parameters("DEM")->asGrid();
 
 	//-----------------------------------------------------
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
+	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 	{
 		#pragma omp parallel for
 		for(int x=0; x<Get_NX(); x++)
 		{
-			Laplace.Set_Value(x, y, Get_Laplace(x, y));
-		}
-	}
-
-	//-----------------------------------------------------
-	m_Kernel.Set_Radius(Parameters("RADIUS")->asInt());
-
-	for(y=0; y<Get_NY() && Set_Progress(y); y++)
-	{
-		#pragma omp parallel for
-		for(int x=0; x<Get_NX(); x++)
-		{
-			Get_Convexity(x, y);
+			if( m_pDEM->is_NoData(x, y) )
+			{
+				Laplace.Set_NoData(x, y);
+			}
+			else
+			{
+				Laplace.Set_Value(x, y, Get_Laplace(x, y, Kernels[Kernel], Type, Epsilon));
+			}
 		}
 	}
 
-	m_Kernel.Destroy();
-
 	//-----------------------------------------------------
-	return( true );
+	return( Get_Parameter(&Laplace, Parameters("CONVEXITY")->asGrid()) );
 }
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CTC_Convexity::Get_Laplace(int x, int y)
+int CTC_Convexity::Get_Laplace(int x, int y, const double Kernel[2], int Type, double Epsilon)
 {
-	if( m_pDEM->is_InGrid(x, y) )
-	{
-		double	Sum		= 4 * (m_dLaplace[0] + m_dLaplace[1]) * m_pDEM->asDouble(x, y);
+	double	Sum	= 4 * (Kernel[0] + Kernel[1]) * m_pDEM->asDouble(x, y);
 
-		for(int i=0; i<8; i++)
-		{
-			int		ix	= Get_xTo(i, x);
-			int		iy	= Get_yTo(i, y);
-			double	iz	= m_pDEM->is_InGrid(ix, iy) ? m_pDEM->asDouble(ix, iy) : m_pDEM->asDouble(x, y);
-
-			Sum		-= m_dLaplace[i % 2] * iz;
-		}
-
-		return( Sum > 0.0 ? 1 : 0 );
-	}
-
-	return( 0 );
-}
-
-//---------------------------------------------------------
-int CTC_Convexity::Get_Convexity(int x, int y)
-{
-	if( m_pDEM->is_InGrid(x, y) )
+	for(int i=0; i<8; i++)
 	{
-		int		nConvex	= 0;
-		int		nTotal	= 0;
-
-		for(int i=0; i<m_Kernel.Get_Count(); i++)
-		{
-			int	ix	= m_Kernel.Get_X(i, x);
-			int	iy	= m_Kernel.Get_Y(i, y);
+		int		ix	= Get_xTo(i, x);
+		int		iy	= Get_yTo(i, y);
 
-			if( m_pLaplace->is_InGrid(ix, iy) )
-			{
-				nTotal++;
+		double	iz	= m_pDEM->is_InGrid(ix, iy) ? m_pDEM->asDouble(ix, iy) : m_pDEM->asDouble(x, y);
 
-				if( m_pLaplace->asDouble(ix, iy) > 0.0 )
-				{
-					nConvex++;
-				}
-			}
-		}
-
-		m_pConvexity->Set_Value(x, y, nConvex / (double)nTotal);
-
-		return( true );
+		Sum		-= Kernel[i % 2] * iz;
 	}
 
-	//-----------------------------------------------------
-	m_pConvexity->Set_NoData(x, y);
-
-	return( false );
+	return( Type == 0
+		? Sum >  Epsilon ? 1 : 0
+		: Sum < -Epsilon ? 1 : 0
+	);
 }
 
 
@@ -408,12 +472,12 @@ int CTC_Convexity::Get_Convexity(int x, int y)
 //---------------------------------------------------------
 CTC_Classification::CTC_Classification(void)
 {
-	//-----------------------------------------------------
-	// 1. Info...
+	CSG_Parameter	*pNode;
 
-	Set_Name		(_TL("Terrain Surface Classification"));
+	//-----------------------------------------------------
+	Set_Name		(_TL("Terrain Surface Classification (Iwahashi and Pike)"));
 
-	Set_Author		(SG_T("O.Conrad (c) 2012"));
+	Set_Author		("O.Conrad (c) 2012");
 
 	Set_Description	(_TW(
 		"Terrain surface classification as proposed by Iwahashi & Pike (2007).\n"
@@ -424,10 +488,7 @@ CTC_Classification::CTC_Classification(void)
 		"Geomorphology, Vol. 86, pp. 409�440\n"
 	));
 
-
 	//-----------------------------------------------------
-	// 2. Parameters...
-
 	Parameters.Add_Grid(
 		NULL	, "DEM"			, _TL("Elevation"),
 		_TL(""),
@@ -440,18 +501,30 @@ CTC_Classification::CTC_Classification(void)
 		PARAMETER_INPUT_OPTIONAL
 	);
 
-	Parameters.Add_Grid(
-		NULL	, "CONVEX"		, _TL("Convexity"),
+	pNode	= Parameters.Add_Grid(
+		NULL	, "CONVEXITY"	, _TL("Convexity"),
 		_TL(""),
 		PARAMETER_INPUT_OPTIONAL
 	);
 
-	Parameters.Add_Grid(
+	Parameters.Add_Value(
+		pNode	, "CONV_RECALC"	, _TL("Recalculate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
+	pNode	= Parameters.Add_Grid(
 		NULL	, "TEXTURE"		, _TL("Texture"),
 		_TL(""),
 		PARAMETER_INPUT_OPTIONAL
 	);
 
+	Parameters.Add_Value(
+		pNode	, "TEXT_RECALC"	, _TL("Recalculate"),
+		_TL(""),
+		PARAMETER_TYPE_Bool, false
+	);
+
 	Parameters.Add_Grid(
 		NULL	, "LANDFORMS"	, _TL("Landforms"),
 		_TL(""),
@@ -461,7 +534,62 @@ CTC_Classification::CTC_Classification(void)
 	Parameters.Add_Choice(
 		NULL	, "TYPE"		, _TL("Number of Classes"),
 		_TL(""),
-		SG_T("8|12|16|"), 0
+		SG_T("8|12|16|"), 2
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "CONV_NODE"	, _TL("Convexity"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "CONV_SCALE"	, _TL("Scale (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10, 1, true
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "CONV_KERNEL"	, _TL("Laplacian Filter Kernel"),
+		_TL(""),
+		CSG_String::Format("%s|%s|%s|",
+			_TL("four-neighbourhood"),
+			_TL("eight-neihbourhood"),
+			_TL("eight-neihbourhood (distance based weighting)")
+		)
+	);
+
+	Parameters.Add_Choice(
+		pNode	, "CONV_TYPE"	, _TL("Type"),
+		_TL(""),
+		CSG_String::Format("%s|%s|",
+			_TL("convexity"),
+			_TL("concavity")
+		)
+	);
+
+	Parameters.Add_Value(
+		pNode	, "CONV_EPSILON", _TL("Flat Area Threshold"),
+		_TL(""),
+		PARAMETER_TYPE_Double, 0.0, 0.0, true
+	);
+
+	//-----------------------------------------------------
+	pNode	= Parameters.Add_Node(
+		NULL	, "TEXT_NODE"	, _TL("Texture"),
+		_TL("")
+	);
+
+	Parameters.Add_Value(
+		pNode	, "TEXT_SCALE"	, _TL("Scale (Cells)"),
+		_TL(""),
+		PARAMETER_TYPE_Int, 10, 1, true
+	);
+
+	Parameters.Add_Value(
+		pNode	, "TEXT_EPSILON", _TL("Flat Area Threshold"),
+		_TL("maximum difference between original and median filtered elevation (3x3 moving window) that still is recognized flat"),
+		PARAMETER_TYPE_Double, 1.0, 0.0, true
 	);
 }
 
@@ -473,13 +601,33 @@ CTC_Classification::CTC_Classification(void)
 //---------------------------------------------------------
 int CTC_Classification::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter)
 {
-	pParameters->Get_Parameter("DEM")->Set_Enabled(
-			pParameters->Get_Parameter("SLOPE"  )->asGrid() == NULL
-		||	pParameters->Get_Parameter("CONVEX" )->asGrid() == NULL
-		||	pParameters->Get_Parameter("TEXTURE")->asGrid() == NULL
+	pParameters->Set_Enabled("DEM",
+		pParameters->Get_Parameter("SLOPE"      )->asGrid() == NULL
+	||	pParameters->Get_Parameter("CONVEXITY"  )->asGrid() == NULL
+	||	pParameters->Get_Parameter("TEXTURE"    )->asGrid() == NULL
+	);
+
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "CONVEXITY") )
+	{
+		pParameters->Set_Enabled("CONV_RECALC", pParameter->asGrid() != NULL);
+	}
+
+	pParameters->Set_Enabled("CONV_NODE",
+		pParameters->Get_Parameter("CONVEXITY"  )->asGrid() == NULL
+	||	pParameters->Get_Parameter("CONV_RECALC")->asBool()
 	);
 
-	return( 1 );
+	if( !SG_STR_CMP(pParameter->Get_Identifier(), "TEXTURE") )
+	{
+		pParameters->Set_Enabled("TEXT_RECALC" , pParameter->asGrid() != NULL);
+	}
+
+	pParameters->Set_Enabled("TEXT_NODE",
+		pParameters->Get_Parameter("TEXTURE"    )->asGrid() == NULL
+	||	pParameters->Get_Parameter("TEXT_RECALC")->asBool()
+	);
+
+	return( CSG_Module_Grid::On_Parameters_Enable(pParameters, pParameter) );
 }
 
 
@@ -490,25 +638,24 @@ int CTC_Classification::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Pa
 //---------------------------------------------------------
 bool CTC_Classification::On_Execute(void)
 {
-	CSG_Grid	Slope, Convexity, Texture, *pDEM;
-
 	//-----------------------------------------------------
-	pDEM			= Parameters("DEM"      )->asGrid();
 	m_pSlope		= Parameters("SLOPE"    )->asGrid();
-	m_pConvexity	= Parameters("CONVEX"   )->asGrid();
+	m_pConvexity	= Parameters("CONVEXITY")->asGrid();
 	m_pTexture		= Parameters("TEXTURE"  )->asGrid();
-	m_pLandforms	= Parameters("LANDFORMS")->asGrid();
 
-	if( !pDEM && (!m_pSlope || !m_pConvexity || !m_pTexture) )
+	if( (!m_pSlope || !m_pConvexity || !m_pTexture) && !Parameters("DEM")->asGrid() )
 	{
 		return( false );
 	}
 
 	//-----------------------------------------------------
+	CSG_Grid	Slope;
+
 	if( !m_pSlope )
 	{
-		Slope.Create(*Get_System());
-		m_pSlope	= &Slope;
+		Slope.Create(*Get_System());	m_pSlope	= &Slope;
+
+		CSG_Grid	*pDEM	= Parameters("DEM")->asGrid();
 
 		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 		{
@@ -530,43 +677,48 @@ bool CTC_Classification::On_Execute(void)
 	}
 
 	//-----------------------------------------------------
-	if( !m_pConvexity )
+	if( !m_pConvexity || Parameters("CONV_RECALC")->asBool() )
 	{
-		Convexity.Create(*Get_System());
-		m_pConvexity	= &Convexity;
-
 		CTC_Convexity	c;
 
-		c.Get_Parameters()->Set_Parameter("DEM"   , pDEM);
-		c.Get_Parameters()->Set_Parameter("CONVEX", m_pConvexity);
+		c.Set_Parameter(      "DEM", Parameters("DEM"));
+		c.Set_Parameter(    "SCALE", Parameters("CONV_SCALE"));
+		c.Set_Parameter(   "KERNEL", Parameters("CONV_KERNEL"));
+		c.Set_Parameter(     "TYPE", Parameters("CONV_TYPE"));
+		c.Set_Parameter(  "EPSILON", Parameters("CONV_EPSILON"));
+		c.Set_Parameter("CONVEXITY", m_pConvexity);
 
 		if( !c.Execute() )
 		{
 			return( false );
 		}
+
+		Parameters("CONVEXITY")->Set_Value(m_pConvexity = c.Get_Parameters()->Get_Parameter("CONVEXITY")->asGrid());
 	}
 
 	//-----------------------------------------------------
-	if( !m_pTexture )
+	if( !m_pTexture || Parameters("TEXT_RECALC")->asBool() )
 	{
-		Texture.Create(*Get_System());
-		m_pTexture	= &Texture;
-
 		CTC_Texture	c;
 
-		c.Get_Parameters()->Set_Parameter("DEM"    , pDEM);
-		c.Get_Parameters()->Set_Parameter("TEXTURE", m_pTexture);
+		c.Set_Parameter(    "DEM", Parameters("DEM"));
+		c.Set_Parameter(  "SCALE", Parameters("TEXT_SCALE"));
+		c.Set_Parameter("EPSILON", Parameters("TEXT_EPSILON"));
+		c.Set_Parameter("TEXTURE", m_pTexture);
 
 		if( !c.Execute() )
 		{
 			return( false );
 		}
+
+		Parameters("TEXTURE")->Set_Value(m_pTexture = c.Get_Parameters()->Get_Parameter("TEXTURE")->asGrid());
 	}
 
 	//-----------------------------------------------------
 	return( Get_Classes() );
 }
 
+
 ///////////////////////////////////////////////////////////
 //														 //
 ///////////////////////////////////////////////////////////
@@ -577,38 +729,77 @@ bool CTC_Classification::Get_Classes(void)
 	//-----------------------------------------------------
 	int	Level, nLevels	= 1 + Parameters("TYPE")->asInt();
 
-	m_pLandforms->Assign(0.0);
-	m_pLandforms->Set_NoData_Value(CLASS_FLAG_NODATA);
+	CSG_Grid	*pLandforms	= Parameters("LANDFORMS")->asGrid();
+
+	pLandforms->Assign(0.0);
+	pLandforms->Set_NoData_Value(CLASS_FLAG_NODATA);
+
+	Set_LUT(pLandforms, nLevels);
 
 	//-----------------------------------------------------
 	for(Level=1; Level<=nLevels && Process_Get_Okay(); Level++)
 	{
-		Process_Set_Text(CSG_String::Format(SG_T("%s: %d"), _TL("Level"), Level));
+		Process_Set_Text(CSG_String::Format("%s: %d", _TL("Level"), Level));
 
-		m_Mean_Slope		= Level == 1 ? m_pSlope    ->Get_Mean() : stat_Slope    .Get_Mean();
-		m_Mean_Convexity	= Level == 1 ? m_pConvexity->Get_Mean() : stat_Convexity.Get_Mean();
-		m_Mean_Texture  	= Level == 1 ? m_pTexture  ->Get_Mean() : stat_Texture  .Get_Mean();
+		m_Mean_Slope		= Level == 1 ? m_pSlope    ->Get_Mean() : m_Stat_Slope    .Get_Mean();
+		m_Mean_Convexity	= Level == 1 ? m_pConvexity->Get_Mean() : m_Stat_Convexity.Get_Mean();
+		m_Mean_Texture  	= Level == 1 ? m_pTexture  ->Get_Mean() : m_Stat_Texture  .Get_Mean();
 
-		stat_Slope    .Invalidate();
-		stat_Convexity.Invalidate();
-		stat_Texture  .Invalidate();
+		m_Stat_Slope    .Invalidate();
+		m_Stat_Convexity.Invalidate();
+		m_Stat_Texture  .Invalidate();
 
 		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
 		{
-			#pragma omp parallel for
 			for(int x=0; x<Get_NX(); x++)
 			{
-				Get_Class(Level, x, y, Level == nLevels);
+				if( pLandforms->asInt(x, y) == 0 )
+				{
+					pLandforms->Set_Value(x, y, Get_Class(Level, x, y, Level == nLevels));
+				}
 			}
 		}
 	}
 
 	//-----------------------------------------------------
-	Set_LUT(nLevels);
-
 	return( true );
 }
 
+//---------------------------------------------------------
+int CTC_Classification::Get_Class(int Level, int x, int y, bool bLastLevel)
+{
+	if( Level == 1 && (m_pSlope->is_NoData(x, y) || m_pConvexity->is_NoData(x, y) || m_pTexture->is_NoData(x, y)) )
+	{
+		return( CLASS_FLAG_NODATA );
+	}
+
+	//-----------------------------------------------------
+	if( m_pSlope->asDouble(x, y) > m_Mean_Slope )
+	{
+		Level	|= CLASS_FLAG_SLOPE;
+	}
+	else if( !bLastLevel )
+	{
+		m_Stat_Slope		+= m_pSlope    ->asDouble(x, y);
+		m_Stat_Convexity	+= m_pConvexity->asDouble(x, y);
+		m_Stat_Texture		+= m_pTexture  ->asDouble(x, y);
+
+		return( 0 );	// check again on next level
+	}
+
+	if( m_pConvexity->asDouble(x, y) > m_Mean_Convexity )
+	{
+		Level	|= CLASS_FLAG_CONVEXITY;
+	}
+
+	if( m_pTexture->asDouble(x, y) > m_Mean_Texture )
+	{
+		Level	|= CLASS_FLAG_TEXTURE;
+	}
+
+	return( Level );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -617,19 +808,19 @@ bool CTC_Classification::Get_Classes(void)
 //---------------------------------------------------------
 #define ADD_CLASS(Level, Slope, Convexity, Texture, Color, sSlope)	{\
 	CSG_Table_Record	*pClass	= pLUT->asTable()->Add_Record();\
-	pClass->Set_Value(0, Color);\
-	pClass->Set_Value(1, CSG_String::Format(SG_T("%d) %s, %s convexity, %s texture"), pLUT->asTable()->Get_Count(), sSlope,\
-		Convexity ? SG_T("high") : SG_T("low"),\
-		Texture   ? SG_T("fine") : SG_T("coarse")));\
+	pClass->Set_Value(0, SG_GET_RGB(SG_GET_B(Color), SG_GET_G(Color), SG_GET_R(Color)));\
+	pClass->Set_Value(1, CSG_String::Format("%d) %s slope, %s texture, %s convexity", pLUT->asTable()->Get_Count(), SG_T(sSlope),\
+		Texture   ? SG_T("fine") : SG_T("coarse"),\
+		Convexity ? SG_T("high") : SG_T("low")));\
 	pClass->Set_Value(2, pClass->asString(1));\
 	pClass->Set_Value(3, Level|(Slope ? CLASS_FLAG_SLOPE : 0)|(Convexity ? CLASS_FLAG_CONVEXITY : 0)|(Texture ? CLASS_FLAG_TEXTURE : 0));\
-	pClass->Set_Value(4, Level|(Slope ? CLASS_FLAG_SLOPE : 0)|(Convexity ? CLASS_FLAG_CONVEXITY : 0)|(Texture ? CLASS_FLAG_TEXTURE : 0));\
+	pClass->Set_Value(4, pClass->asInt(3));\
 }
 
 //---------------------------------------------------------
-void CTC_Classification::Set_LUT(int nLevels)
+void CTC_Classification::Set_LUT(CSG_Grid *pLandforms, int nLevels)
 {
-	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(m_pLandforms, "LUT");
+	CSG_Parameter	*pLUT	= DataObject_Get_Parameter(pLandforms, "LUT");
 
 	if( !pLUT || !pLUT->asTable() )
 	{
@@ -641,109 +832,60 @@ void CTC_Classification::Set_LUT(int nLevels)
 	switch( nLevels )
 	{
 	case 1:		// 8 classes
-		ADD_CLASS(1, 1, 1, 1, SG_GET_RGB(124,  70,  44), SG_T("steep"));
-		ADD_CLASS(1, 1, 1, 0, SG_GET_RGB(255,   0, 255), SG_T("steep"));
-		ADD_CLASS(1, 1, 0, 1, SG_GET_RGB(190, 108,  40), SG_T("steep"));
-		ADD_CLASS(1, 1, 0, 0, SG_GET_RGB(255, 146, 205), SG_T("steep"));
-
-		ADD_CLASS(1, 0, 1, 1, SG_GET_RGB(248, 148,   0), SG_T("gentle"));
-		ADD_CLASS(1, 0, 1, 0, SG_GET_RGB(255,  67, 162), SG_T("gentle"));
-		ADD_CLASS(1, 0, 0, 1, SG_GET_RGB(248, 206,  97), SG_T("gentle"));
-		ADD_CLASS(1, 0, 0, 0, SG_GET_RGB(248, 194, 208), SG_T("gentle"));
+		//        l  s  c  t
+		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "steep"     );	// class  1
+		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "steep"     );	// class  2
+		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "steep"     );	// class  3
+		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "steep"     );	// class  4
+
+		ADD_CLASS(1, 0, 1, 1, 0x66A726, "gentle"    );	// class  5
+		ADD_CLASS(1, 0, 1, 0, 0xFFFF40, "gentle"    );	// class  6
+		ADD_CLASS(1, 0, 0, 1, 0xAEFF7B, "gentle"    );	// class  7
+		ADD_CLASS(1, 0, 0, 0, 0xFFFFBF, "gentle"    );	// class  8
 		break;
 
 	case 2:		// 12 classes
-		ADD_CLASS(1, 1, 1, 1, SG_GET_RGB(124,  70,  44), SG_T("steep"));
-		ADD_CLASS(1, 1, 1, 0, SG_GET_RGB(255,   0, 255), SG_T("steep"));
-		ADD_CLASS(1, 1, 0, 1, SG_GET_RGB(190, 108,  40), SG_T("steep"));
-		ADD_CLASS(1, 1, 0, 0, SG_GET_RGB(255, 146, 205), SG_T("steep"));
-
-		ADD_CLASS(2, 1, 1, 1, SG_GET_RGB(248, 148,   0), SG_T("moderate"));
-		ADD_CLASS(2, 1, 1, 0, SG_GET_RGB(255,  67, 162), SG_T("moderate"));
-		ADD_CLASS(2, 1, 0, 1, SG_GET_RGB(248, 206,  97), SG_T("moderate"));
-		ADD_CLASS(2, 1, 0, 0, SG_GET_RGB(248, 194, 208), SG_T("moderate"));
-
-		ADD_CLASS(2, 0, 1, 1, SG_GET_RGB(  0, 154, 111), SG_T("gentle"));
-		ADD_CLASS(2, 0, 1, 0, SG_GET_RGB(192, 182,  20), SG_T("gentle"));
-		ADD_CLASS(2, 0, 0, 1, SG_GET_RGB( 12, 106, 172), SG_T("gentle"));
-		ADD_CLASS(2, 0, 0, 0, SG_GET_RGB(207, 214,   5), SG_T("gentle"));
+		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "steep"     );	// class  1
+		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "steep"     );	// class  2
+		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "steep"     );	// class  3
+		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "steep"     );	// class  4
+
+		ADD_CLASS(2, 1, 1, 1, 0xFA9600, "moderate"  );	// class  5
+		ADD_CLASS(2, 1, 1, 0, 0xFD43A8, "moderate"  );	// class  6
+		ADD_CLASS(2, 1, 0, 1, 0xFBCF66, "moderate"  );	// class  7
+		ADD_CLASS(2, 1, 0, 0, 0xF9C4D4, "moderate"  );	// class  8
+
+		ADD_CLASS(2, 0, 1, 1, 0x66A726, "gentle"    );	// class  9
+		ADD_CLASS(2, 0, 1, 0, 0xFFFF40, "gentle"    );	// class 10
+		ADD_CLASS(2, 0, 0, 1, 0xAEFF7B, "gentle"    );	// class 11
+		ADD_CLASS(2, 0, 0, 0, 0xFFFFBF, "gentle"    );	// class 12
 		break;
 
 	default:	// 16 classes
-		ADD_CLASS(1, 1, 1, 1, SG_GET_RGB(124,  70,  44), SG_T("very steep"));
-		ADD_CLASS(1, 1, 1, 0, SG_GET_RGB(255,   0, 255), SG_T("very steep"));
-		ADD_CLASS(1, 1, 0, 1, SG_GET_RGB(190, 108,  40), SG_T("very steep"));
-		ADD_CLASS(1, 1, 0, 0, SG_GET_RGB(255, 146, 205), SG_T("very steep"));
-
-		ADD_CLASS(2, 1, 1, 1, SG_GET_RGB(248, 148,   0), SG_T("steep"));
-		ADD_CLASS(2, 1, 1, 0, SG_GET_RGB(255,  67, 162), SG_T("steep"));
-		ADD_CLASS(2, 1, 0, 1, SG_GET_RGB(248, 206,  97), SG_T("steep"));
-		ADD_CLASS(2, 1, 0, 0, SG_GET_RGB(248, 194, 208), SG_T("steep"));
-
-		ADD_CLASS(3, 1, 1, 1, SG_GET_RGB(  0, 154, 111), SG_T("moderate"));
-		ADD_CLASS(3, 1, 1, 0, SG_GET_RGB(192, 182,  20), SG_T("moderate"));
-		ADD_CLASS(3, 1, 0, 1, SG_GET_RGB( 12, 106, 172), SG_T("moderate"));
-		ADD_CLASS(3, 1, 0, 0, SG_GET_RGB(207, 214,   5), SG_T("moderate"));
-
-		ADD_CLASS(3, 0, 1, 1, SG_GET_RGB(149, 254, 139), SG_T("gentle"));
-		ADD_CLASS(3, 0, 1, 0, SG_GET_RGB(226, 233,  16), SG_T("gentle"));
-		ADD_CLASS(3, 0, 0, 1, SG_GET_RGB(  3,  56,  85), SG_T("gentle"));
-		ADD_CLASS(3, 0, 0, 0, SG_GET_RGB(237, 255, 191), SG_T("gentle"));
+		ADD_CLASS(1, 1, 1, 1, 0x7F4633, "very steep");	// class  1
+		ADD_CLASS(1, 1, 1, 0, 0xFF00FF, "very steep");	// class  2
+		ADD_CLASS(1, 1, 0, 1, 0xC16E2E, "very steep");	// class  3
+		ADD_CLASS(1, 1, 0, 0, 0xFC97CF, "very steep");	// class  4
+
+		ADD_CLASS(2, 1, 1, 1, 0xFA9600, "steep"     );	// class  5
+		ADD_CLASS(2, 1, 1, 0, 0xFD43A8, "steep"     );	// class  6
+		ADD_CLASS(2, 1, 0, 1, 0xFBCF66, "steep"     );	// class  7
+		ADD_CLASS(2, 1, 0, 0, 0xF9C4D4, "steep"     );	// class  8
+
+		ADD_CLASS(3, 1, 1, 1, 0x019E73, "moderate"  );	// class  9
+		ADD_CLASS(3, 1, 1, 0, 0xC4B71D, "moderate"  );	// class 10
+		ADD_CLASS(3, 1, 0, 1, 0x0072B1, "moderate"  );	// class 11
+		ADD_CLASS(3, 1, 0, 0, 0xD7D700, "moderate"  );	// class 12
+
+		ADD_CLASS(3, 0, 1, 1, 0xA0FD8E, "gentle"    );	// class 13
+		ADD_CLASS(3, 0, 1, 0, 0xE9E915, "gentle"    );	// class 14
+		ADD_CLASS(3, 0, 0, 1, 0x003B5B, "gentle"    );	// class 15
+		ADD_CLASS(3, 0, 0, 0, 0xF2FEC0, "gentle"    );	// class 16
 		break;
 	}
 
-	DataObject_Set_Parameter(m_pLandforms, pLUT);
-	DataObject_Set_Parameter(m_pLandforms, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-inline void CTC_Classification::Get_Class(int Level, int x, int y, bool bLastLevel)
-{
-	if( Level == 1 && (m_pSlope->is_NoData(x, y) || m_pConvexity->is_NoData(x, y) || m_pTexture->is_NoData(x, y)) )
-	{
-		m_pLandforms->Set_Value(x, y, CLASS_FLAG_NODATA);
-
-		return;
-	}
-
-	if( m_pLandforms->asInt(x, y) != 0 )
-	{
-		return;
-	}
-
-	//-----------------------------------------------------
-	if( m_pSlope->asDouble(x, y) <= m_Mean_Slope )
-	{
-		if( !bLastLevel )
-		{
-			stat_Slope		+= m_pSlope    ->asDouble(x, y);
-			stat_Convexity	+= m_pConvexity->asDouble(x, y);
-			stat_Texture	+= m_pTexture  ->asDouble(x, y);
-
-			return;
-		}
-	}
-	else
-	{
-		Level	|= CLASS_FLAG_SLOPE;
-	}
-
-	if( m_pConvexity->asDouble(x, y) > m_Mean_Convexity )
-	{
-		Level	|= CLASS_FLAG_CONVEXITY;
-	}
-
-	if( m_pTexture->asDouble(x, y) > m_Mean_Texture )
-	{
-		Level	|= CLASS_FLAG_TEXTURE;
-	}
-
-	m_pLandforms->Set_Value(x, y, Level);
+	DataObject_Set_Parameter(pLandforms, pLUT);
+	DataObject_Set_Parameter(pLandforms, "COLORS_TYPE", 1);	// Color Classification Type: Lookup Table
 }
 
 
diff --git a/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
index 4607c06..fc65b4e 100644
--- a/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
+++ b/src/modules/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h
@@ -80,27 +80,50 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CTC_Texture : public CSG_Module_Grid
+class CTC_Parameter_Base : public CSG_Module_Grid
 {
 public:
-	CTC_Texture(void);
+	CTC_Parameter_Base(void);
 
 
 protected:
 
-	virtual bool			On_Execute		(void);
+	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
+
+	void					On_Construction			(void);
+
+	bool					Get_Parameter			(CSG_Grid *pValues, CSG_Grid *pParameter);
 
 
 private:
 
 	CSG_Grid_Cell_Addressor	m_Kernel;
 
-	CSG_Grid				*m_pDEM, *m_pTexture, *m_pNoise;
+};
 
 
-	int						Get_MedianDiff	(int x, int y);
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
 
-	int						Get_Texture		(int x, int y);
+//---------------------------------------------------------
+class CTC_Texture : public CTC_Parameter_Base
+{
+public:
+	CTC_Texture(void);
+
+
+protected:
+
+	virtual bool			On_Execute				(void);
+
+
+private:
+
+	CSG_Grid				*m_pDEM;
+
+
+	int						Get_Noise				(int x, int y, double Epsilon = 0.0);
 
 };
 
@@ -110,7 +133,7 @@ private:
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-class CTC_Convexity : public CSG_Module_Grid
+class CTC_Convexity : public CTC_Parameter_Base
 {
 public:
 	CTC_Convexity(void);
@@ -118,21 +141,15 @@ public:
 
 protected:
 
-	virtual bool			On_Execute		(void);
+	virtual bool			On_Execute				(void);
 
 
 private:
 
-	int						m_dLaplace[2];
-
-	CSG_Grid_Cell_Addressor	m_Kernel;
+	CSG_Grid				*m_pDEM;
 
-	CSG_Grid				*m_pDEM, *m_pConvexity, *m_pLaplace;
 
-
-	int						Get_Laplace		(int x, int y);
-
-	int						Get_Convexity	(int x, int y);
+	int						Get_Laplace				(int x, int y, const double Kernel[2], int Type, double Epsilon);
 
 };
 
@@ -159,18 +176,17 @@ protected:
 
 private:
 
-	CSG_Simple_Statistics	stat_Slope, stat_Convexity, stat_Texture;
-
 	double					m_Mean_Slope, m_Mean_Convexity, m_Mean_Texture;
 
-	CSG_Grid				*m_pSlope, *m_pConvexity, *m_pTexture, *m_pLandforms;
+	CSG_Simple_Statistics	m_Stat_Slope, m_Stat_Convexity, m_Stat_Texture;
 
+	CSG_Grid				*m_pSlope, *m_pConvexity, *m_pTexture;
 
-	void					Set_LUT					(int nLevels);
 
 	bool					Get_Classes				(void);
+	int						Get_Class				(int Level, int x, int y, bool bLastLevel);
 
-	void					Get_Class				(int Level, int x, int y, bool bLastLevel);
+	void					Set_LUT					(CSG_Grid *pLandforms, int nLevels);
 
 };
 
diff --git a/src/saga_core/saga_api/Makefile.am b/src/saga_core/saga_api/Makefile.am
index 6aeffa5..2682bf3 100644
--- a/src/saga_core/saga_api/Makefile.am
+++ b/src/saga_core/saga_api/Makefile.am
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.am 2370 2015-01-16 14:14:52Z oconrad $
+# $Id: Makefile.am 2553 2015-08-18 12:35:01Z oconrad $
 #
 if DEBUG
 DBGFLAGS = -g -DDEBUG
@@ -23,6 +23,7 @@ otherinclude_HEADERS = api_core.h \
 compatibility.h \
 data_manager.h \
 dataobject.h \
+datetime.h \
 geo_tools.h \
 grid.h \
 grid_pyramid.h \
@@ -50,6 +51,7 @@ api_translator.cpp\
 clipper.cpp\
 data_manager.cpp\
 dataobject.cpp\
+datetime.cpp\
 geo_classes.cpp\
 geo_functions.cpp\
 grid.cpp\
@@ -109,6 +111,7 @@ api_core.h\
 clipper.hpp\
 data_manager.h\
 dataobject.h\
+datetime.h\
 geo_tools.h\
 grid.h\
 grid_pyramid.h\
diff --git a/src/saga_core/saga_api/Makefile.in b/src/saga_core/saga_api/Makefile.in
index ff7d9e4..e19a63f 100644
--- a/src/saga_core/saga_api/Makefile.in
+++ b/src/saga_core/saga_api/Makefile.in
@@ -143,18 +143,19 @@ _saga_api_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
 libsaga_api_la_LIBADD =
 am_libsaga_api_la_OBJECTS = api_callback.lo api_colors.lo api_core.lo \
 	api_file.lo api_memory.lo api_string.lo api_translator.lo \
-	clipper.lo data_manager.lo dataobject.lo geo_classes.lo \
-	geo_functions.lo grid.lo grid_io.lo grid_memory.lo \
-	grid_operation.lo grid_pyramid.lo grid_system.lo \
-	mat_formula.lo mat_grid_radius.lo mat_indexing.lo \
-	mat_matrix.lo mat_regression.lo mat_regression_multiple.lo \
-	mat_regression_weighted.lo mat_mRMR.lo mat_spline.lo \
-	mat_tools.lo mat_trend.lo metadata.lo module.lo \
-	module_chain.lo module_grid.lo module_grid_interactive.lo \
-	module_interactive.lo module_interactive_base.lo \
-	module_library.lo module_library_interface.lo parameter.lo \
-	parameter_data.lo parameters.lo pointcloud.lo projections.lo \
-	quadtree.lo saga_api.lo shape.lo shape_line.lo shape_part.lo \
+	clipper.lo data_manager.lo dataobject.lo datetime.lo \
+	geo_classes.lo geo_functions.lo grid.lo grid_io.lo \
+	grid_memory.lo grid_operation.lo grid_pyramid.lo \
+	grid_system.lo mat_formula.lo mat_grid_radius.lo \
+	mat_indexing.lo mat_matrix.lo mat_regression.lo \
+	mat_regression_multiple.lo mat_regression_weighted.lo \
+	mat_mRMR.lo mat_spline.lo mat_tools.lo mat_trend.lo \
+	metadata.lo module.lo module_chain.lo module_grid.lo \
+	module_grid_interactive.lo module_interactive.lo \
+	module_interactive_base.lo module_library.lo \
+	module_library_interface.lo parameter.lo parameter_data.lo \
+	parameters.lo pointcloud.lo projections.lo quadtree.lo \
+	saga_api.lo shape.lo shape_line.lo shape_part.lo \
 	shape_point.lo shape_points.lo shape_polygon.lo shapes.lo \
 	shapes_io.lo shapes_ogis.lo shapes_polygons.lo \
 	shapes_search.lo shapes_selection.lo table.lo table_dbase.lo \
@@ -398,7 +399,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-# $Id: Makefile.am 2370 2015-01-16 14:14:52Z oconrad $
+# $Id: Makefile.am 2553 2015-08-18 12:35:01Z oconrad $
 #
 @DEBUG_TRUE at DBGFLAGS = -g -DDEBUG
 @SAGA_PYTHON_TRUE at SAGAPYTHONFLAGS = -D_SAGA_PYTHON
@@ -413,6 +414,7 @@ otherinclude_HEADERS = api_core.h \
 compatibility.h \
 data_manager.h \
 dataobject.h \
+datetime.h \
 geo_tools.h \
 grid.h \
 grid_pyramid.h \
@@ -440,6 +442,7 @@ api_translator.cpp\
 clipper.cpp\
 data_manager.cpp\
 dataobject.cpp\
+datetime.cpp\
 geo_classes.cpp\
 geo_functions.cpp\
 grid.cpp\
@@ -499,6 +502,7 @@ api_core.h\
 clipper.hpp\
 data_manager.h\
 dataobject.h\
+datetime.h\
 geo_tools.h\
 grid.h\
 grid_pyramid.h\
@@ -652,6 +656,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/clipper.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/data_manager.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dataobject.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/datetime.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geo_classes.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geo_functions.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid.Plo at am__quote@
diff --git a/src/saga_core/saga_api/api_core.h b/src/saga_core/saga_api/api_core.h
index f88398c..6db93c5 100644
--- a/src/saga_core/saga_api/api_core.h
+++ b/src/saga_core/saga_api/api_core.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_core.h 2497 2015-06-02 14:30:08Z oconrad $
+ * Version $Id: api_core.h 2564 2015-09-01 13:06:20Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -117,6 +117,7 @@
 
 //---------------------------------------------------------
 // this is defined by configure, but will not be on a normal application build
+
 #ifndef SIZEOF_LONG
 	#if defined(__alpha) || defined(__sparcv9) || defined(__LP64__) || (defined(__HOS_AIX__) && defined(_LP64))
 		#define SIZEOF_LONG		8
@@ -148,13 +149,8 @@
 #endif	// _TYPEDEF_WORD
 
 //---------------------------------------------------------
-#if SIZEOF_LONG == 4
 	typedef   signed long long	sLong;
 	typedef unsigned long long	uLong;
-#else
-	typedef   signed long		sLong;
-	typedef unsigned long		uLong;
-#endif
 
 //---------------------------------------------------------
 #if defined(_SAGA_MSW)
@@ -352,6 +348,8 @@ public:
 	double							asDouble			(void)								const;
 	bool							asDouble			(double &Value)						const;
 
+	bool							to_ASCII			(char **pString)					const;
+
 
 protected:
 
diff --git a/src/saga_core/saga_api/api_string.cpp b/src/saga_core/saga_api/api_string.cpp
index 4d2384d..3ab5caa 100644
--- a/src/saga_core/saga_api/api_string.cpp
+++ b/src/saga_core/saga_api/api_string.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: api_string.cpp 2255 2014-09-25 16:12:38Z oconrad $
+ * Version $Id: api_string.cpp 2564 2015-09-01 13:06:20Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -795,6 +795,43 @@ bool CSG_String::asDouble(double &Value) const
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+/**
+  * This function creates a single char array and fills it
+  * with the ASCII representation of this string object.
+  * If successful pString will point to the adress of the
+  * allocated memory. Freeing memory is in response of the
+  * calling function.
+*/
+//---------------------------------------------------------
+bool CSG_String::to_ASCII(char **pString)	const
+{
+	if( is_Empty() )
+	{
+		return( false );
+	}
+
+	*pString	= (char *)SG_Malloc((1 + Length()) * sizeof(char));
+
+	if( *pString == NULL )
+	{
+		return( false );
+	}
+
+	memcpy(*pString, m_pString->ToAscii(), Length() * sizeof(char));
+
+	(*pString)[Length()]	= '\0';
+
+	return( true );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 CSG_Strings::CSG_Strings(void)
 {
 	m_nStrings	= 0;
diff --git a/src/saga_core/saga_api/data_manager.cpp b/src/saga_core/saga_api/data_manager.cpp
index 1d7b729..d4c5a52 100644
--- a/src/saga_core/saga_api/data_manager.cpp
+++ b/src/saga_core/saga_api/data_manager.cpp
@@ -103,11 +103,11 @@ CSG_Data_Collection::~CSG_Data_Collection(void)
 }
 
 //---------------------------------------------------------
-CSG_Data_Object * CSG_Data_Collection::Get(const CSG_String &File) const
+CSG_Data_Object * CSG_Data_Collection::Get(const CSG_String &File, bool bNative) const
 {
 	for(size_t i=0; i<Count(); i++)
 	{
-		if( !File.Cmp(Get(i)->Get_File_Name()) )
+		if( !File.Cmp(Get(i)->Get_File_Name(bNative)) )
 		{
 			return( Get(i) );
 		}
@@ -372,18 +372,18 @@ bool CSG_Data_Manager::Exists(CSG_Data_Object *pObject) const
 }
 
 //---------------------------------------------------------
-CSG_Data_Object *  CSG_Data_Manager::Find(const CSG_String &File) const
+CSG_Data_Object *  CSG_Data_Manager::Find(const CSG_String &File, bool bNative) const
 {
 	CSG_Data_Object	*pObject;
 
-	if( (pObject = m_pTable      ->Get(File)) != NULL )	return( pObject );
-	if( (pObject = m_pTIN        ->Get(File)) != NULL )	return( pObject );
-	if( (pObject = m_pPoint_Cloud->Get(File)) != NULL )	return( pObject );
-	if( (pObject = m_pShapes     ->Get(File)) != NULL )	return( pObject );
+	if( (pObject = m_pTable      ->Get(File, bNative)) != NULL )	return( pObject );
+	if( (pObject = m_pTIN        ->Get(File, bNative)) != NULL )	return( pObject );
+	if( (pObject = m_pPoint_Cloud->Get(File, bNative)) != NULL )	return( pObject );
+	if( (pObject = m_pShapes     ->Get(File, bNative)) != NULL )	return( pObject );
 
 	for(size_t i=0; i<Grid_System_Count(); i++)
 	{
-		if( (pObject = Get_Grid_System(i)->Get(File)) != NULL )	return( pObject );
+		if( (pObject = Get_Grid_System(i)->Get(File, bNative)) != NULL )	return( pObject );
 	}
 
 	return(	NULL );
@@ -488,8 +488,8 @@ bool CSG_Data_Manager::_Add_External(const CSG_String &File)
 		||	SG_File_Cmp_Extension(File, SG_T("jpg"))
 		||	SG_File_Cmp_Extension(File, SG_T("png"))
 		||	SG_File_Cmp_Extension(File, SG_T("pcx")) )
-	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module(SG_T("io_grid_image"), 1)) != NULL
-	&&   pImport->Get_Parameters()->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath) )
+	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module("io_grid_image", 1)) != NULL
+	&&   pImport->Set_Parameter("FILE", File, PARAMETER_TYPE_FilePath) )
 	{
 		pImport->Set_Manager(this);
 		bResult	= pImport->Execute();
@@ -500,20 +500,20 @@ bool CSG_Data_Manager::_Add_External(const CSG_String &File)
 	// GDAL Import
 
 	if( !bResult
-	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module(SG_T("io_gdal"), 0)) != NULL
-	&&   pImport->Get_Parameters()->Set_Parameter(SG_T("FILES"), File, PARAMETER_TYPE_FilePath) )
+	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module("io_gdal", 0)) != NULL
+	&&   pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
 	{
 		pImport->Set_Manager(this);
 		bResult	= pImport->Execute();
-		if( this != &g_Data_Manager )	{	pImport->Set_Manager(&g_Data_Manager);	}
+		pImport->Set_Manager(&g_Data_Manager);
 	}
 
 	//-----------------------------------------------------
 	// OGR Import
 
 	if( !bResult
-	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module(SG_T("io_gdal"), 3)) != NULL
-	&&   pImport->Get_Parameters()->Set_Parameter(SG_T("FILES"), File, PARAMETER_TYPE_FilePath) )
+	&&  (pImport = SG_Get_Module_Library_Manager().Get_Module("io_gdal", 3)) != NULL
+	&&   pImport->Set_Parameter("FILES", File, PARAMETER_TYPE_FilePath) )
 	{
 		pImport->Set_Manager(this);
 		bResult	= pImport->Execute();
diff --git a/src/saga_core/saga_api/data_manager.h b/src/saga_core/saga_api/data_manager.h
index 04d9e63..e892bcc 100644
--- a/src/saga_core/saga_api/data_manager.h
+++ b/src/saga_core/saga_api/data_manager.h
@@ -91,7 +91,7 @@ public:
 	size_t							Count				(void)		const	{	return( m_Objects.Get_Size() );	}
 
 	CSG_Data_Object *				Get					(size_t i)	const	{	return( i < Count() ? ((CSG_Data_Object **)m_Objects.Get_Array())[i] : NULL );	}
-	CSG_Data_Object *				Get					(const CSG_String &File)	const;
+	CSG_Data_Object *				Get					(const CSG_String &File, bool bNative = true)	const;
 
 	virtual bool					Exists				(CSG_Data_Object *pObject)	const;
 
@@ -195,7 +195,7 @@ public:
 	bool								Exists				(CSG_Data_Object *pObject)		const;
 	bool								Exists				(const CSG_Grid_System &System)	const;
 
-	CSG_Data_Object *					Find				(const CSG_String &File)		const;
+	CSG_Data_Object *					Find				(const CSG_String &File, bool bNative = true)	const;
 
 	CSG_String							Get_Summary			(void)	const;
 
diff --git a/src/saga_core/saga_api/dataobject.cpp b/src/saga_core/saga_api/dataobject.cpp
index be02b1c..40d8fb7 100644
--- a/src/saga_core/saga_api/dataobject.cpp
+++ b/src/saga_core/saga_api/dataobject.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dataobject.cpp 2214 2014-09-01 15:47:38Z oconrad $
+ * Version $Id: dataobject.cpp 2558 2015-08-19 14:56:36Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -144,6 +144,7 @@ CSG_Data_Object::CSG_Data_Object(void)
 	m_pProjection		= m_pMetaData->Add_Child(SG_META_SRC_PROJ);
 
 	//-----------------------------------------------------
+	m_File_bNative		= false;
 	m_File_Type			= 0;
 	m_bModified			= true;
 
@@ -193,9 +194,16 @@ void CSG_Data_Object::Set_Description(const CSG_String &Description)
 }
 
 //---------------------------------------------------------
-void CSG_Data_Object::Set_File_Name(const CSG_String &File_Name)
+void CSG_Data_Object::Set_File_Name	(const CSG_String &File_Name)
+{
+	Set_File_Name(File_Name, false);
+}
+
+//---------------------------------------------------------
+void CSG_Data_Object::Set_File_Name(const CSG_String &File_Name, bool bNative)
 {
 	m_File_Name		= File_Name;
+	m_File_bNative	= bNative;
 
 	m_Name			= SG_File_Get_Name(File_Name, false);
 
@@ -204,6 +212,18 @@ void CSG_Data_Object::Set_File_Name(const CSG_String &File_Name)
 	m_pFile->Set_Content(m_File_Name);
 }
 
+//---------------------------------------------------------
+const SG_Char * CSG_Data_Object::Get_File_Name(bool bNative)	const
+{
+	return( !bNative || m_File_bNative ? m_File_Name.c_str() : SG_T("") );
+}
+
+//---------------------------------------------------------
+int CSG_Data_Object::Get_File_Type(void)	const
+{
+	return( m_File_Type );
+}
+
 
 ///////////////////////////////////////////////////////////
 //														 //
diff --git a/src/saga_core/saga_api/dataobject.h b/src/saga_core/saga_api/dataobject.h
index cc93678..2bf2ec1 100644
--- a/src/saga_core/saga_api/dataobject.h
+++ b/src/saga_core/saga_api/dataobject.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: dataobject.h 2284 2014-10-10 10:01:30Z oconrad $
+ * Version $Id: dataobject.h 2565 2015-09-01 13:34:02Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -186,8 +186,9 @@ public:
 
 	virtual bool					Save			(const CSG_String &File_Name, int Format = 0)	= 0;
 
-	const SG_Char *					Get_File_Name	(void)	const			{	return( m_File_Name );		}
-	int								Get_File_Type	(void)	const			{	return( m_File_Type );		}
+	void							Set_File_Name	(const CSG_String &File_Name);
+	const SG_Char *					Get_File_Name	(bool bNative = true)	const;
+	int								Get_File_Type	(void)					const;
 
 	virtual bool					Assign			(CSG_Data_Object *pObject);
 
@@ -208,6 +209,7 @@ public:
 	const CSG_MetaData &			Get_History		(void)	const			{	return( *m_pHistory );		}
 
 	CSG_Projection &				Get_Projection	(void)					{	return( m_Projection );		}
+	const CSG_Projection &			Get_Projection	(void)	const			{	return( m_Projection );		}
 
 	class CSG_Table *				asTable			(void)	{	return( Get_ObjectType() == DATAOBJECT_TYPE_Table      ? (class CSG_Table      *)this : NULL );	}
 	class CSG_Shapes *				asShapes		(void)	{	return( Get_ObjectType() == DATAOBJECT_TYPE_Shapes     ? (class CSG_Shapes     *)this : NULL );	}
@@ -230,7 +232,7 @@ public:
 
 protected:
 
-	void							Set_File_Name		(const CSG_String &File_Name);
+	void							Set_File_Name		(const CSG_String &File_Name, bool bNative);
 	void							Set_File_Type		(int Type)			{	m_File_Type	= Type;			}
 
 	bool							Load_MetaData		(const SG_Char *File_Name);
@@ -244,7 +246,7 @@ protected:
 
 private:
 
-	bool							m_bModified, m_bUpdate;
+	bool							m_bModified, m_bUpdate, m_File_bNative;
 
 	int								m_File_Type;
 
diff --git a/src/saga_core/saga_api/datetime.cpp b/src/saga_core/saga_api/datetime.cpp
new file mode 100644
index 0000000..cbc2743
--- /dev/null
+++ b/src/saga_core/saga_api/datetime.cpp
@@ -0,0 +1,515 @@
+/**********************************************************
+ * Version $Id: datetime.cpp 2291 2014-10-16 13:46:55Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_API                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                     datetime.cpp                      //
+//                                                       //
+//          Copyright (C) 2015 by Olaf Conrad            //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'.                              //
+//                                                       //
+// This library is free software; you can redistribute   //
+// it and/or modify it under the terms of the GNU Lesser //
+// General Public License as published by the Free       //
+// Software Foundation, version 2.1 of the License.      //
+//                                                       //
+// This library is distributed in the hope that it will  //
+// be useful, but WITHOUT ANY WARRANTY; without even the //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU Lesser General Public //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU Lesser     //
+// General Public License along with this program; if    //
+// not, write to the Free Software Foundation, Inc.,     //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "datetime.h"
+
+#include <wx/datetime.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_TimeSpan::Format(const CSG_String &Format)	const
+{
+	wxTimeSpan	ts((wxLongLong(m_span)));
+
+	wxString	s	= !Format.is_Empty() ? ts.Format(Format.c_str()) : ts.Format(wxDefaultTimeSpanFormat);
+
+	return( CSG_String(&s) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_DateTime::CSG_DateTime(void)
+{
+	m_pDateTime	= new wxDateTime();
+}
+
+//---------------------------------------------------------
+CSG_DateTime::CSG_DateTime(const CSG_DateTime &DateTime)
+{
+	m_pDateTime	= new wxDateTime(*DateTime.m_pDateTime);
+}
+
+//---------------------------------------------------------
+CSG_DateTime::CSG_DateTime(double JDN)
+{
+	m_pDateTime	= new wxDateTime(JDN);
+}
+
+//---------------------------------------------------------
+CSG_DateTime::CSG_DateTime(TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
+{
+	m_pDateTime	= new wxDateTime(Hour, Minute, Second, Millisec);
+}
+
+//---------------------------------------------------------
+CSG_DateTime::CSG_DateTime(TSG_DateTime Day, Month Month, int Year, TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
+{
+	m_pDateTime	= new wxDateTime(Day, (wxDateTime::Month)Month, Year, Hour, Minute, Second, Millisec);
+}
+
+//---------------------------------------------------------
+CSG_DateTime::~CSG_DateTime(void)
+{
+	delete(m_pDateTime);
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set(const CSG_DateTime &DateTime)
+{
+	m_pDateTime->Set(DateTime.m_pDateTime->GetTm());
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set(double JDN)
+{
+	m_pDateTime->Set(JDN);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set(TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
+{
+	m_pDateTime->Set(Hour, Minute, Second, Millisec);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set(TSG_DateTime Day, Month Month, int Year, TSG_DateTime Hour, TSG_DateTime Minute, TSG_DateTime Second, TSG_DateTime Millisec)
+{
+	m_pDateTime->Set(Day, (wxDateTime::Month)Month, Year, Hour, Minute, Second, Millisec);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Millisecond(unsigned short Value)
+{
+	m_pDateTime->SetMillisecond(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Second(unsigned short Value)
+{
+	m_pDateTime->SetSecond(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Minute(unsigned short Value)
+{
+	m_pDateTime->SetMinute(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Hour(unsigned short Value)
+{
+	m_pDateTime->SetHour(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Day(unsigned short Value)
+{
+	m_pDateTime->SetDay(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Month(Month Value)
+{
+	m_pDateTime->SetMonth((wxDateTime::Month)Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_Year(int Value)
+{
+	m_pDateTime->SetYear(Value);
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Set_To_Current(void)
+{
+	m_pDateTime->SetToCurrent();
+
+	return( *this );
+}
+
+//---------------------------------------------------------
+CSG_DateTime & CSG_DateTime::Reset_Time(void)
+{
+	m_pDateTime->ResetTime();
+
+	return( *this );
+}
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+sLong CSG_DateTime::Get_Value(void)	const
+{
+	return( m_pDateTime->GetValue().GetValue() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_DateTime CSG_DateTime::Add(const CSG_TimeSpan &TimeSpan)	const
+{
+	CSG_DateTime	dt(*this);
+
+	return( dt.Add(TimeSpan) );
+}
+
+CSG_DateTime & CSG_DateTime::Add(const CSG_TimeSpan &TimeSpan)
+{
+	m_pDateTime->Add(wxTimeSpan((wxLongLong)TimeSpan.m_span));
+
+	return( *this);
+}
+
+//---------------------------------------------------------
+CSG_DateTime CSG_DateTime::Subtract(const CSG_TimeSpan &TimeSpan)	const
+{
+	CSG_DateTime	dt(*this);
+
+	return( dt.Subtract(TimeSpan) );
+}
+
+CSG_DateTime & CSG_DateTime::Subtract(const CSG_TimeSpan &TimeSpan)
+{
+	m_pDateTime->Subtract(wxTimeSpan((wxLongLong)TimeSpan.m_span));
+
+	return( *this);
+}
+
+//---------------------------------------------------------
+CSG_TimeSpan CSG_DateTime::Subtract(const CSG_DateTime &DateTime)	const
+{
+	CSG_TimeSpan	Span((sLong)m_pDateTime->Subtract(*DateTime.m_pDateTime).GetValue().GetValue());
+
+	return( Span );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_DateTime::is_Valid(void)	const
+{
+	return( m_pDateTime->IsValid() );
+}
+
+//---------------------------------------------------------
+unsigned short CSG_DateTime::Get_Millisecond(void)	const	{	return( m_pDateTime->GetMillisecond() );	}
+unsigned short CSG_DateTime::Get_Second     (void)	const	{	return( m_pDateTime->GetSecond     () );	}
+unsigned short CSG_DateTime::Get_Minute     (void)	const	{	return( m_pDateTime->GetMinute     () );	}
+unsigned short CSG_DateTime::Get_Hour       (void)	const	{	return( m_pDateTime->GetHour       () );	}
+unsigned short CSG_DateTime::Get_Day        (void)	const	{	return( m_pDateTime->GetDay        () );	}
+
+CSG_DateTime::Month CSG_DateTime::Get_Month(void)	const
+{
+	return( (Month)m_pDateTime->GetMonth() );
+}
+
+int CSG_DateTime::Get_Year(void)	const
+{
+	return( m_pDateTime->GetYear() );
+}
+
+//---------------------------------------------------------
+unsigned short CSG_DateTime::Get_DayOfYear(void)	const
+{
+	return( m_pDateTime->GetDayOfYear() );
+}
+
+CSG_DateTime::WeekDay CSG_DateTime::Get_WeekDay(void)	const
+{
+	return( (WeekDay)m_pDateTime->GetWeekDay() );
+}
+
+CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfMonth(void)	const
+{
+	return( (TSG_DateTime)m_pDateTime->GetWeekOfMonth() );
+}
+
+CSG_DateTime::TSG_DateTime CSG_DateTime::Get_WeekOfYear(void)	const
+{
+	return( (TSG_DateTime)m_pDateTime->GetWeekOfYear() );
+}
+
+//---------------------------------------------------------
+double CSG_DateTime::Get_JDN(void)	const
+{
+	return( m_pDateTime->GetJDN() );
+}
+
+double CSG_DateTime::Get_MJD(void)	const
+{
+	return( m_pDateTime->GetMJD() );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_DateTime::is_EarlierThan    (const CSG_DateTime &DateTime)	const	{	return( m_pDateTime->IsEarlierThan(*DateTime.m_pDateTime) );	}
+bool CSG_DateTime::is_EqualTo        (const CSG_DateTime &DateTime)	const	{	return( m_pDateTime->IsEqualTo    (*DateTime.m_pDateTime) );	}
+bool CSG_DateTime::is_LaterThan      (const CSG_DateTime &DateTime)	const	{	return( m_pDateTime->IsLaterThan  (*DateTime.m_pDateTime) );	}
+
+//---------------------------------------------------------
+bool CSG_DateTime::is_SameDate       (const CSG_DateTime &DateTime)	const	{	return( m_pDateTime->IsSameDate   (*DateTime.m_pDateTime) );	}
+bool CSG_DateTime::is_SameTime       (const CSG_DateTime &DateTime)	const	{	return( m_pDateTime->IsSameTime   (*DateTime.m_pDateTime) );	}
+
+//---------------------------------------------------------
+bool CSG_DateTime::is_Between        (const CSG_DateTime &t1, const CSG_DateTime &t2)	const	{	return( m_pDateTime->IsBetween        (*t1.m_pDateTime, *t2.m_pDateTime) );	}
+bool CSG_DateTime::is_StrictlyBetween(const CSG_DateTime &t1, const CSG_DateTime &t2)	const	{	return( m_pDateTime->IsStrictlyBetween(*t1.m_pDateTime, *t2.m_pDateTime) );	}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_String CSG_DateTime::Format(const CSG_String &Format)	const
+{
+	wxString	s(m_pDateTime->Format(Format.c_str()));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Format_Date(void)	const
+{
+	wxString	s(m_pDateTime->FormatDate());			return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Format_Time(void)	const
+{
+	wxString	s(m_pDateTime->FormatTime());			return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Format_ISODate(void)	const
+{
+	wxString	s(m_pDateTime->FormatISODate());		return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Format_ISOTime(void)	const
+{
+	wxString	s(m_pDateTime->FormatISOTime());		return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Format_ISOCombined(char sep)	const
+{
+	wxString	s(m_pDateTime->FormatISOCombined(sep));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+//---------------------------------------------------------
+bool CSG_DateTime::Parse_Date(const CSG_String &date)
+{
+	wxString::const_iterator	end;	return( m_pDateTime->ParseDate(date.c_str(), &end) );
+}
+
+bool CSG_DateTime::Parse_DateTime(const CSG_String &datetime)
+{
+	wxString::const_iterator	end;	return( m_pDateTime->ParseDateTime(datetime.c_str(), &end) );
+}
+
+bool CSG_DateTime::Parse_Format(const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef)
+{
+	wxString::const_iterator	end;	return( m_pDateTime->ParseFormat(date.c_str(), format.c_str(), *dateDef.m_pDateTime, &end) );
+}
+
+bool CSG_DateTime::Parse_Format(const CSG_String &date, const CSG_String &format)
+{
+	wxString::const_iterator	end;	return( m_pDateTime->ParseFormat(date.c_str(), format.c_str(), &end) );
+}
+
+bool CSG_DateTime::Parse_Format(const CSG_String &date)
+{
+	wxString::const_iterator	end;	return( m_pDateTime->ParseFormat(date.c_str(), &end) );
+}
+
+//---------------------------------------------------------
+bool CSG_DateTime::Parse_ISOCombined(const CSG_String &date, char sep)
+{
+	return( m_pDateTime->ParseISOCombined(date.c_str(), sep) );
+}
+
+bool CSG_DateTime::Parse_ISODate(const CSG_String &date)
+{
+	return( m_pDateTime->ParseISODate(date.c_str()) );
+}
+
+bool CSG_DateTime::Parse_ISOTime(const CSG_String &date)
+{
+	return( m_pDateTime->ParseISOTime(date.c_str()) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+CSG_DateTime::Month CSG_DateTime::Get_Current_Month(void)	{	return( (Month)wxDateTime::GetCurrentMonth() );	}
+int                 CSG_DateTime::Get_Current_Year (void)	{	return(        wxDateTime::GetCurrentYear () );	}
+
+//---------------------------------------------------------
+CSG_String CSG_DateTime::Get_MonthName(Month month, NameFlags flags)
+{
+	wxString	s(wxDateTime::GetMonthName         ((wxDateTime::Month)month    , (wxDateTime::NameFlags)flags));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Get_EnglishMonthName(Month month, NameFlags flags)
+{
+	wxString	s(wxDateTime::GetEnglishMonthName  ((wxDateTime::Month)month    , (wxDateTime::NameFlags)flags));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Get_WeekDayName(WeekDay weekday, NameFlags flags)
+{
+	wxString	s(wxDateTime::GetWeekDayName       ((wxDateTime::WeekDay)weekday, (wxDateTime::NameFlags)flags));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+CSG_String CSG_DateTime::Get_EnglishWeekDayName(WeekDay weekday, NameFlags flags)
+{
+	wxString	s(wxDateTime::GetEnglishWeekDayName((wxDateTime::WeekDay)weekday, (wxDateTime::NameFlags)flags));	return( &s ); // CSG_String _s(&s); return( _s );
+}
+
+//---------------------------------------------------------
+CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays(int year)
+{
+	return( (TSG_DateTime)wxDateTime::GetNumberOfDays(year) );
+}
+
+CSG_DateTime::TSG_DateTime CSG_DateTime::Get_NumberOfDays(Month month, int year)
+{
+	return( (TSG_DateTime)wxDateTime::GetNumberOfDays((wxDateTime::Month)month, year) );
+}
+
+//---------------------------------------------------------
+bool CSG_DateTime::is_LeapYear(int year)
+{
+	return( wxDateTime::IsLeapYear(year) );
+}
+
+//---------------------------------------------------------
+CSG_DateTime CSG_DateTime::Now(void)
+{
+	CSG_DateTime	DateTime;	*DateTime.m_pDateTime	= wxDateTime::Now();
+
+	return( DateTime );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_api/datetime.h b/src/saga_core/saga_api/datetime.h
new file mode 100644
index 0000000..a9dfa27
--- /dev/null
+++ b/src/saga_core/saga_api/datetime.h
@@ -0,0 +1,368 @@
+/**********************************************************
+ * Version $Id: datetime.h 2266 2014-10-01 15:00:52Z oconrad $
+ *********************************************************/
+
+///////////////////////////////////////////////////////////
+//                                                       //
+//                         SAGA                          //
+//                                                       //
+//      System for Automated Geoscientific Analyses      //
+//                                                       //
+//           Application Programming Interface           //
+//                                                       //
+//                  Library: SAGA_API                    //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//                      datetime.h                       //
+//                                                       //
+//          Copyright (C) 2015 by Olaf Conrad            //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+// This file is part of 'SAGA - System for Automated     //
+// Geoscientific Analyses'.                              //
+//                                                       //
+// This library is free software; you can redistribute   //
+// it and/or modify it under the terms of the GNU Lesser //
+// General Public License as published by the Free       //
+// Software Foundation, version 2.1 of the License.      //
+//                                                       //
+// This library is distributed in the hope that it will  //
+// be useful, but WITHOUT ANY WARRANTY; without even the //
+// implied warranty of MERCHANTABILITY or FITNESS FOR A  //
+// PARTICULAR PURPOSE. See the GNU Lesser General Public //
+// License for more details.                             //
+//                                                       //
+// You should have received a copy of the GNU Lesser     //
+// General Public License along with this program; if    //
+// not, write to the Free Software Foundation, Inc.,     //
+// 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, //
+// USA.                                                  //
+//                                                       //
+//-------------------------------------------------------//
+//                                                       //
+//    contact:    Olaf Conrad                            //
+//                Institute of Geography                 //
+//                University of Hamburg                  //
+//                Germany                                //
+//                                                       //
+//    e-mail:     oconrad at saga-gis.org                   //
+//                                                       //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#ifndef HEADER_INCLUDED__SAGA_API__datetime_H
+#define HEADER_INCLUDED__SAGA_API__datetime_H
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#include "api_core.h"
+
+#include <limits.h>
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+// simplified wrappers for wxDateTime and related classes.
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_TimeSpan
+{
+	friend class CSG_DateTime;
+
+public:
+
+	CSG_TimeSpan(void)						{	m_span	= 0l       ;	}
+	CSG_TimeSpan(const CSG_TimeSpan &ts)	{	m_span	= ts.m_span;	}
+	CSG_TimeSpan(const sLong &diff)			{	m_span	= diff     ;	}
+	CSG_TimeSpan(long hours, long min = 0, sLong sec = 0, sLong msec = 0)
+	{
+		m_span	= msec + 1000 * (sec + 60 * (min + 60 * hours));
+	}
+
+	//-----------------------------------------------------
+	static CSG_TimeSpan			Milliseconds			(sLong ms   )						{	return( CSG_TimeSpan(0, 0, 0, ms) );	}
+	static CSG_TimeSpan			Seconds					(sLong sec  )						{	return( CSG_TimeSpan(0, 0, sec  ) );	}
+	static CSG_TimeSpan			Minutes					(long  min  )						{	return( CSG_TimeSpan(0, min, 0  ) );	}
+	static CSG_TimeSpan			Hours					(long  hours)						{	return( CSG_TimeSpan(hours, 0, 0) );	}
+	static CSG_TimeSpan			Days					(long  days )						{	return( Hours(24 * days) );	}
+	static CSG_TimeSpan			Weeks					(long  days )						{	return( Days ( 7 * days) );	}
+
+	static CSG_TimeSpan			Millisecond				(void)								{	return( Milliseconds(1) );	}
+	static CSG_TimeSpan			Second					(void)								{	return( Seconds     (1) );	}
+	static CSG_TimeSpan			Minute					(void)								{	return( Minutes     (1) );	}
+	static CSG_TimeSpan			Hour					(void)								{	return( Hours       (1) );	}
+	static CSG_TimeSpan			Day						(void)								{	return( Days        (1) );	}
+	static CSG_TimeSpan			Week					(void)								{	return( Weeks       (1) );	}
+
+	//-----------------------------------------------------
+	CSG_TimeSpan &				Add						(const CSG_TimeSpan &ts)			{	m_span	+= ts.m_span;	return( *this );	}
+	CSG_TimeSpan &				Subtract				(const CSG_TimeSpan &ts)			{	m_span	-= ts.m_span;	return( *this );	}
+	CSG_TimeSpan &				Multiply				(int                  n)			{	m_span	*=         n;	return( *this );	}
+
+	CSG_TimeSpan &				operator +=				(const CSG_TimeSpan &ts)			{	return( Add     (ts) );	}
+	CSG_TimeSpan &				operator -=				(const CSG_TimeSpan &ts)			{	return( Subtract(ts) );	}
+	CSG_TimeSpan &				operator *=				(int                  n)			{	return( Multiply( n) );	}
+
+	CSG_TimeSpan				Add						(const CSG_TimeSpan &ts)	const	{	return( CSG_TimeSpan(m_span + ts.m_span) );	}
+	CSG_TimeSpan				Subtract				(const CSG_TimeSpan &ts)	const	{	return( CSG_TimeSpan(m_span - ts.m_span) );	}
+	CSG_TimeSpan				Multiply				(int                  n)	const	{	return( CSG_TimeSpan(m_span *         n) );	}
+
+	CSG_TimeSpan				operator +				(const CSG_TimeSpan &ts)	const	{	return( CSG_TimeSpan(m_span + ts.m_span) );	}
+	CSG_TimeSpan				operator -				(const CSG_TimeSpan &ts)	const	{	return( CSG_TimeSpan(m_span - ts.m_span) );	}
+	CSG_TimeSpan				operator *				(int                  n)	const	{	return( CSG_TimeSpan(m_span *         n) );	}
+
+	CSG_TimeSpan				Abs						(void)	const						{	return( CSG_TimeSpan(m_span >= 0l ? m_span : -m_span) );	}
+	CSG_TimeSpan				Negate					(void)	const						{	return( CSG_TimeSpan(-m_span) );	}
+	CSG_TimeSpan &				Neg						(void)								{	m_span	= -m_span;	return( *this );	}
+	CSG_TimeSpan &				operator -				(void)								{	return( Neg() );	}
+
+	bool						is_Null					(void)	const						{	return( m_span == 0l );	}
+	bool						is_Positive				(void)	const						{	return( m_span >  0l );	}
+	bool						is_Negative				(void)	const						{	return( m_span <  0l ); }
+
+	bool						operator !				(void)	const						{	return( !is_Null() );	}
+
+	bool						is_EqualTo				(const CSG_TimeSpan &ts)	const	{	return( m_span == ts.m_span );	}
+	bool						is_LongerThan			(const CSG_TimeSpan &ts)	const	{	return( m_span >  ts.m_span );	}
+	bool						is_ShorterThan			(const CSG_TimeSpan &ts)	const	{	return( m_span <  ts.m_span );	}
+
+	bool						operator <				(const CSG_TimeSpan &ts)	const	{	return( m_span <  ts.m_span );	}
+	bool						operator <=				(const CSG_TimeSpan &ts)	const	{	return( m_span <= ts.m_span );	}
+	bool						operator ==				(const CSG_TimeSpan &ts)	const	{	return( m_span == ts.m_span );	}
+	bool						operator !=				(const CSG_TimeSpan &ts)	const	{	return( m_span != ts.m_span );	}
+	bool						operator >=				(const CSG_TimeSpan &ts)	const	{	return( m_span >= ts.m_span );	}
+	bool						operator >				(const CSG_TimeSpan &ts)	const	{	return( m_span >  ts.m_span );	}
+
+	int							Get_Weeks				(void)	const						{	return(       Get_Days   () /  7  );	}
+	int							Get_Days				(void)	const						{	return(       Get_Hours  () / 24  );	}
+	int							Get_Hours				(void)	const						{	return(       Get_Minutes() / 60  );	}
+	int							Get_Minutes				(void)	const						{	return( (int)(Get_Seconds() / 60) );	}
+	sLong						Get_Seconds				(void)	const						{	return( m_span / 1000l );	}
+	sLong						Get_Milliseconds		(void)	const						{	return( m_span );	}
+	sLong						Get_Value				(void)	const						{	return( m_span );	}
+
+	CSG_String					Format					(const CSG_String &format = "")	const;
+
+
+private:
+
+	sLong						m_span;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_DateTime
+{
+public:
+
+	//-----------------------------------------------------
+	// types
+
+	typedef unsigned short	TSG_DateTime;
+
+
+	//-----------------------------------------------------
+	// constants
+
+	enum Month		// symbolic names for the months
+	{
+		Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Inv_Month
+	};
+
+	enum WeekDay	// symbolic names for the weekdays
+	{
+		Sun, Mon, Tue, Wed, Thu, Fri, Sat, Inv_WeekDay
+	};
+
+	enum Year		// invalid value for the year
+	{
+		Inv_Year	= SHRT_MIN	// should hold in wxDateTime_t
+	};
+
+	enum NameFlags	// flags for GetWeekDayName and GetMonthName
+	{
+		Name_Full	= 0x01,	// return full name
+		Name_Abbr	= 0x02	// return abbreviated name
+	};
+
+
+public:
+								
+	//-----------------------------------------------------
+	CSG_DateTime(void);
+	CSG_DateTime(const CSG_DateTime &DateTime);
+	CSG_DateTime(double JDN);
+	CSG_DateTime(                                                    TSG_DateTime Hour    , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
+	CSG_DateTime(TSG_DateTime Day, Month Month, int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
+
+	virtual ~CSG_DateTime(void);
+
+
+	//-----------------------------------------------------
+	CSG_DateTime &				Set						(const CSG_DateTime &DateTime);
+	CSG_DateTime &				Set						(double JDN);
+	CSG_DateTime &				Set						(                                                    TSG_DateTime Hour    , TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
+	CSG_DateTime &				Set						(TSG_DateTime Day, Month Month, int Year = Inv_Year, TSG_DateTime Hour = 0, TSG_DateTime Minute = 0, TSG_DateTime Second = 0, TSG_DateTime Millisec = 0);
+
+	CSG_DateTime &				Set_Millisecond			(unsigned short Value);
+	CSG_DateTime &				Set_Second				(unsigned short Value);
+	CSG_DateTime &				Set_Minute				(unsigned short Value);
+	CSG_DateTime &				Set_Hour				(unsigned short Value);
+	CSG_DateTime &				Set_Day					(unsigned short Value);
+	CSG_DateTime &				Set_Month				(Month          Value);
+	CSG_DateTime &				Set_Year				(int            Value);
+
+	CSG_DateTime &				Set_To_Current			(void);
+
+	CSG_DateTime &				Reset_Time				(void);
+
+
+	//-----------------------------------------------------
+	CSG_DateTime				Add						(const CSG_TimeSpan &TimeSpan)	const;
+	CSG_DateTime &				Add						(const CSG_TimeSpan &TimeSpan);
+
+	CSG_DateTime				Subtract				(const CSG_TimeSpan &TimeSpan)	const;
+	CSG_DateTime &				Subtract				(const CSG_TimeSpan &TimeSpan);
+
+	CSG_TimeSpan				Subtract				(const CSG_DateTime &DateTime)	const;
+
+
+	//-----------------------------------------------------
+	bool						is_Valid				(void)	const;
+
+	sLong						Get_Value				(void)	const;
+
+	unsigned short				Get_Millisecond			(void)	const;
+	unsigned short				Get_Second				(void)	const;
+	unsigned short				Get_Minute				(void)	const;
+	unsigned short				Get_Hour				(void)	const;
+
+	unsigned short				Get_Day					(void)	const;
+	Month						Get_Month				(void)	const;
+	int							Get_Year				(void)	const;
+
+	unsigned short				Get_DayOfYear			(void)	const;
+	WeekDay						Get_WeekDay				(void)	const;
+	TSG_DateTime				Get_WeekOfMonth			(void)	const;
+	TSG_DateTime				Get_WeekOfYear			(void)	const;
+
+	double						Get_JDN					(void)	const;
+	double						Get_MJD					(void)	const;
+
+
+	//-----------------------------------------------------
+	bool						is_EarlierThan			(const CSG_DateTime &DateTime)	const;
+	bool						is_EqualTo				(const CSG_DateTime &DateTime)	const;
+	bool						is_LaterThan			(const CSG_DateTime &DateTime)	const;
+
+	bool						is_SameDate				(const CSG_DateTime &DateTime)	const;
+	bool						is_SameTime				(const CSG_DateTime &DateTime)	const;
+
+	bool						is_Between				(const CSG_DateTime &t1, const CSG_DateTime &t2)	const;
+	bool						is_StrictlyBetween		(const CSG_DateTime &t1, const CSG_DateTime &t2)	const;
+
+
+	//-----------------------------------------------------
+	CSG_DateTime &				operator  =				(const CSG_DateTime &DateTime)			{	return( Set     (DateTime) );	}
+	CSG_DateTime &				operator  =				(double JDN)							{	return( Set     (     JDN) );	}
+
+	CSG_DateTime &				operator +=				(const CSG_TimeSpan &TimeSpan)			{	return( Add     (TimeSpan) );	}
+	CSG_DateTime &				operator -=				(const CSG_TimeSpan &TimeSpan)			{	return( Subtract(TimeSpan) );	}
+
+	CSG_DateTime				operator +				(const CSG_TimeSpan &TimeSpan)	const	{	return( Add     (TimeSpan) );	}
+	CSG_DateTime				operator -				(const CSG_TimeSpan &TimeSpan)	const	{	return( Subtract(TimeSpan) );	}
+
+	CSG_TimeSpan				operator -				(const CSG_DateTime &DateTime)	const	{	return( Subtract(DateTime) );	}
+
+	bool						operator <				(const CSG_DateTime &DateTime)	const	{	return( Get_Value() <  DateTime.Get_Value() );	}
+	bool						operator <=				(const CSG_DateTime &DateTime)	const	{	return( Get_Value() <= DateTime.Get_Value() );	}
+	bool						operator ==				(const CSG_DateTime &DateTime)	const	{	return( Get_Value() == DateTime.Get_Value() );	}
+	bool						operator >=				(const CSG_DateTime &DateTime)	const	{	return( Get_Value() >= DateTime.Get_Value() );	}
+	bool						operator >				(const CSG_DateTime &DateTime)	const	{	return( Get_Value() >  DateTime.Get_Value() );	}
+
+
+	//-----------------------------------------------------
+	CSG_String					Format					(const CSG_String &Format = "")	const;
+	CSG_String					Format_Date				(void)	const;
+	CSG_String					Format_Time				(void)	const;
+	CSG_String					Format_ISODate			(void)	const;
+	CSG_String					Format_ISOTime			(void)	const;
+	CSG_String					Format_ISOCombined		(char sep = 'T')	const;
+
+	bool						Parse_Date				(const CSG_String &date);
+	bool						Parse_DateTime			(const CSG_String &datetime);
+	bool						Parse_Format			(const CSG_String &date, const CSG_String &format, const CSG_DateTime &dateDef);
+	bool						Parse_Format			(const CSG_String &date, const CSG_String &format);
+	bool						Parse_Format			(const CSG_String &date);
+	bool						Parse_ISOCombined		(const CSG_String &date, char sep= 'T');
+	bool						Parse_ISODate			(const CSG_String &date);
+	bool						Parse_ISOTime			(const CSG_String &date);
+
+  
+	//-----------------------------------------------------
+	static Month				Get_Current_Month		(void);
+	static int					Get_Current_Year		(void);
+
+	static CSG_String			Get_MonthName			(Month     month, NameFlags flags = Name_Full);
+	static CSG_String			Get_EnglishMonthName	(Month     month, NameFlags flags = Name_Full);
+	static CSG_String			Get_WeekDayName			(WeekDay weekday, NameFlags flags = Name_Full);
+	static CSG_String			Get_EnglishWeekDayName	(WeekDay weekday, NameFlags flags = Name_Full);
+
+	static TSG_DateTime			Get_NumberOfDays		(             int year);
+	static TSG_DateTime			Get_NumberOfDays		(Month month, int year = Inv_Year);
+
+	static bool					is_LeapYear				(int year = Inv_Year);
+
+	static CSG_DateTime			Now						(void);
+ 
+
+
+private:
+
+	class wxDateTime			*m_pDateTime;
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+#endif // #ifndef HEADER_INCLUDED__SAGA_API__datetime_H
diff --git a/src/saga_core/saga_api/grid.cpp b/src/saga_core/saga_api/grid.cpp
index 5380f1f..7b2faeb 100644
--- a/src/saga_core/saga_api/grid.cpp
+++ b/src/saga_core/saga_api/grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid.cpp 2466 2015-04-15 13:57:31Z oconrad $
+ * Version $Id: grid.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -65,6 +65,8 @@
 //---------------------------------------------------------
 #include "grid.h"
 
+#include "data_manager.h"
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -97,7 +99,16 @@ CSG_Grid * SG_Create_Grid(const CSG_Grid &Grid)
 //---------------------------------------------------------
 CSG_Grid * SG_Create_Grid(const CSG_String &File_Name, TSG_Data_Type Type, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
 {
-	return( new CSG_Grid(File_Name, Type, Memory_Type, bLoadData) );
+	CSG_Grid	*pGrid	= new CSG_Grid(File_Name, Type, Memory_Type, bLoadData);
+
+	if( pGrid->is_Valid() )
+	{
+		return( pGrid );
+	}
+
+	delete(pGrid);
+
+	return( NULL );
 }
 
 //---------------------------------------------------------
@@ -300,7 +311,30 @@ bool CSG_Grid::Create(const CSG_Grid_System &System, TSG_Data_Type Type, TSG_Gri
 //---------------------------------------------------------
 bool CSG_Grid::Create(const CSG_String &File_Name, TSG_Data_Type Type, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
 {
-	return( _Load(File_Name, Type, Memory_Type, bLoadData) );
+	Destroy();
+
+	SG_UI_Msg_Add(CSG_String::Format(SG_T("%s: %s..."), _TL("Load grid"), File_Name.c_str()), true);
+
+	//-----------------------------------------------------
+	if( _Load(File_Name, Type, Memory_Type, bLoadData) )
+	{
+		m_bCreated	= true;
+
+		Set_Update_Flag();
+
+		SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
+
+		return( true );
+	}
+
+	//-----------------------------------------------------
+	Destroy();
+
+	SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
+
+	SG_UI_Msg_Add_Error(_TL("Grid file could not be opened."));
+
+	return( false );
 }
 
 //---------------------------------------------------------
diff --git a/src/saga_core/saga_api/grid.h b/src/saga_core/saga_api/grid.h
index b82d98e..fe3ec0a 100644
--- a/src/saga_core/saga_api/grid.h
+++ b/src/saga_core/saga_api/grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid.h 2399 2015-02-05 16:07:16Z oconrad $
+ * Version $Id: grid.h 2593 2015-09-23 07:34:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -380,6 +380,65 @@ private:	///////////////////////////////////////////////
   * CSG_Grid is the data object created for raster handling.
 */
 //---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Grid_File_Info
+{
+//---------------------------------------------------------
+public:		///////////////////////////////////////////////
+
+	//-----------------------------------------------------
+	CSG_Grid_File_Info(void);
+
+								CSG_Grid_File_Info		(const CSG_Grid_File_Info &Info);
+	bool						Create					(const CSG_Grid_File_Info &Info);
+
+								CSG_Grid_File_Info		(const CSG_String &File_Name);
+	bool						Create					(const CSG_String &File_Name);
+
+								CSG_Grid_File_Info		(const CSG_Grid &Grid);
+	bool						Create					(const CSG_Grid &Grid);
+
+	bool						Save					(const CSG_String &File_Name                                                                      , bool bBinary = true);
+	bool						Save					(const CSG_String &File_Name                      , int xStart, int yStart, int xCount, int yCount, bool bBinary = true);
+	static bool					Save					(const CSG_String &File_Name, const CSG_Grid &Grid                                                , bool bBinary = true);
+	static bool					Save					(const CSG_String &File_Name, const CSG_Grid &Grid, int xStart, int yStart, int xCount, int yCount, bool bBinary = true);
+
+
+	//-----------------------------------------------------
+	bool						m_bFlip, m_bSwapBytes;
+
+	sLong						m_Offset;
+
+	double						m_zScale, m_zOffset, m_NoData;
+
+	TSG_Data_Type				m_Type;
+
+	CSG_String					m_Name, m_Description, m_Unit, m_Data_File;
+
+	CSG_Grid_System				m_System;
+
+	CSG_Projection				m_Projection;
+
+
+private:
+
+	void						_On_Construction		(void);
+
+	int							_Get_Key				(CSG_File &Stream, CSG_String &Line);
+
+};
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//						CSG_Grid						 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+/**
+  * CSG_Grid is the data object created for raster handling.
+*/
+//---------------------------------------------------------
 class SAGA_API_DLL_EXPORT CSG_Grid : public CSG_Data_Object
 {
 //---------------------------------------------------------
@@ -675,15 +734,16 @@ public:		///////////////////////////////////////////////
 		else switch( m_Type )
 		{
 			default:	return( 0.0 );
-			case SG_DATATYPE_Byte:		Value	= ((BYTE   **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Char:		Value	= ((char   **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Word:		Value	= ((WORD   **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Short:		Value	= ((short  **)m_Values)[y][x];	break;
-			case SG_DATATYPE_DWord:		Value	= ((DWORD  **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Int:		Value	= ((int    **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Float:		Value	= ((float  **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Double:	Value	= ((double **)m_Values)[y][x];	break;
-			case SG_DATATYPE_Bit:		Value	=(((BYTE   **)m_Values)[y][x / 8] & m_Bitmask[x % 8]) == 0 ? 0.0 : 1.0;	break;
+			case SG_DATATYPE_Byte:		Value	= (double)((BYTE   **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Char:		Value	= (double)((char   **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Word:		Value	= (double)((WORD   **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Short:		Value	= (double)((short  **)m_Values)[y][x];	break;
+			case SG_DATATYPE_DWord:		Value	= (double)((DWORD  **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Int:		Value	= (double)((int    **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Long:		Value	= (double)((sLong  **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Float:		Value	= (double)((float  **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Double:	Value	= (double)((double **)m_Values)[y][x];	break;
+			case SG_DATATYPE_Bit:		Value	=(double)(((BYTE   **)m_Values)[y][x / 8] & m_Bitmask[x % 8]) == 0 ? 0.0 : 1.0;	break;
 		}
 
 		if( bScaled && is_Scaled() )
@@ -730,6 +790,7 @@ public:		///////////////////////////////////////////////
 			case SG_DATATYPE_Short:		((short  **)m_Values)[y][x]	= SG_ROUND_TO_SHORT(Value);	break;
 			case SG_DATATYPE_DWord:		((DWORD  **)m_Values)[y][x]	= SG_ROUND_TO_DWORD(Value);	break;
 			case SG_DATATYPE_Int:		((int    **)m_Values)[y][x]	= SG_ROUND_TO_INT  (Value);	break;
+			case SG_DATATYPE_Long:		((sLong  **)m_Values)[y][x]	= SG_ROUND_TO_SLONG(Value);	break;
 			case SG_DATATYPE_Float:		((float  **)m_Values)[y][x]	= (float )Value;			break;
 			case SG_DATATYPE_Double:	((double **)m_Values)[y][x]	= (double)Value;			break;
 			case SG_DATATYPE_Bit:		((BYTE   **)m_Values)[y][x / 8]	= Value != 0.0
@@ -842,8 +903,6 @@ private:	///////////////////////////////////////////////
 	bool						_Load_Native			(const CSG_String &File_Name, TSG_Grid_Memory_Type aMemory_Type, bool bLoadData);
 	bool						_Save_Native			(const CSG_String &File_Name, int xA, int yA, int xN, int yN, bool bBinary = true);
 
-	int							_Load_Native_Get_Key	(CSG_File &Stream, CSG_String &Line);
-
 	bool						_Load_Surfer			(const CSG_String &File_Name, TSG_Grid_Memory_Type aMemory_Type, bool bLoadData);
 
 	//-----------------------------------------------------
diff --git a/src/saga_core/saga_api/grid_io.cpp b/src/saga_core/saga_api/grid_io.cpp
index 7fafdb3..39176b4 100644
--- a/src/saga_core/saga_api/grid_io.cpp
+++ b/src/saga_core/saga_api/grid_io.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_io.cpp 2259 2014-09-29 15:01:52Z oconrad $
+ * Version $Id: grid_io.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -76,6 +76,8 @@
 
 #include "grid.h"
 
+#include "data_manager.h"
+
 
 ///////////////////////////////////////////////////////////
 //														 //
@@ -86,49 +88,59 @@
 //---------------------------------------------------------
 bool CSG_Grid::_Load(const CSG_String &File_Name, TSG_Data_Type Type, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
 {
-	bool	bResult;
-
-	//-----------------------------------------------------
-	Destroy();
-
 	m_Type	= Type;
 
 	//-----------------------------------------------------
-	SG_UI_Msg_Add(CSG_String::Format(SG_T("%s: %s..."), _TL("Load grid"), File_Name.c_str()), true);
-
-	if( SG_File_Cmp_Extension(File_Name, SG_T("grd")) )
+	if( _Load_Native(File_Name, Memory_Type, bLoadData) )
 	{
-		bResult	= _Load_Surfer(File_Name, Memory_Type, bLoadData);
+		Load_MetaData(File_Name);
+
+		Set_File_Name(File_Name, true);
+
+		return( true );
 	}
-	else
+
+	Set_File_Name(File_Name, false);
+
+	//-----------------------------------------------------
+	if( _Load_Surfer(File_Name, Memory_Type, bLoadData) )
 	{
-		bResult	= _Load_Native(File_Name, Memory_Type, bLoadData);
+		return( true );
 	}
 
 	//-----------------------------------------------------
-	if( bResult )
+	CSG_Data_Manager	tmpMgr;
+
+	if( tmpMgr.Add(File_Name) && tmpMgr.Get_Grid_System(0) && tmpMgr.Get_Grid_System(0)->Get(0) && tmpMgr.Get_Grid_System(0)->Get(0)->is_Valid() )
 	{
-		Set_Update_Flag();
+		CSG_Grid	*pGrid	= (CSG_Grid *)tmpMgr.Get_Grid_System(0)->Get(0);
 
-		Set_File_Name(File_Name);
+		if( pGrid->is_Cached() || pGrid->is_Compressed() )
+		{
+			return( Create(*pGrid) );
+		}
 
-		Load_MetaData(File_Name);
+		Set_Name			(pGrid->Get_Name());
+		Set_Description		(pGrid->Get_Description());
 
-		m_bCreated	= true;
+		m_System			= pGrid->m_System;
+		m_Type				= pGrid->m_Type;
+		m_Values			= pGrid->m_Values;	pGrid->m_Values	= NULL;	// take ownership of data array
 
-		SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
-	}
-	else
-	{
-		Destroy();
+		m_zOffset			= pGrid->m_zOffset;
+		m_zScale			= pGrid->m_zScale;
+		m_Unit				= pGrid->m_Unit;
 
-		SG_UI_Msg_Add(_TL("failed"), false, SG_UI_MSG_STYLE_FAILURE);
+		Get_MetaData  ()	= pGrid->Get_MetaData  ();
+		Get_Projection()	= pGrid->Get_Projection();
 
-		SG_UI_Msg_Add_Error(_TL("Grid file could not be opened."));
+		Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue());
+		
+		return( true );
 	}
 
 	//-----------------------------------------------------
-	return( bResult );
+	return( false );
 }
 
 //---------------------------------------------------------
@@ -183,7 +195,7 @@ bool CSG_Grid::Save(const CSG_String &File_Name, int Format, int xA, int yA, int
 	{
 		Set_Modified(false);
 
-		Set_File_Name(sFile_Name);
+		Set_File_Name(sFile_Name, true);
 
 		Save_MetaData(File_Name);
 
@@ -592,85 +604,25 @@ sLong SG_Grid_Cache_Check(CSG_Grid_System &m_System, int nValueBytes)
 bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
 {
 	//-----------------------------------------------------
-	CSG_File	Stream;
+	CSG_Grid_File_Info	Info;
 
-	if( !Stream.Open(File_Name, SG_FILE_R, false) )
+	if( !Info.Create(File_Name) )
 	{
 		return( false );
 	}
 
 	//-----------------------------------------------------
-	// Load Header...
-
-	bool			hdr_bFlip		= false;
-	bool			hdr_bSwapBytes	= false;
-	sLong			hdr_Offset		= 0;
-	sLong			NX				= 0;
-	sLong			NY				= 0;
-	double			Cellsize		= 0.0;
-	double			xMin			= 0.0;
-	double			yMin			= 0.0;
-	CSG_String		Data_File;
-
-	m_Type	= SG_DATATYPE_Float;	// defaults to float
+	Set_Name        (Info.m_Name);
+	Set_Description (Info.m_Description);
+	Set_Unit        (Info.m_Unit);
+	Set_NoData_Value(Info.m_NoData);
 
-	do
-	{
-		CSG_String	Value;
+	m_System		= Info.m_System;
+	m_Type			= Info.m_Type;
+	m_zScale		= Info.m_zScale;
+	m_zOffset		= Info.m_zOffset;
 
-		switch( _Load_Native_Get_Key(Stream, Value) )
-		{
-		case GRID_FILE_KEY_NAME           :	Set_Name        (Value);	break;
-		case GRID_FILE_KEY_DESCRIPTION    :	Set_Description (Value);	break;
-		case GRID_FILE_KEY_UNITNAME       :	Set_Unit        (Value);	break;
-
-		case GRID_FILE_KEY_CELLCOUNT_X    :	NX				= Value.asInt   ();	break;
-		case GRID_FILE_KEY_CELLCOUNT_Y    :	NY				= Value.asInt   ();	break;
-		case GRID_FILE_KEY_POSITION_XMIN  :	xMin			= Value.asDouble();	break;
-		case GRID_FILE_KEY_POSITION_YMIN  :	yMin			= Value.asDouble();	break;
-		case GRID_FILE_KEY_CELLSIZE       :	Cellsize		= Value.asDouble();	break;
-		case GRID_FILE_KEY_Z_FACTOR       :	m_zScale		= Value.asDouble();	break;
-		case GRID_FILE_KEY_Z_OFFSET       :	m_zOffset		= Value.asDouble();	break;
-		case GRID_FILE_KEY_NODATA_VALUE   :	Set_NoData_Value(Value.asDouble());	break;
-
-		case GRID_FILE_KEY_DATAFILE_OFFSET:	hdr_Offset		= Value.asInt();	break;
-		case GRID_FILE_KEY_BYTEORDER_BIG  :	hdr_bSwapBytes	= Value.Find(GRID_FILE_KEY_TRUE) >= 0;	break;
-		case GRID_FILE_KEY_TOPTOBOTTOM    :	hdr_bFlip		= Value.Find(GRID_FILE_KEY_TRUE) >= 0;	break;
-
-		case GRID_FILE_KEY_DATAFILE_NAME:
-			if( SG_File_Get_Path(Value).Length() > 0 )
-			{
-				Data_File	= Value;
-			}
-			else
-			{
-				Data_File	= SG_File_Make_Path(SG_File_Get_Path(File_Name), Value);
-			}
-			break;
-
-		case GRID_FILE_KEY_DATAFORMAT:
-			{
-				for(int i=0; i<SG_DATATYPE_Undefined; i++)
-				{
-					if( Value.Find(gSG_Data_Type_Identifier[i]) >= 0 )
-					{
-						m_Type	= (TSG_Data_Type)i;
-
-						break;
-					}
-				}
-			}
-			break;
-		}
-	}
-	while( !Stream.is_EOF() );
-
-	if( !m_System.Assign(Cellsize, xMin, yMin, (int)NX, (int)NY) )
-	{
-		return( false );
-	}
-
-	Get_Projection().Load(SG_File_Make_Path(NULL, File_Name, SG_T("prj")), SG_PROJ_FMT_WKT);
+	Get_Projection().Create(Info.m_Projection);
 
 	//-----------------------------------------------------
 	// Load Data...
@@ -681,28 +633,30 @@ bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 	}
 
 	//-----------------------------------------------------
+	CSG_File	Stream;
+
 	if( !SG_Data_Type_is_Numeric(m_Type) )	// ASCII...
 	{
-		if(	Stream.Open(Data_File                                       , SG_FILE_R, false)
+		if(	Stream.Open(Info.m_Data_File                                , SG_FILE_R, false)
 		||	Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T( "dat")), SG_FILE_R, false)
 		||	Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")), SG_FILE_R, false) )
 		{
-			Stream.Seek((long)hdr_Offset);
+			Stream.Seek((long)Info.m_Offset);
 
-			return( _Load_ASCII(Stream, Memory_Type, hdr_bFlip) );
+			return( _Load_ASCII(Stream, Memory_Type, Info.m_bFlip) );
 		}
 	}
 
 	//-----------------------------------------------------
 	else	// Binary...
 	{
-		if( (NX = SG_Grid_Cache_Check(m_System, Get_nValueBytes())) > 0 )
+		if( SG_Grid_Cache_Check(m_System, Get_nValueBytes()) > 0 )
 		{
-			Set_Buffer_Size(NX);
+			Set_Buffer_Size(SG_Grid_Cache_Check(m_System, Get_nValueBytes()));
 
-			if( _Cache_Create(Data_File                                       , m_Type, hdr_Offset, hdr_bSwapBytes, hdr_bFlip)
-			||	_Cache_Create(SG_File_Make_Path(NULL, File_Name, SG_T( "dat")), m_Type, hdr_Offset, hdr_bSwapBytes, hdr_bFlip)
-			||	_Cache_Create(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")), m_Type, hdr_Offset, hdr_bSwapBytes, hdr_bFlip) )
+			if( _Cache_Create(Info.m_Data_File                                , m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
+			||	_Cache_Create(SG_File_Make_Path(NULL, File_Name, SG_T( "dat")), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
+			||	_Cache_Create(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip) )
 			{
 				return( true );
 			}
@@ -712,13 +666,13 @@ bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 
 		if( _Memory_Create(Memory_Type) )
 		{
-			if(	Stream.Open(Data_File                                       , SG_FILE_R, true)
+			if(	Stream.Open(Info.m_Data_File                                , SG_FILE_R, true)
 			||	Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T( "dat")), SG_FILE_R, true)
 			||	Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")), SG_FILE_R, true) )
 			{
-				Stream.Seek((long)hdr_Offset);
+				Stream.Seek((long)Info.m_Offset);
 
-				return( _Load_Binary(Stream, m_Type, hdr_bFlip, hdr_bSwapBytes) );
+				return( _Load_Binary(Stream, m_Type, Info.m_bFlip, Info.m_bSwapBytes) );
 			}
 		}
 	}
@@ -729,56 +683,30 @@ bool CSG_Grid::_Load_Native(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 //---------------------------------------------------------
 bool CSG_Grid::_Save_Native(const CSG_String &File_Name, int xA, int yA, int xN, int yN, bool bBinary)
 {
-#ifdef WORDS_BIGENDIAN
-	bool		bBigEndian	= true;
-#else
-	bool		bBigEndian	= false;
-#endif
-
-	bool		bResult		= false;
-	CSG_File	Stream;
+	CSG_Grid_File_Info	Info(*this);
 
-	if(	Stream.Open(File_Name, SG_FILE_W, false) )
+	if(	Info.Save(File_Name, bBinary) )
 	{
-		//-------------------------------------------------
-		// Header...
-
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_NAME           ], Get_Name() );
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DESCRIPTION    ], Get_Description() );
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_UNITNAME       ], Get_Unit() );
-		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DATAFILE_OFFSET], 0 );
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DATAFORMAT     ], bBinary ? gSG_Data_Type_Identifier[Get_Type()] : SG_T("ASCII") );
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_BYTEORDER_BIG  ], bBigEndian ? GRID_FILE_KEY_TRUE : GRID_FILE_KEY_FALSE );
-		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_POSITION_XMIN  ], Get_XMin() + Get_Cellsize() * xA );
-		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_POSITION_YMIN  ], Get_YMin() + Get_Cellsize() * yA );
-		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLCOUNT_X    ], xN );
-		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLCOUNT_Y    ], yN );
-		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLSIZE       ], Get_Cellsize() );
-		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_Z_FACTOR       ], m_zScale );
-		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_Z_OFFSET       ], m_zOffset );
-		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_NODATA_VALUE   ], Get_NoData_Value() );
-		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_TOPTOBOTTOM    ], GRID_FILE_KEY_FALSE );
-
-
-		//-------------------------------------------------
-		// Data...
+		CSG_File	Stream;
 
 		if( Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")), SG_FILE_W, true) )
 		{
 			if( bBinary )
 			{
-				bResult		= _Save_Binary	(Stream, xA, yA, xN, yN, Get_Type(), false, bBigEndian);
+#ifdef WORDS_BIGENDIAN
+				return( _Save_Binary(Stream, xA, yA, xN, yN, m_Type, false,  true) );
+#else
+				return( _Save_Binary(Stream, xA, yA, xN, yN, m_Type, false, false) );
+#endif
 			}
 			else
 			{
-				bResult		= _Save_ASCII	(Stream, xA, yA, xN, yN);
+				return( _Save_ASCII (Stream, xA, yA, xN, yN) );
 			}
 		}
-
-		Get_Projection().Save(SG_File_Make_Path(NULL, File_Name, SG_T("prj")), SG_PROJ_FMT_WKT);
 	}
 
-	return( bResult );
+	return( false );
 }
 
 
@@ -789,42 +717,13 @@ bool CSG_Grid::_Save_Native(const CSG_String &File_Name, int xA, int yA, int xN,
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-int CSG_Grid::_Load_Native_Get_Key(CSG_File &Stream, CSG_String &Value)
+bool CSG_Grid::_Load_Surfer(const CSG_String &File_Name, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
 {
-	int			i;
-	CSG_String	sLine;
-
-	if( Stream.Read_Line(sLine) && (i = sLine.Find('=')) > 0 )
+	if( !SG_File_Cmp_Extension(File_Name, SG_T("grd")) )
 	{
-		Value	= sLine.AfterFirst('=');
-		Value.Trim();
-
-		sLine.Remove(i);
-
-		for(i=0; i<GRID_FILE_KEY_Count; i++)
-		{
-			CSG_String	s(gSG_Grid_File_Key_Names[i]);
-
-			if( s.Find(sLine.Left(s.Length())) >= 0 )
-			{
-				return( i );
-			}
-		}
+		return( false );
 	}
 
-	return( -1 );
-}
-
-
-///////////////////////////////////////////////////////////
-//														 //
-//														 //
-//														 //
-///////////////////////////////////////////////////////////
-
-//---------------------------------------------------------
-bool CSG_Grid::_Load_Surfer(const CSG_String &File_Name, TSG_Grid_Memory_Type Memory_Type, bool bLoadData)
-{
 	//-----------------------------------------------------
 	CSG_File	Stream;
 
@@ -945,3 +844,265 @@ bool CSG_Grid::_Load_Surfer(const CSG_String &File_Name, TSG_Grid_Memory_Type Me
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+CSG_Grid_File_Info::CSG_Grid_File_Info(void)
+{
+	_On_Construction();
+}
+
+void CSG_Grid_File_Info::_On_Construction(void)
+{
+	m_Name			.Clear();
+	m_Description	.Clear();
+	m_Unit			.Clear();
+	m_System		.Assign(0.0, 0.0, 0.0, 0, 0);
+	m_Type			= SG_DATATYPE_Float;	// defaults to float
+	m_zScale		= 1.0;
+	m_zOffset		= 0;
+	m_NoData		= -99999.0;
+	m_Data_File		.Clear();
+	m_bFlip			= false;
+	m_bSwapBytes	= false;
+	m_Offset		= 0;
+	m_Projection	.Destroy();
+}
+
+//---------------------------------------------------------
+CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_Grid_File_Info &Info)
+{
+	Create(Info);
+}
+
+bool CSG_Grid_File_Info::Create(const CSG_Grid_File_Info &Info)
+{
+	m_Name			= Info.m_Name;
+	m_Description	= Info.m_Description;
+	m_Unit			= Info.m_Unit;
+	m_System		= Info.m_System;
+	m_Type			= Info.m_Type;
+	m_zScale		= Info.m_zScale;
+	m_zOffset		= Info.m_zOffset;
+	m_NoData		= Info.m_NoData;
+	m_Data_File		= Info.m_Data_File;
+	m_bFlip			= Info.m_bFlip;
+	m_bSwapBytes	= Info.m_bSwapBytes;
+	m_Offset		= Info.m_Offset;
+	m_Projection	= Info.m_Projection;
+
+	return( true );
+}
+
+//---------------------------------------------------------
+CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_Grid &Grid)
+{
+	Create(Grid);
+}
+
+bool CSG_Grid_File_Info::Create(const CSG_Grid &Grid)
+{
+	m_Name			= Grid.Get_Name();
+	m_Description	= Grid.Get_Description();
+	m_Unit			= Grid.Get_Unit();
+	m_System		= Grid.Get_System();
+	m_Type			= Grid.Get_Type();
+	m_zScale		= Grid.Get_Scaling();
+	m_zOffset		= Grid.Get_Offset();
+	m_NoData		= Grid.Get_NoData_Value();
+	m_Data_File		.Clear();
+	m_bFlip			= false;
+	m_bSwapBytes	= false;
+	m_Offset		= 0;
+	m_Projection	= Grid.Get_Projection();
+
+	return( true );
+}
+
+//---------------------------------------------------------
+CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_String &File_Name)
+{
+	Create(File_Name);
+}
+
+bool CSG_Grid_File_Info::Create(const CSG_String &File_Name)
+{
+	_On_Construction();
+
+	//-----------------------------------------------------
+	CSG_File	Stream;
+
+	if( !Stream.Open(File_Name, SG_FILE_R, false) )
+	{
+		return( false );
+	}
+
+	//-----------------------------------------------------
+	sLong	NX = 0, NY = 0;
+	double	Cellsize = 0.0, xMin = 0.0, yMin = 0.0;
+
+	do
+	{
+		CSG_String	Value;
+
+		switch( _Get_Key(Stream, Value) )
+		{
+		case GRID_FILE_KEY_NAME           :	m_Name        = Value;	break;
+		case GRID_FILE_KEY_DESCRIPTION    :	m_Description = Value;	break;
+		case GRID_FILE_KEY_UNITNAME       :	m_Unit        = Value;	break;
+
+		case GRID_FILE_KEY_CELLCOUNT_X    :	NX            = Value.asInt   ();	break;
+		case GRID_FILE_KEY_CELLCOUNT_Y    :	NY            = Value.asInt   ();	break;
+		case GRID_FILE_KEY_POSITION_XMIN  :	xMin          = Value.asDouble();	break;
+		case GRID_FILE_KEY_POSITION_YMIN  :	yMin          = Value.asDouble();	break;
+		case GRID_FILE_KEY_CELLSIZE       :	Cellsize      = Value.asDouble();	break;
+
+		case GRID_FILE_KEY_Z_FACTOR       :	m_zScale      = Value.asDouble();	break;
+		case GRID_FILE_KEY_Z_OFFSET       :	m_zOffset     = Value.asDouble();	break;
+		case GRID_FILE_KEY_NODATA_VALUE   :	m_NoData      = Value.asDouble();	break;
+
+		case GRID_FILE_KEY_DATAFILE_OFFSET:	m_Offset      = Value.asInt   ();	break;
+		case GRID_FILE_KEY_BYTEORDER_BIG  :	m_bSwapBytes  = Value.Find(GRID_FILE_KEY_TRUE) >= 0;	break;
+		case GRID_FILE_KEY_TOPTOBOTTOM    :	m_bFlip       = Value.Find(GRID_FILE_KEY_TRUE) >= 0;	break;
+
+		case GRID_FILE_KEY_DATAFILE_NAME:
+			if( SG_File_Get_Path(Value).Length() > 0 )
+			{
+				m_Data_File	= Value;
+			}
+			else
+			{
+				m_Data_File	= SG_File_Make_Path(SG_File_Get_Path(File_Name), Value);
+			}
+			break;
+
+		case GRID_FILE_KEY_DATAFORMAT:
+			{
+				for(int i=0; i<SG_DATATYPE_Undefined; i++)
+				{
+					if( Value.Find(gSG_Data_Type_Identifier[i]) >= 0 )
+					{
+						m_Type	= (TSG_Data_Type)i;
+
+						break;
+					}
+				}
+			}
+			break;
+		}
+	}
+	while( !Stream.is_EOF() );
+
+	//-----------------------------------------------------
+	m_Projection.Load(SG_File_Make_Path(NULL, File_Name, SG_T("prj")), SG_PROJ_FMT_WKT);
+
+	if( !m_System.Assign(Cellsize, xMin, yMin, (int)NX, (int)NY) )
+	{
+		return( false );
+	}
+
+	return( true );
+}
+
+//---------------------------------------------------------
+int CSG_Grid_File_Info::_Get_Key(CSG_File &Stream, CSG_String &Value)
+{
+	int			i;
+	CSG_String	sLine;
+
+	if( Stream.Read_Line(sLine) && (i = sLine.Find('=')) > 0 )
+	{
+		Value	= sLine.AfterFirst('=');
+		Value.Trim();
+
+		sLine.Remove(i);
+
+		for(i=0; i<GRID_FILE_KEY_Count; i++)
+		{
+			CSG_String	s(gSG_Grid_File_Key_Names[i]);
+
+			if( s.Find(sLine.Left(s.Length())) >= 0 )
+			{
+				return( i );
+			}
+		}
+	}
+
+	return( -1 );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+bool CSG_Grid_File_Info::Save(const CSG_String &File_Name, bool bBinary)
+{
+	return( Save(File_Name, 0, 0, m_System.Get_NX(), m_System.Get_NY(), bBinary) );
+}
+
+//---------------------------------------------------------
+bool CSG_Grid_File_Info::Save(const CSG_String &File_Name, int xStart, int yStart, int xCount, int yCount, bool bBinary)
+{
+	CSG_File	Stream;
+
+	if(	Stream.Open(File_Name, SG_FILE_W, false) )
+	{
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_NAME           ], m_Name       .c_str()   );
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DESCRIPTION    ], m_Description.c_str()   );
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_UNITNAME       ], m_Unit       .c_str()   );
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DATAFORMAT     ], bBinary ? gSG_Data_Type_Identifier[m_Type] : SG_T("ASCII") );
+		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_DATAFILE_OFFSET], 0                       );
+#ifdef WORDS_BIGENDIAN
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_BYTEORDER_BIG  ], true                    );
+#else
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_BYTEORDER_BIG  ], false                   );
+#endif
+		Stream.Printf("%s\t= %s\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_TOPTOBOTTOM    ], GRID_FILE_KEY_FALSE     );
+		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_POSITION_XMIN  ], xStart * m_System.Get_Cellsize() + m_System.Get_XMin() );
+		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_POSITION_YMIN  ], yStart * m_System.Get_Cellsize() + m_System.Get_YMin() );
+		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLCOUNT_X    ], xCount                  );
+		Stream.Printf("%s\t= %d\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLCOUNT_Y    ], yCount                  );
+		Stream.Printf("%s\t= %.10f\n", gSG_Grid_File_Key_Names[GRID_FILE_KEY_CELLSIZE       ], m_System.Get_Cellsize() );
+		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_Z_FACTOR       ], m_zScale                );
+		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_Z_OFFSET       ], m_zOffset               );
+		Stream.Printf("%s\t= %f\n"   , gSG_Grid_File_Key_Names[GRID_FILE_KEY_NODATA_VALUE   ], m_NoData                );
+
+		if( m_Projection.is_Okay() )
+		{
+			m_Projection.Save(SG_File_Make_Path(NULL, File_Name, SG_T("prj")), SG_PROJ_FMT_WKT);
+
+			if( Stream.Open(SG_File_Make_Path(NULL, File_Name, SG_T("sdat")) + ".aux.xml", SG_FILE_W, false) )	// store srs information that is recognized by ArcGIS
+			{
+				Stream.Write("<PAMDataset>\n<SRS>");
+				Stream.Write(m_Projection.Get_WKT());
+				Stream.Write("</SRS>\n</PAMDataset>\n");
+			}
+		}
+
+		return( true );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CSG_Grid_File_Info::Save(const CSG_String &File_Name, const CSG_Grid &Grid, bool bBinary)
+{
+	return( Save(File_Name, Grid, 0, 0, Grid.Get_NX(), Grid.Get_NY(), bBinary) );
+}
+
+//---------------------------------------------------------
+bool CSG_Grid_File_Info::Save(const CSG_String &File_Name, const CSG_Grid &Grid, int xStart, int yStart, int xCount, int yCount, bool bBinary)
+{
+	CSG_Grid_File_Info	Info(Grid);
+
+	return( Info.Save(File_Name, xStart, yStart, xCount, yCount, bBinary) );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_api/grid_memory.cpp b/src/saga_core/saga_api/grid_memory.cpp
index 5a026d6..fa4b2ea 100644
--- a/src/saga_core/saga_api/grid_memory.cpp
+++ b/src/saga_core/saga_api/grid_memory.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: grid_memory.cpp 2242 2014-09-22 13:27:38Z oconrad $
+ * Version $Id: grid_memory.cpp 2593 2015-09-23 07:34:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -426,40 +426,16 @@ void CSG_Grid::_LineBuffer_Set_Value(int x, int y, double Value)
 	{
 		switch( m_Type )
 		{
-		default:
-			break;
-
-		case SG_DATATYPE_Byte:
-			((BYTE   *)pLine->Data)[x]	= (BYTE  )Value;
-			break;
-
-		case SG_DATATYPE_Char:
-			((char   *)pLine->Data)[x]	= (char  )Value;
-			break;
-
-		case SG_DATATYPE_Word:
-			((WORD   *)pLine->Data)[x]	= (WORD  )Value;
-			break;
-
-		case SG_DATATYPE_Short:
-			((short  *)pLine->Data)[x]	= (short )Value;
-			break;
-
-		case SG_DATATYPE_DWord:
-			((DWORD  *)pLine->Data)[x]	= (DWORD )Value;
-			break;
-
-		case SG_DATATYPE_Int:
-			((int    *)pLine->Data)[x]	= (int   )Value;
-			break;
-
-		case SG_DATATYPE_Float:
-			((float  *)pLine->Data)[x]	= (float )Value;
-			break;
-
-		case SG_DATATYPE_Double:
-			((double *)pLine->Data)[x]	= (double)Value;
-			break;
+		case SG_DATATYPE_Byte  :	((BYTE   *)pLine->Data)[x]	= (BYTE  )Value;	break;
+		case SG_DATATYPE_Char  :	((char   *)pLine->Data)[x]	= (char  )Value;	break;
+		case SG_DATATYPE_Word  :	((WORD   *)pLine->Data)[x]	= (WORD  )Value;	break;
+		case SG_DATATYPE_Short :	((short  *)pLine->Data)[x]	= (short )Value;	break;
+		case SG_DATATYPE_DWord :	((DWORD  *)pLine->Data)[x]	= (DWORD )Value;	break;
+		case SG_DATATYPE_Int   :	((int    *)pLine->Data)[x]	= (int   )Value;	break;
+		case SG_DATATYPE_Long  :	((sLong  *)pLine->Data)[x]	= (int   )Value;	break;
+		case SG_DATATYPE_Float :	((float  *)pLine->Data)[x]	= (float )Value;	break;
+		case SG_DATATYPE_Double:	((double *)pLine->Data)[x]	= (double)Value;	break;
+		default:	break;
 		}
 
 		pLine->bModified	= true;
@@ -475,32 +451,16 @@ double CSG_Grid::_LineBuffer_Get_Value(int x, int y) const
 	{
 		switch( m_Type )
 		{
-		default:
-			break;
-
-		case SG_DATATYPE_Byte:
-			return( ((BYTE   *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Char:
-			return( ((char   *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Word:
-			return( ((WORD   *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Short:
-			return( ((short  *)pLine->Data)[x] );
-
-		case SG_DATATYPE_DWord:
-			return( ((DWORD  *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Int:
-			return( ((int    *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Float:
-			return( ((float  *)pLine->Data)[x] );
-
-		case SG_DATATYPE_Double:
-			return( ((double *)pLine->Data)[x] );
+		case SG_DATATYPE_Byte  :	return( (double)((BYTE   *)pLine->Data)[x] );
+		case SG_DATATYPE_Char  :	return( (double)((char   *)pLine->Data)[x] );
+		case SG_DATATYPE_Word  :	return( (double)((WORD   *)pLine->Data)[x] );
+		case SG_DATATYPE_Short :	return( (double)((short  *)pLine->Data)[x] );
+		case SG_DATATYPE_DWord :	return( (double)((DWORD  *)pLine->Data)[x] );
+		case SG_DATATYPE_Int   :	return( (double)((int    *)pLine->Data)[x] );
+		case SG_DATATYPE_Long  :	return( (double)((sLong  *)pLine->Data)[x] );
+		case SG_DATATYPE_Float :	return( (double)((float  *)pLine->Data)[x] );
+		case SG_DATATYPE_Double:	return( (double)((double *)pLine->Data)[x] );
+		default:	break;
 		}
 	}
 
diff --git a/src/saga_core/saga_api/mat_tools.cpp b/src/saga_core/saga_api/mat_tools.cpp
index 4226ae2..e501064 100644
--- a/src/saga_core/saga_api/mat_tools.cpp
+++ b/src/saga_core/saga_api/mat_tools.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_tools.cpp 2457 2015-03-23 11:27:57Z oconrad $
+ * Version $Id: mat_tools.cpp 2595 2015-09-23 12:32:10Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -340,6 +340,9 @@ bool CSG_Simple_Statistics::Create(const CSG_Simple_Statistics &Statistics)
 	m_Variance		= Statistics.m_Variance;
 	m_StdDev		= Statistics.m_StdDev;
 
+	m_Kurtosis		= Statistics.m_Kurtosis;
+	m_Skewness		= Statistics.m_Skewness;
+
 	m_bSorted		= Statistics.m_bSorted;
 	m_Values		.Create(Statistics.m_Values);
 
@@ -348,7 +351,9 @@ bool CSG_Simple_Statistics::Create(const CSG_Simple_Statistics &Statistics)
 
 bool CSG_Simple_Statistics::Create(double Mean, double StdDev, sLong Count)
 {
-	m_bEvaluated	= true;
+	Invalidate();
+
+	m_bEvaluated	= 1;
 
 	m_Mean			= Mean;
 	m_StdDev		= StdDev;
@@ -363,9 +368,6 @@ bool CSG_Simple_Statistics::Create(double Mean, double StdDev, sLong Count)
 	m_Maximum		= m_Mean + 1.5 * m_StdDev;
 	m_Range			= m_Maximum - m_Minimum;
 
-	m_bSorted		= false;
-	m_Values		.Destroy();
-
 	return( true );
 }
 
@@ -387,7 +389,7 @@ bool CSG_Simple_Statistics::Create(const CSG_Vector &Values, bool bHoldValues)
 //---------------------------------------------------------
 void CSG_Simple_Statistics::Invalidate(void)
 {
-	m_bEvaluated	= false;
+	m_bEvaluated	= 0;
 
 	m_nValues		= 0;
 	m_Weights		= 0.0;
@@ -401,6 +403,9 @@ void CSG_Simple_Statistics::Invalidate(void)
 	m_Variance		= 0.0;
 	m_StdDev		= 0.0;
 
+	m_Kurtosis		= 0.0;
+	m_Skewness		= 0.0;
+
 	m_bSorted		= false;
 	m_Values		.Destroy();
 }
@@ -444,7 +449,10 @@ void CSG_Simple_Statistics::Add(const CSG_Simple_Statistics &Statistics)
 	if( m_Maximum < Statistics.m_Maximum )
 		m_Maximum	= Statistics.m_Maximum;
 
-	m_bEvaluated	= false;
+	m_Kurtosis		= 0.0;
+	m_Skewness		= 0.0;
+
+	m_bEvaluated	= 0;
 	m_bSorted		= false;
 }
 
@@ -470,7 +478,7 @@ void CSG_Simple_Statistics::Add_Value(double Value, double Weight)
 		m_Sum			+= Weight * Value;
 		m_Sum2			+= Weight * Value*Value;
 
-		m_bEvaluated	= false;
+		m_bEvaluated	= 0;
 	}
 
 	if( m_Values.Get_Value_Size() > 0 && m_Values.Inc_Array() )
@@ -484,21 +492,57 @@ void CSG_Simple_Statistics::Add_Value(double Value, double Weight)
 }
 
 //---------------------------------------------------------
-void CSG_Simple_Statistics::_Evaluate(void)
+void CSG_Simple_Statistics::_Evaluate(int Level)
 {
-	if( m_Weights > 0.0 )
+	if( m_bEvaluated == 0 && m_Weights > 0.0 )
 	{
+		m_bEvaluated	= 1;
+
 		m_Range			= m_Maximum - m_Minimum;
 		m_Mean			= m_Sum  / m_Weights;
 		m_Variance		= m_Sum2 / m_Weights - m_Mean*m_Mean;
 		m_StdDev		= m_Variance > 0.0 ? sqrt(m_Variance) : 0.0;
+	}
+
+	//-----------------------------------------------------
+	if( m_bEvaluated == 1 && Level > 1 )
+	{
+		m_bEvaluated	= 2;
+
+		m_Kurtosis		= 0.0;
+		m_Skewness		= 0.0;
+
+		if( Get_StdDev() > 0.0 && m_Values.Get_Size() > 0 )
+		{
+			for(int i=0; i<Get_Count(); i++)
+			{
+				double	d	= (Get_Value(i) - Get_Mean()) / Get_StdDev();
+
+				m_Kurtosis	+= d*d*d*d;
+				m_Skewness	+= d*d*d;
+			}
 
-		m_bEvaluated	= true;
+			m_Kurtosis	/= Get_Count();
+			m_Skewness	/= Get_Count();
+		//	m_Skewness	*= Get_Count() / ((Get_Count() - 1) * (Get_Count() - 2));
+		}
 	}
 }
 
 //---------------------------------------------------------
 /**
+  * Skewness after Pearson, i.e. the difference of mean and
+  * median divided by standard deviation.
+  * Remark: Skewness calculation is only possible, if statistics
+  * has been created with the bHoldValues flag set to true.
+*/
+double CSG_Simple_Statistics::Get_SkewnessPearson(void)
+{
+	return( Get_StdDev() != 0.0 ? (Get_Mean() - Get_Median()) / Get_StdDev() : 0.0 );
+}
+
+//---------------------------------------------------------
+/**
   * The quantile is expected to be given as percentage.
   * A percentage of 50 returns the median. Remark:
   * Quantile calculation is only possible, if statistics
@@ -529,18 +573,6 @@ double CSG_Simple_Statistics::Get_Quantile(double Quantile)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-CSG_Class_Statistics::CSG_Class_Statistics(void)
-{
-	Create();
-}
-
-//---------------------------------------------------------
-CSG_Class_Statistics::~CSG_Class_Statistics(void)
-{
-	Destroy();
-}
-
-//---------------------------------------------------------
 void CSG_Class_Statistics::Create(void)
 {
 	m_Array.Create(sizeof(TClass), 0, SG_ARRAY_GROWTH_1);
@@ -549,19 +581,13 @@ void CSG_Class_Statistics::Create(void)
 }
 
 //---------------------------------------------------------
-void CSG_Class_Statistics::Destroy(void)
-{
-	m_Array.Set_Array(0, (void **)&m_Classes);
-}
-
-//---------------------------------------------------------
 void CSG_Class_Statistics::Add_Value(double Value)
 {
 	for(size_t i=0; i<m_Array.Get_Size(); i++)
 	{
 		if( m_Classes[i].Value == Value )
 		{
-			m_Classes[i].Count++;
+			m_Classes[i].Count  ++;
 
 			return;
 		}
@@ -590,20 +616,59 @@ int CSG_Class_Statistics::Get_Majority(void)
 	return( Index );
 }
 
-bool CSG_Class_Statistics::Get_Majority(double &Value)
+//---------------------------------------------------------
+int CSG_Class_Statistics::Get_Minority(void)
 {
-	int		Count;
+	int		Index	= 0;
 
-	return( Get_Class(Get_Majority(), Value, Count) );
+	for(int i=1; i<Get_Count(); i++)
+	{
+		if( m_Classes[i].Count > m_Classes[Index].Count )
+		{
+			Index	= i;
+		}
+	}
+
+	return( Index );
 }
 
-bool CSG_Class_Statistics::Get_Majority(double &Value, int &Count)
+
+///////////////////////////////////////////////////////////
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
+void CSG_Class_Statistics_Weighted::Create(void)
 {
-	return( Get_Class(Get_Majority(), Value, Count) && Count > 0 );
+	m_Array.Create(sizeof(TClass), 0, SG_ARRAY_GROWTH_1);
+
+	m_Classes	= NULL;
 }
 
 //---------------------------------------------------------
-int CSG_Class_Statistics::Get_Minority(void)
+void CSG_Class_Statistics_Weighted::Add_Value(double Value, double Weight)
+{
+	for(size_t i=0; i<m_Array.Get_Size(); i++)
+	{
+		if( m_Classes[i].Value == Value )
+		{
+			m_Classes[i].Count  ++;
+			m_Classes[i].Weight	+= Weight;
+
+			return;
+		}
+	}
+
+	if( m_Array.Inc_Array((void **)&m_Classes) )
+	{
+		m_Classes[Get_Count() - 1].Count	= 1;
+		m_Classes[Get_Count() - 1].Value	= Value;
+		m_Classes[Get_Count() - 1].Weight	= Weight;
+	}
+}
+
+//---------------------------------------------------------
+int CSG_Class_Statistics_Weighted::Get_Majority(void)
 {
 	int		Index	= 0;
 
@@ -618,17 +683,27 @@ int CSG_Class_Statistics::Get_Minority(void)
 	return( Index );
 }
 
-bool CSG_Class_Statistics::Get_Minority(double &Value)
+bool CSG_Class_Statistics_Weighted::Get_Majority(double &Value            )	{	int	Count; return( Get_Class(Get_Majority(), Value, Count) );	}
+bool CSG_Class_Statistics_Weighted::Get_Majority(double &Value, int &Count)	{	           return( Get_Class(Get_Majority(), Value, Count) && Count > 0 );	}
+
+//---------------------------------------------------------
+int CSG_Class_Statistics_Weighted::Get_Minority(void)
 {
-	int		Count;
+	int		Index	= 0;
 
-	return( Get_Class(Get_Minority(), Value, Count) );
-}
+	for(int i=1; i<Get_Count(); i++)
+	{
+		if( m_Classes[i].Count > m_Classes[Index].Count )
+		{
+			Index	= i;
+		}
+	}
 
-bool CSG_Class_Statistics::Get_Minority(double &Value, int &Count)
-{
-	return( Get_Class(Get_Minority(), Value, Count) );
+	return( Index );
 }
+
+bool CSG_Class_Statistics_Weighted::Get_Minority(double &Value            )	{	int	Count; return( Get_Class(Get_Minority(), Value, Count) );	}
+bool CSG_Class_Statistics_Weighted::Get_Minority(double &Value, int &Count)	{	           return( Get_Class(Get_Minority(), Value, Count) && Count > 0 );	}
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/mat_tools.h b/src/saga_core/saga_api/mat_tools.h
index 11850ff..4ebbf12 100644
--- a/src/saga_core/saga_api/mat_tools.h
+++ b/src/saga_core/saga_api/mat_tools.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: mat_tools.h 2452 2015-03-20 14:37:10Z oconrad $
+ * Version $Id: mat_tools.h 2589 2015-09-18 15:40:49Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -559,18 +559,22 @@ public:
 
 	void						Invalidate			(void);
 
-	bool						is_Evaluated		(void)	const	{	return( m_bEvaluated );	}
+	int							is_Evaluated		(void)	const	{	return( m_bEvaluated );	}
 
 	sLong						Get_Count			(void)	const	{	return( m_nValues );	}
 	double						Get_Weights			(void)	const	{	return( m_Weights );	}
 
-	double						Get_Minimum			(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Minimum	);	}
-	double						Get_Maximum			(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Maximum	);	}
-	double						Get_Range			(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Range	);	}
-	double						Get_Sum				(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Sum		);	}
-	double						Get_Mean			(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Mean		);	}
-	double						Get_Variance		(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_Variance	);	}
-	double						Get_StdDev			(void)		{	if( !m_bEvaluated )	_Evaluate(); return( m_StdDev	);	}
+	double						Get_Minimum			(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Minimum  );	}
+	double						Get_Maximum			(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Maximum  );	}
+	double						Get_Range			(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Range    );	}
+	double						Get_Sum				(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Sum      );	}
+	double						Get_Mean			(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Mean     );	}
+	double						Get_Variance		(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_Variance );	}
+	double						Get_StdDev			(void)		{	if( m_bEvaluated < 1 )	_Evaluate(1); return( m_StdDev   );	}
+
+	double						Get_Kurtosis		(void)		{	if( m_bEvaluated < 2 )	_Evaluate(2); return( m_Kurtosis );	}
+	double						Get_Skewness		(void)		{	if( m_bEvaluated < 2 )	_Evaluate(2); return( m_Skewness );	}
+	double						Get_SkewnessPearson	(void);
 
 	double						Get_Median			(void)		{	return( Get_Quantile(50.0) );	}
 	double						Get_Quantile		(double Quantile);
@@ -590,16 +594,18 @@ public:
 
 protected:
 
-	bool						m_bEvaluated, m_bSorted;
+	bool						m_bSorted;
+
+	int							m_bEvaluated;
 
 	sLong						m_nValues;
 
-	double						m_Weights, m_Sum, m_Sum2, m_Minimum, m_Maximum, m_Range, m_Mean, m_Variance, m_StdDev;
+	double						m_Weights, m_Sum, m_Sum2, m_Minimum, m_Maximum, m_Range, m_Mean, m_Variance, m_StdDev, m_Kurtosis, m_Skewness;
 
 	CSG_Array					m_Values;
 
 
-	void						_Evaluate			(void);
+	void						_Evaluate			(int Level = 1);
 
 };
 
@@ -625,12 +631,11 @@ private:
 
 
 public:
-	 CSG_Class_Statistics(void);
-	~CSG_Class_Statistics(void);
+	         CSG_Class_Statistics			(void)	{	Create ();	}
+	virtual ~CSG_Class_Statistics			(void)	{	Destroy();	}
 
 	void			Create					(void);
-	void			Destroy					(void);
-
+	void			Destroy					(void)	{	m_Array.Set_Array(0, (void **)&m_Classes);	}
 	void			Reset					(void)	{	m_Array.Set_Array(0, (void **)&m_Classes, false);	}
 
 	int				Get_Count				(void)	{	return( (int)m_Array.Get_Size() );	}
@@ -667,6 +672,79 @@ public:
 	void			Add_Value				(double Value);
 
 	int				Get_Majority			(void);
+	bool			Get_Majority			(double &Value            )	{	int	Count; return( Get_Class(Get_Majority(), Value, Count) );	}
+	bool			Get_Majority			(double &Value, int &Count)	{	           return( Get_Class(Get_Majority(), Value, Count) && Count > 0 );	}
+
+	int				Get_Minority			(void);
+	bool			Get_Minority			(double &Value            )	{	int	Count; return( Get_Class(Get_Minority(), Value, Count) );	}
+	bool			Get_Minority			(double &Value, int &Count)	{	           return( Get_Class(Get_Minority(), Value, Count) && Count > 0 );	}
+
+
+private:
+
+	CSG_Array		m_Array;
+
+	TClass			*m_Classes;
+
+};
+
+//---------------------------------------------------------
+class SAGA_API_DLL_EXPORT CSG_Class_Statistics_Weighted
+{
+private:
+
+	typedef struct SClass
+	{
+		int		Count;
+
+		double	Value, Weight;
+	}
+	TClass;
+
+
+public:
+	         CSG_Class_Statistics_Weighted	(void)	{	Create ();	}
+	virtual ~CSG_Class_Statistics_Weighted	(void)	{	Destroy();	}
+
+	void			Create					(void);
+	void			Destroy					(void)	{	m_Array.Set_Array(0, (void **)&m_Classes);	}
+	void			Reset					(void)	{	m_Array.Set_Array(0, (void **)&m_Classes, false);	}
+
+	int				Get_Count				(void)	{	return( (int)m_Array.Get_Size() );	}
+
+	int				Get_Class_Count			(int i)	{	return( i >= 0 && i < Get_Count() ? m_Classes[i].Count : 0 );	}
+	double			Get_Class_Value			(int i)	{	return( i >= 0 && i < Get_Count() ? m_Classes[i].Value : 0 );	}
+	double			Get_Class_Weight		(int i)	{	return( i >= 0 && i < Get_Count() ? m_Classes[i].Weight : 0 );	}
+
+	bool			Get_Class				(int i, double &Value, int &Count)
+	{
+		if( i >= 0 && i < Get_Count() )
+		{
+			Count	= m_Classes[i].Count;
+			Value	= m_Classes[i].Value;
+
+			return( true );
+		}
+
+		return( false );
+	}
+
+	bool			Get_Class				(int i, int &Value, int &Count)
+	{
+		if( i >= 0 && i < Get_Count() )
+		{
+			Count	=      m_Classes[i].Count;
+			Value	= (int)m_Classes[i].Value;
+
+			return( true );
+		}
+
+		return( false );
+	}
+
+	void			Add_Value				(double Value, double Weight = 1.0);
+
+	int				Get_Majority			(void);
 	bool			Get_Majority			(double &Value);
 	bool			Get_Majority			(double &Value, int &Count);
 
diff --git a/src/saga_core/saga_api/module_chain.cpp b/src/saga_core/saga_api/module_chain.cpp
index cb4bb17..712ca9f 100644
--- a/src/saga_core/saga_api/module_chain.cpp
+++ b/src/saga_core/saga_api/module_chain.cpp
@@ -76,7 +76,7 @@
 #define GET_XML_CONTENT(md, id, def)		(md(id) ? md(id)->Get_Content() : CSG_String(def))
 
 #define IS_TRUE_STRING(String)				(!String.CmpNoCase("true") || !String.CmpNoCase("1"))
-#define IS_TRUE_PROPERTY(Item, Property)	(Item.Cmp_Property(Property, "true") || Item.Cmp_Property(Property, "1"))
+#define IS_TRUE_PROPERTY(Item, Property)	(Item.Cmp_Property(Property, "true", true) || Item.Cmp_Property(Property, "1"))
 
 
 ///////////////////////////////////////////////////////////
@@ -130,15 +130,35 @@ bool CSG_Module_Chain::Create(const CSG_String &File)
 	Reset();
 
 	//-----------------------------------------------------
-	if( !m_Chain.Load(File) || !m_Chain.Cmp_Name("toolchain")
-	||  SG_Compare_Version(m_Chain.Get_Property("saga-version"), "2.1.3") < 0
-	||  !m_Chain("identifier") || !m_Chain("parameters") )
+	if( File.Right(sizeof(".pyt.xml")).Make_Lower().Find(".pyt.xml") >= 0 )
 	{
-		Reset();
-
 		return( false );
 	}
 
+	if( !m_Chain.Load(File) )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format("%s: %s", _TL("failed to load or parse xml file"), File.c_str()));
+
+		Reset();	return( false );
+	}
+
+	if( m_Chain.Cmp_Name("toolchains") )	// don't report any error, this xml-file provides info for a category of tool chains
+	{
+		Reset();	return( false );
+	}
+
+	if( !m_Chain.Cmp_Name("toolchain") || !m_Chain("identifier") || !m_Chain("parameters") )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format("%s: %s", _TL("missing tool chain tags"), File.c_str()));
+
+		Reset();	return( false );
+	}
+
+	if( SG_Compare_Version(m_Chain.Get_Property("saga-version"), "2.1.3") < 0 )
+	{
+		SG_UI_Msg_Add_Error(CSG_String::Format("%s %s: %s", _TL("WARNING"), _TL("unsupported tool chain version"), File.c_str()));
+	}
+
 	//-----------------------------------------------------
 	m_File_Name		= File;
 
@@ -151,7 +171,7 @@ bool CSG_Module_Chain::Create(const CSG_String &File)
 
 	if( !m_Menu.is_Empty() && (m_Menu.Length() < 2 || m_Menu[1] != ':') )
 	{
-		if( m_Chain["menu"].Cmp_Property("absolute", "true", true) || m_Chain["menu"].Cmp_Property("absolute", "1") )
+		if( IS_TRUE_PROPERTY(m_Chain["menu"], "absolute") )
 			m_Menu.Prepend("A:");	// absolute path
 		else
 			m_Menu.Prepend("R:");	// relative path
@@ -214,38 +234,50 @@ bool CSG_Module_Chain::Create(const CSG_String &File)
 		//-------------------------------------------------
 		switch( SG_Parameter_Type_Get_Type(Parameter.Get_Property("type")) )
 		{
-		case PARAMETER_TYPE_PointCloud     : Parameters.Add_PointCloud     (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Grid           : Parameter.Cmp_Property("target", "none") 
-			                               ? Parameters.Add_Grid_Output    (   NULL, ID, Name, Desc)
-			                               : Parameters.Add_Grid           (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Table          : Parameters.Add_Table          (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Shapes         : Parameters.Add_Shapes         (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_TIN            : Parameters.Add_TIN            (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_Node             : Parameters.Add_Node           (pParent, ID, Name, Desc);	break;
+
+		case PARAMETER_TYPE_Bool             : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Bool  , IS_TRUE_STRING(Value));	break;
+		case PARAMETER_TYPE_Int              : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Int   , Value.asInt   (), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_Double           : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Double, Value.asDouble(), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_Degree           : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Degree, Value.asDouble(), Min, bMin, Max, bMax);	break;
+
+		case PARAMETER_TYPE_Range            : Parameters.Add_Range          (pParent, ID, Name, Desc, Value.BeforeFirst(';').asDouble(), Value.AfterFirst (';').asDouble(), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_Choice           : Parameters.Add_Choice         (pParent, ID, Name, Desc, Parameter.Get_Content("choices"))->Set_Value(Value);	break;
 
-		case PARAMETER_TYPE_PointCloud_List: Parameters.Add_PointCloud_List(pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Grid_List      : Parameters.Add_Grid_List      (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Table_List     : Parameters.Add_Table_List     (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_Shapes_List    : Parameters.Add_Shapes_List    (pParent, ID, Name, Desc, Constraint);	break;
-		case PARAMETER_TYPE_TIN_List       : Parameters.Add_TIN_List       (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_String           : Parameters.Add_String         (pParent, ID, Name, Desc, Value, false);	break;
+		case PARAMETER_TYPE_Text             : Parameters.Add_String         (pParent, ID, Name, Desc, Value,  true);	break;
 
-		case PARAMETER_TYPE_Bool           : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Bool  , IS_TRUE_STRING(Value));	break;
-		case PARAMETER_TYPE_Int            : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Int   , Value.asInt   (), Min, bMin, Max, bMax);	break;
-		case PARAMETER_TYPE_Double         : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Double, Value.asDouble(), Min, bMin, Max, bMax);	break;
-		case PARAMETER_TYPE_Degree         : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Degree, Value.asDouble(), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_FilePath         : Parameters.Add_FilePath       (pParent, ID, Name, Desc, Parameter.Get_Content("filter"), Value,
+												IS_TRUE_PROPERTY(Parameter, "save"     ),
+												IS_TRUE_PROPERTY(Parameter, "directory"),
+												IS_TRUE_PROPERTY(Parameter, "multiple" ));	break;
 
-		case PARAMETER_TYPE_String         : Parameters.Add_String         (pParent, ID, Name, Desc, Value, false);	break;
-		case PARAMETER_TYPE_Text           : Parameters.Add_String         (pParent, ID, Name, Desc, Value,  true);	break;
+		case PARAMETER_TYPE_Font             : break;
+		case PARAMETER_TYPE_Color            : Parameters.Add_Value          (pParent, ID, Name, Desc, PARAMETER_TYPE_Color, Value.asInt());	break;
+		case PARAMETER_TYPE_Colors           : Parameters.Add_Colors         (pParent, ID, Name, Desc);	break;
+		case PARAMETER_TYPE_FixedTable       : break;	// to do ?
 
-		case PARAMETER_TYPE_FilePath       : Parameters.Add_FilePath       (pParent, ID, Name, Desc, Parameter.Get_Content("filter"), Value,
-												 IS_TRUE_PROPERTY(Parameter, "save"), IS_TRUE_PROPERTY(Parameter, "directory"), IS_TRUE_PROPERTY(Parameter, "multiple" ));	break;
+		case PARAMETER_TYPE_Grid_System      : Parameters.Add_Grid_System    (pParent, ID, Name, Desc);	break;
 
-		case PARAMETER_TYPE_Choice         : Parameters.Add_Choice         (pParent, ID, Name, Desc, Parameter.Get_Content("choices"))->Set_Value(Value);	break;
-		case PARAMETER_TYPE_Range          : Parameters.Add_Range          (pParent, ID, Name, Desc, Value.BeforeFirst(';').asDouble(), Value.AfterFirst (';').asDouble(), Min, bMin, Max, bMax);	break;
+		case PARAMETER_TYPE_Table_Field      : Parameters.Add_Table_Field    (pParent, ID, Name, Desc, (!Value.CmpNoCase("true") || !Value.CmpNoCase("1")));	break;
+		case PARAMETER_TYPE_Table_Fields     : Parameters.Add_Table_Fields   (pParent, ID, Name, Desc);	break;
 
-		case PARAMETER_TYPE_Table_Field    : Parameters.Add_Table_Field    (pParent, ID, Name, Desc, (!Value.CmpNoCase("true") || !Value.CmpNoCase("1")));	break;
-		case PARAMETER_TYPE_Table_Fields   : Parameters.Add_Table_Fields   (pParent, ID, Name, Desc);	break;
+		case PARAMETER_TYPE_Grid             : Parameter.Cmp_Property("target", "none") 
+			                                 ? Parameters.Add_Grid_Output    (   NULL, ID, Name, Desc)
+			                                 : Parameters.Add_Grid           (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_Table            : Parameters.Add_Table          (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_Shapes           : Parameters.Add_Shapes         (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_TIN              : Parameters.Add_TIN            (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_PointCloud       : Parameters.Add_PointCloud     (pParent, ID, Name, Desc, Constraint);	break;
 
-		case PARAMETER_TYPE_Grid_System    : Parameters.Add_Grid_System    (pParent, ID, Name, Desc);	break;
+		case PARAMETER_TYPE_Grid_List        : Parameters.Add_Grid_List      (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_Table_List       : Parameters.Add_Table_List     (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_Shapes_List      : Parameters.Add_Shapes_List    (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_TIN_List         : Parameters.Add_TIN_List       (pParent, ID, Name, Desc, Constraint);	break;
+		case PARAMETER_TYPE_PointCloud_List  : Parameters.Add_PointCloud_List(pParent, ID, Name, Desc, Constraint);	break;
+
+		case PARAMETER_TYPE_DataObject_Output: break;
+		case PARAMETER_TYPE_Parameters       : break;	// to do ?
 
 		default: break;
 		}
@@ -393,7 +425,9 @@ bool CSG_Module_Chain::Data_Initialize(void)
 
 	for(int i=0; i<Parameters.Get_Count(); i++)
 	{
-		if( Data_Add(Parameters(i)->Get_Identifier(), Parameters(i)) )
+		CSG_Parameter	*pParameter	= Parameters(i);
+
+		if( !(pParameter->is_DataObject() && !pParameter->asDataObject()) && Data_Add(pParameter->Get_Identifier(), pParameter) )
 		{
 			bResult	= true;
 		}
@@ -451,8 +485,7 @@ bool CSG_Module_Chain::Data_Finalize(void)
 				if( Parameter("colours") )
 				{
 					DataObject_Set_Colors(pParameter->asDataObject(), 11,
-						Parameter["colours"].Get_Content().asInt(),
-						Parameter["colours"].Cmp_Property("revert", "true", true) || Parameter["colours"].Cmp_Property("revert", "1")
+						Parameter["colours"].Get_Content().asInt(), IS_TRUE_PROPERTY(Parameter["colours"], "revert")
 					);
 				}
 			}
@@ -500,7 +533,7 @@ bool CSG_Module_Chain::Check_Condition(const CSG_MetaData &Condition, CSG_Parame
 
 	if( !Type.CmpNoCase("not_exists") )	// data object does not exist
 	{
-		return( pData->Get_Parameter(Value) == NULL );
+		return( pData->Get_Parameter(Value) == NULL || pData->Get_Parameter(Value)->asDataObject() == NULL );
 	}
 
 	//-----------------------------------------------------
@@ -718,23 +751,21 @@ bool CSG_Module_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Module *pMo
 	int		i;
 
 	//-----------------------------------------------------
-	for(i=0; i<Tool.Get_Children_Count(); i++)	// set data objects first
+	for(i=0; i<Tool.Get_Children_Count(); i++)	// set data variables first
 	{
-		const CSG_MetaData	&Parameter	= Tool[i];	if( Parameter.Cmp_Name("condition") )	{	continue;	}
-
-		CSG_String	ID	= Parameter.Get_Property("id");
+		const CSG_MetaData	&Parameter	= Tool[i];
 
 		CSG_Parameter	*pParameter, *pOwner;
 
 		if( !Tool_Get_Parameter(Parameter, pModule, &pParameter, &pOwner) )
 		{
-			Error_Set(CSG_String::Format("%s: %s", _TL("parameter not found"), ID.c_str()));
+			Error_Set(CSG_String::Format("%s: %s", _TL("parameter not found"), Parameter.Get_Property("id")));
 
 			return( false );
 		}
 		else if( Parameter.Cmp_Name("option") )
 		{
-			if( Parameter.Cmp_Property("varname", "1") || Parameter.Cmp_Property("varname", "true", true) )
+			if( IS_TRUE_PROPERTY(Parameter, "varname") )
 			{	// does option want a value from tool chain parameters and do these provide one ?
 				pParameter->Assign(Parameters(Parameter.Get_Content()));
 			}
@@ -749,7 +780,7 @@ bool CSG_Module_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Module *pMo
 
 			if( !pData )	// each input for this tool should be available now !!!
 			{
-				Error_Set(CSG_String::Format("%s: %s", _TL("input"), ID.c_str()));
+				Error_Set(CSG_String::Format("%s: %s", _TL("input"), Parameter.Get_Property("id")));
 
 				return( false );
 			}
@@ -760,7 +791,7 @@ bool CSG_Module_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Module *pMo
 				{
 					if( !pParameter->Assign(pData) )
 					{
-						Error_Set(CSG_String::Format("%s: %s", _TL("set input"), ID.c_str()));
+						Error_Set(CSG_String::Format("%s: %s", _TL("set input"), Parameter.Get_Property("id")));
 
 						return( false );
 					}
@@ -790,9 +821,7 @@ bool CSG_Module_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Module *pMo
 	//-----------------------------------------------------
 	for(i=0; i<Tool.Get_Children_Count(); i++)	// now set options
 	{
-		const CSG_MetaData	&Parameter	= Tool[i];	if( Parameter.Cmp_Name("condition") )	{	continue;	}
-
-		CSG_String	ID	= Parameter.Get_Property("id");
+		const CSG_MetaData	&Parameter	= Tool[i];
 
 		CSG_Parameter	*pParameter, *pOwner;
 
@@ -802,13 +831,28 @@ bool CSG_Module_Chain::Tool_Initialize(const CSG_MetaData &Tool, CSG_Module *pMo
 		}
 		else if( Parameter.Cmp_Name("option") )
 		{
-			if( Parameter.Cmp_Property("varname", "1") || Parameter.Cmp_Property("varname", "true", true) )
+			if( IS_TRUE_PROPERTY(Parameter, "varname") )
 			{	// does option want a value from tool chain parameters and do these provide one ?
 				pParameter->Assign(Parameters(Parameter.Get_Content()));
 			}
 			else
 			{
-				pParameter->Set_Value(Parameter.Get_Content());
+				CSG_String	Value(Parameter.Get_Content());
+
+				if( pParameter->Get_Type() == PARAMETER_TYPE_String )
+				{
+					for(int j=0; j<Parameters.Get_Count(); j++)
+					{
+						CSG_String	Var; Var.Printf("$(%s)", Parameters(j)->Get_Identifier());
+
+						if( Value.Find(Var) >= 0 )
+						{
+							Value.Replace(Var, Parameters(j)->asString());
+						}
+					}
+				}
+
+				pParameter->Set_Value(Value);
 			}
 		}
 	}
diff --git a/src/saga_core/saga_api/parameter_data.cpp b/src/saga_core/saga_api/parameter_data.cpp
index a463113..ad93763 100644
--- a/src/saga_core/saga_api/parameter_data.cpp
+++ b/src/saga_core/saga_api/parameter_data.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: parameter_data.cpp 2432 2015-03-04 15:09:34Z oconrad $
+ * Version $Id: parameter_data.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1959,30 +1959,30 @@ bool CSG_Parameter_Data_Object::On_Serialize(CSG_MetaData &Entry, bool bSave)
 	{
 		if(	m_pDataObject == DATAOBJECT_CREATE )
 		{
-			Entry.Set_Content(SG_T("CREATE"));
+			Entry.Set_Content("CREATE");
 		}
-		else if( m_pDataObject == DATAOBJECT_NOTSET || !SG_File_Exists(m_pDataObject->Get_File_Name()) )
+		else if( m_pDataObject == DATAOBJECT_NOTSET || !SG_File_Exists(m_pDataObject->Get_File_Name(false)) )
 		{
-			Entry.Set_Content(SG_T("NOT SET"));
+			Entry.Set_Content("NOT SET");
 		}
 		else
 		{
-			Entry.Set_Content(m_pDataObject->Get_File_Name());
+			Entry.Set_Content(m_pDataObject->Get_File_Name(false));
 		}
 	}
 	else
 	{
-		if( Entry.Cmp_Content(SG_T("CREATE")) )
+		if( Entry.Cmp_Content("CREATE") )
 		{
 			Set_Value(DATAOBJECT_CREATE);
 		}
-		else if( Entry.Cmp_Content(SG_T("NOT SET")) )
+		else if( Entry.Cmp_Content("NOT SET") )
 		{
 			Set_Value(DATAOBJECT_NOTSET);
 		}
 		else
 		{
-			Set_Value(m_pOwner->Get_Manager() ? m_pOwner->Get_Manager()->Find(Entry.Get_Content()) : NULL);
+			Set_Value(m_pOwner->Get_Manager() ? m_pOwner->Get_Manager()->Find(Entry.Get_Content(), false) : NULL);
 		}
 	}
 
@@ -2021,7 +2021,10 @@ bool CSG_Parameter_Data_Object_Output::Set_Value(void *Value)
 		{
 			m_pOwner->Get_Manager()->Add(m_pDataObject);
 
-			SG_UI_DataObject_Add(m_pDataObject, false);
+			if( m_pOwner->Get_Manager() == &SG_Get_Data_Manager() )	// prevent that local data manager send their data objects to gui
+			{
+				SG_UI_DataObject_Add(m_pDataObject, false);
+			}
 		}
 	}
 
diff --git a/src/saga_core/saga_api/pointcloud.cpp b/src/saga_core/saga_api/pointcloud.cpp
index 72cd434..d4f5856 100644
--- a/src/saga_core/saga_api/pointcloud.cpp
+++ b/src/saga_core/saga_api/pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pointcloud.cpp 2436 2015-03-11 09:31:04Z reklov_w $
+ * Version $Id: pointcloud.cpp 2566 2015-09-01 13:35:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -74,8 +74,9 @@
 #define PC_FILE_VERSION		"SGPC01"
 
 #define PC_STR_NBYTES		32
+#define PC_DAT_NBYTES		32
 
-#define PC_GET_NBYTES(type)	(type == SG_DATATYPE_String ? PC_STR_NBYTES : (int)SG_Data_Type_Get_Size(type))
+#define PC_GET_NBYTES(type)	(type == SG_DATATYPE_String ? PC_STR_NBYTES : type == SG_DATATYPE_Date ? PC_DAT_NBYTES : (int)SG_Data_Type_Get_Size(type))
 
 
 ///////////////////////////////////////////////////////////
@@ -360,14 +361,14 @@ bool CSG_PointCloud::_Load(const CSG_String &File_Name)
 	}
 
 	//-----------------------------------------------------
-	long		fLength	= Stream.Length();
+	sLong		fLength	= Stream.Length();
 
-	while( _Inc_Array() && Stream.Read(m_Cursor + 1, nPointBytes) && SG_UI_Process_Set_Progress(Stream.Tell(), fLength) )
+	while( _Inc_Array() && Stream.Read(m_Cursor + 1, nPointBytes) && SG_UI_Process_Set_Progress((double)Stream.Tell(), (double)fLength) )
 	{}
 
 	_Dec_Array();
 
-	Set_File_Name(File_Name);
+	Set_File_Name(File_Name, true);
 
 	Load_MetaData(File_Name);
 
@@ -430,7 +431,7 @@ bool CSG_PointCloud::_Save(const CSG_String &File_Name)
 
 	Set_Modified(false);
 
-	Set_File_Name(sFile_Name);
+	Set_File_Name(sFile_Name, true);
 
 	Save_MetaData(File_Name);
 
@@ -680,49 +681,59 @@ double CSG_PointCloud::_Get_Field_Value(char *pPoint, int iField) const
 }
 
 //---------------------------------------------------------
-bool CSG_PointCloud::Set_Value(int iPoint, int iField, const SG_Char *Value)
+bool CSG_PointCloud::_Set_Field_Value(char *pPoint, int iField, const SG_Char *Value)
 {
-	if( iPoint >= 0 && iPoint < m_nRecords && iField >= 0 && iField < m_nFields && Value && *Value )
+	if( pPoint && iField >= 0 && iField < m_nFields && Value )
 	{
 		CSG_String	s(Value);
 
-		if( m_Field_Type[iField] == SG_DATATYPE_String )
-		{
-			memset(m_Points[iPoint] + m_Field_Offset[iField], 0, PC_STR_NBYTES);
-			memcpy(m_Points[iPoint] + m_Field_Offset[iField], s.b_str(), s.Length() > PC_STR_NBYTES ? PC_STR_NBYTES : s.Length());
-		}
-		else
+		switch( m_Field_Type[iField] )
 		{
-			double	d;
-
-			if( s.asDouble(d) )
+		default:
 			{
-				return( _Set_Field_Value(m_Points[iPoint], iField, d) );
+				double	d;
+
+				return( s.asDouble(d) && _Set_Field_Value(pPoint, iField, d) );
 			}
+			break;
+
+		case SG_DATATYPE_Date:
+		case SG_DATATYPE_String:
+			pPoint	+= m_Field_Offset[iField];
+			memset(pPoint, 0, PC_STR_NBYTES);
+			memcpy(pPoint, s.b_str(), s.Length() > PC_STR_NBYTES ? PC_STR_NBYTES : s.Length());
+			break;
 		}
+
+		return( true );
 	}
 
 	return( false );
 }
 
 //---------------------------------------------------------
-bool CSG_PointCloud::Get_Value(int iPoint, int iField, CSG_String &Value)	const
+bool CSG_PointCloud::_Get_Field_Value(char *pPoint, int iField, CSG_String &Value)	const
 {
-	if( iPoint >= 0 && iPoint < m_nRecords && iField >= 0 && iField < m_nFields )
+	if( pPoint && iField >= 0 && iField < m_nFields )
 	{
-		if( m_Field_Type[iField] == SG_DATATYPE_String )
+		switch( m_Field_Type[iField] )
 		{
-			char	s[PC_STR_NBYTES + 1];
+		default:
+			Value.Printf("%f", _Get_Field_Value(pPoint, iField));
+			break;
+
+		case SG_DATATYPE_Date:
+		case SG_DATATYPE_String:
+			{
+				char	s[PC_STR_NBYTES + 1];
 
-			memcpy(s, m_Points[iPoint] + m_Field_Offset[iField], PC_STR_NBYTES);
+				memcpy(s, pPoint + m_Field_Offset[iField], PC_STR_NBYTES);
 
-			s[PC_STR_NBYTES]	= '\0';
+				s[PC_STR_NBYTES]	= '\0';
 
-			Value	= s;
-		}
-		else
-		{
-			Value.Printf("%f", _Get_Field_Value(m_Points[iPoint], iField));
+				Value	= s;
+			}
+			break;
 		}
 
 		return( true );
@@ -982,12 +993,22 @@ CSG_Shape * CSG_PointCloud::_Set_Shape(int iPoint)
 
 		for(int i=0; i<Get_Field_Count(); i++)
 		{
-			Set_Value(i, pShape->asDouble(i));
+			switch( Get_Field_Type(i) )
+			{
+			default:
+				Set_Value(i, pShape->asDouble(i));
+				break;
+
+			case SG_DATATYPE_Date:
+			case SG_DATATYPE_String:
+				Set_Value(i, pShape->asString(i));
+				break;
+			}
 		}
 
 		Set_Value(0, pShape->Get_Point(0).x);
 		Set_Value(1, pShape->Get_Point(0).y);
-		Set_Value(2, pShape->Get_Z(0));
+		Set_Value(2, pShape->Get_Z    (0)  );
 	}
 
 	if( iPoint >= 0 && iPoint < Get_Count() )
@@ -1001,7 +1022,23 @@ CSG_Shape * CSG_PointCloud::_Set_Shape(int iPoint)
 
 			for(int i=0; i<Get_Field_Count(); i++)
 			{
-				pShape->Set_Value(i, Get_Value(i));
+				switch( Get_Field_Type(i) )
+				{
+				default:
+					pShape->Set_Value(i, Get_Value(i));
+					break;
+
+				case SG_DATATYPE_Date:
+				case SG_DATATYPE_String:
+					{
+						CSG_String	s;
+
+						Get_Value(i, s);
+					
+						pShape->Set_Value(i, s);
+					}
+					break;
+				}
 			}
 
 			m_Shapes_Index	= iPoint;
diff --git a/src/saga_core/saga_api/pointcloud.h b/src/saga_core/saga_api/pointcloud.h
index a8dddfc..704ede7 100644
--- a/src/saga_core/saga_api/pointcloud.h
+++ b/src/saga_core/saga_api/pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: pointcloud.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: pointcloud.h 2566 2015-09-01 13:35:09Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -131,16 +131,16 @@ public:
 	int								Get_Point_Count		(void)			const	{	return( m_nRecords );	}
 
 	//-----------------------------------------------------
-	bool							Set_Cursor			(int iPoint)				{	return( (m_Cursor = iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL) != NULL );	}
-	virtual bool					Set_Value			(int iField, double Value)	{	return( _Set_Field_Value(m_Cursor, iField, Value) );	}
-	virtual double					Get_Value			(int iField)	const		{	return( _Get_Field_Value(m_Cursor, iField) );			}
-	double							Get_X				(void)			const		{	return( _Get_Field_Value(m_Cursor, 0) );				}
-	double							Get_Y				(void)			const		{	return( _Get_Field_Value(m_Cursor, 1) );				}
-	double							Get_Z				(void)			const		{	return( _Get_Field_Value(m_Cursor, 2) );				}
-	bool							Set_Attribute		(int iField, double Value)	{	return( Set_Value(iField + 3, Value) );					}
-	double							Get_Attribute		(int iField)	const		{	return( Get_Value(iField + 3) );						}
-	bool							Set_NoData			(int iField)				{	return( Set_Value(iField, Get_NoData_Value()) );	}
-	bool							is_NoData			(int iField)	const		{	return( is_NoData_Value(Get_Value(iField)) );		}
+	bool							Set_Cursor			(int iPoint)							{	return( (m_Cursor = iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL) != NULL );	}
+	virtual bool					Set_Value			(            int iField, double Value)	{	return( _Set_Field_Value(m_Cursor, iField, Value) );	}
+	virtual double					Get_Value			(            int iField)	const		{	return( _Get_Field_Value(m_Cursor, iField) );			}
+	double							Get_X				(void)						const		{	return( _Get_Field_Value(m_Cursor, 0) );				}
+	double							Get_Y				(void)						const		{	return( _Get_Field_Value(m_Cursor, 1) );				}
+	double							Get_Z				(void)						const		{	return( _Get_Field_Value(m_Cursor, 2) );				}
+	bool							Set_Attribute		(            int iField, double Value)	{	return( Set_Value(iField + 3, Value) );					}
+	double							Get_Attribute		(            int iField)	const		{	return( Get_Value(iField + 3) );						}
+	bool							Set_NoData			(            int iField)				{	return( Set_Value(iField, Get_NoData_Value()) );	}
+	bool							is_NoData			(            int iField)	const		{	return( is_NoData_Value(Get_Value(iField)) );		}
 
 	virtual bool					Set_Value			(int iPoint, int iField, double Value)	{	return( _Set_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField, Value) );	}
 	virtual double					Get_Value			(int iPoint, int iField)	const		{	return( _Get_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField) );		}
@@ -152,8 +152,10 @@ public:
 	bool							Set_NoData			(int iPoint, int iField)				{	return( Set_Value(iPoint, iField, Get_NoData_Value()) );}
 	bool							is_NoData			(int iPoint, int iField)	const		{	return( is_NoData_Value(Get_Value(iPoint, iField)) );	}
 
-	virtual bool					Set_Value			(int iPoint, int iField, const SG_Char *Value);
-	virtual bool					Get_Value			(int iPoint, int iField, CSG_String    &Value)	const;
+	virtual bool					Set_Value			(            int iField, const SG_Char *Value)			{	return( _Set_Field_Value(m_Cursor, iField, Value) );	}
+	virtual bool					Get_Value			(            int iField, CSG_String    &Value)	const	{	return( _Get_Field_Value(m_Cursor, iField, Value) );	}
+	virtual bool					Set_Value			(int iPoint, int iField, const SG_Char *Value)			{	return( _Set_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField, Value) );	}
+	virtual bool					Get_Value			(int iPoint, int iField, CSG_String    &Value)	const	{	return( _Get_Field_Value(iPoint >= 0 && iPoint < m_nRecords ? m_Points[iPoint] : NULL, iField, Value) );	}
 
 	TSG_Point_Z						Get_Point			(void)			const;
 	TSG_Point_Z						Get_Point			(int iPoint)	const;
@@ -219,8 +221,10 @@ private:
 	bool							_Save				(const CSG_String &File_Name);
 
 	bool							_Add_Field			(const SG_Char *Name, TSG_Data_Type Type, int iField = -1);
-	bool							_Set_Field_Value	(char *pPoint, int iField, double Value);
-	double							_Get_Field_Value	(char *pPoint, int iField)	const;
+	bool							_Set_Field_Value	(char *pPoint, int iField, double         Value);
+	double							_Get_Field_Value	(char *pPoint, int iField                      )	const;
+	bool							_Set_Field_Value	(char *pPoint, int iField, const SG_Char *Value);
+	bool							_Get_Field_Value	(char *pPoint, int iField, CSG_String    &Value)	const;
 	int								_Get_Field_Bytes	(TSG_Data_Type Type);
 
 	bool							_Inc_Array			(void);
diff --git a/src/saga_core/saga_api/quadtree.cpp b/src/saga_core/saga_api/quadtree.cpp
index 288b132..6b3a73f 100644
--- a/src/saga_core/saga_api/quadtree.cpp
+++ b/src/saga_core/saga_api/quadtree.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: quadtree.cpp 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id: quadtree.cpp 2593 2015-09-23 07:34:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -1080,7 +1080,7 @@ bool CSG_Parameters_Search_Points::Get_Points(double x, double y, CSG_Points_Z &
 //---------------------------------------------------------
 bool CSG_Parameters_Search_Points::Get_Points(const TSG_Point &p, CSG_Points_Z &Points)
 {
-	return( m_Search.Get_Nearest_Points(Points, p, m_nPoints_Max, m_Radius, m_Quadrant) >= m_nPoints_Min );
+	return( m_Search.Get_Nearest_Points(Points, p, m_nPoints_Max, m_Radius, m_Quadrant) >= (size_t)m_nPoints_Min );
 }
 
 
diff --git a/src/saga_core/saga_api/saga_api.h b/src/saga_core/saga_api/saga_api.h
index c7bae9d..ad349fa 100644
--- a/src/saga_core/saga_api/saga_api.h
+++ b/src/saga_core/saga_api/saga_api.h
@@ -128,8 +128,8 @@
 //---------------------------------------------------------
 #define SAGA_MAJOR_VERSION		2
 #define SAGA_MINOR_VERSION		2
-#define SAGA_RELEASE_NUMBER		0
-#define SAGA_VERSION			SG_T("2.2.0")
+#define SAGA_RELEASE_NUMBER		1
+#define SAGA_VERSION			SG_T("2.2.1")
 
 
 ///////////////////////////////////////////////////////////
diff --git a/src/saga_core/saga_api/shapes.cpp b/src/saga_core/saga_api/shapes.cpp
index d240206..c4cdcba 100644
--- a/src/saga_core/saga_api/shapes.cpp
+++ b/src/saga_core/saga_api/shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: shapes.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: shapes.cpp 2558 2015-08-19 14:56:36Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -229,7 +229,7 @@ bool CSG_Shapes::Create(const CSG_String &File_Name)
 
 	bool	bResult	= _Load_ESRI(File_Name);
 
-	Set_File_Name(File_Name);
+	Set_File_Name(File_Name, true);
 	Load_MetaData(File_Name);
 
 	if( bResult )
@@ -305,7 +305,7 @@ bool CSG_Shapes::Assign(CSG_Data_Object *pObject)
 	{
 		pShapes	= (CSG_Shapes *)pObject;
 
-		Create(pShapes->Get_Type(), pShapes->Get_Name(), pShapes);
+		Create(pShapes->Get_Type(), pShapes->Get_Name(), pShapes, pShapes->Get_Vertex_Type());
 
 		for(iShape=0; iShape<pShapes->Get_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++)
 		{
@@ -341,7 +341,7 @@ bool CSG_Shapes::Save(const CSG_String &File_Name, int Format)
 	{
 		Set_Modified(false);
 
-		Set_File_Name(File_Name);
+		Set_File_Name(File_Name, true);
 
 		Save_MetaData(File_Name);
 
diff --git a/src/saga_core/saga_api/table_io.cpp b/src/saga_core/saga_api/table_io.cpp
index 3f8ba26..8725fd9 100644
--- a/src/saga_core/saga_api/table_io.cpp
+++ b/src/saga_core/saga_api/table_io.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: table_io.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: table_io.cpp 2558 2015-08-19 14:56:36Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -136,7 +136,7 @@ bool CSG_Table::_Load(const CSG_String &File_Name, TSG_Table_File_Type Format, c
 
 		Set_Update_Flag();
 
-		Set_File_Name(File_Name);
+		Set_File_Name(File_Name, true);
 
 		Load_MetaData(File_Name);
 
@@ -211,7 +211,7 @@ bool CSG_Table::Save(const CSG_String &File_Name, int Format, const SG_Char *Sep
 
 		Set_File_Type(Format);
 
-		Set_File_Name(File_Name);
+		Set_File_Name(File_Name, true);
 
 		Save_MetaData(File_Name);
 
diff --git a/src/saga_core/saga_api/tin.cpp b/src/saga_core/saga_api/tin.cpp
index c3900be..602b91c 100644
--- a/src/saga_core/saga_api/tin.cpp
+++ b/src/saga_core/saga_api/tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: tin.cpp 2194 2014-08-14 08:46:34Z oconrad $
+ * Version $Id: tin.cpp 2558 2015-08-19 14:56:36Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -179,7 +179,7 @@ bool CSG_TIN::Create(const CSG_String &File_Name)
 		Get_History().Add_Child(_TL("Created from file"), File_Name);
 		Get_History().Add_Children(Shapes.Get_History());
 
-		Set_File_Name(File_Name);
+		Set_File_Name(File_Name, true);
 		Set_Modified(false);
 		Set_Update_Flag();
 
@@ -392,7 +392,7 @@ bool CSG_TIN::Save(const CSG_String &File_Name, int Format)
 	{
 		Set_Modified(false);
 
-		Set_File_Name(File_Name);
+		Set_File_Name(File_Name, true);
 	}
 
 	return( bResult );
diff --git a/src/saga_core/saga_cmd/module_library.cpp b/src/saga_core/saga_cmd/module_library.cpp
index 53929a1..8b244fd 100644
--- a/src/saga_core/saga_cmd/module_library.cpp
+++ b/src/saga_core/saga_cmd/module_library.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.cpp 2410 2015-02-17 11:38:56Z oconrad $
+ * Version $Id: module_library.cpp 2598 2015-09-23 14:12:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -104,11 +104,11 @@ bool CCMD_Module::Create(CSG_Module_Library *pLibrary, CSG_Module *pModule)
 
 	if( (m_pLibrary = pLibrary) != NULL && (m_pModule = pModule) != NULL )
 	{
-		_Set_Parameters(m_pModule->Get_Parameters(), false);
+		_Set_Parameters(m_pModule->Get_Parameters());
 
 		for(int i=0; i<m_pModule->Get_Parameters_Count(); i++)
 		{
-			_Set_Parameters(m_pModule->Get_Parameters(i), true);
+			_Set_Parameters(m_pModule->Get_Parameters(i));
 		}
 
 		return( true );
@@ -275,7 +275,7 @@ wxString CCMD_Module::_Get_ID(CSG_Parameter *pParameter, const wxString &Modifie
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters, bool bOptional)
+bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters)
 {
 	if( !pParameters )
 	{
@@ -291,14 +291,11 @@ bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters, bool bOptional)
 			PARAMETER_DESCRIPTION_NAME|PARAMETER_DESCRIPTION_TYPE|PARAMETER_DESCRIPTION_PROPERTIES, SG_T("\n\t")
 		).c_str();
 
-		Description.Replace(wxT("\xb2"), wxT("2"));	// unicode problem: quick'n'dirty bug fix, to be replaced
+		Description.Replace(wxT("\xb"), wxT(""));	// unicode problem: quick'n'dirty bug fix, to be replaced
 
 		if( pParameter->is_Input() || pParameter->is_Output() )
 		{
-			m_CMD.AddOption(_Get_ID(pParameter), wxEmptyString, Description, wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR
-			| (pParameter->is_Optional() || pParameter->is_Output() || bOptional
-			  ? wxCMD_LINE_PARAM_OPTIONAL : wxCMD_LINE_OPTION_MANDATORY
-			));
+			m_CMD.AddOption(_Get_ID(pParameter), wxEmptyString, Description, wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR|wxCMD_LINE_PARAM_OPTIONAL);
 		}
 
 		else if( pParameter->is_Option() && !pParameter->is_Information() )
@@ -309,7 +306,7 @@ bool CCMD_Module::_Set_Parameters(CSG_Parameters *pParameters, bool bOptional)
 				break;
 
 			case PARAMETER_TYPE_Parameters:
-				_Set_Parameters(pParameter->asParameters(), true);
+				_Set_Parameters(pParameter->asParameters());
 				break;
 
 			case PARAMETER_TYPE_Bool:
@@ -623,7 +620,16 @@ bool CCMD_Module::_Load_Input(CSG_Parameter *pParameter)
 
 	if( !m_CMD.Found(_Get_ID(pParameter), &FileName) )
 	{
-		return( pParameter->is_Optional() );
+		if( !pParameter->is_Optional() )
+		{
+			wxString	Msg(wxString::Format(_TL("The value for the option '%s' must be specified."), _Get_ID(pParameter)));
+
+			CMD_Print_Error(&Msg);
+
+			return( false );
+		}
+
+		return( true );
 	}
 
 	if( pParameter->is_DataObject() )
@@ -635,7 +641,7 @@ bool CCMD_Module::_Load_Input(CSG_Parameter *pParameter)
 			return( false );
 		}
 
-		return( pParameter->Set_Value(SG_Get_Data_Manager().Find(&FileName)) );
+		return( pParameter->Set_Value(SG_Get_Data_Manager().Find(&FileName, false)) );
 	}
 
 	else if( pParameter->is_DataObject_List() )
@@ -654,7 +660,7 @@ bool CCMD_Module::_Load_Input(CSG_Parameter *pParameter)
 				SG_Get_Data_Manager().Add(&FileName);
 			}
 
-			pParameter->asList()->Add_Item(SG_Get_Data_Manager().Find(&FileName));
+			pParameter->asList()->Add_Item(SG_Get_Data_Manager().Find(&FileName, false));
 		}
 		while( FileNames.Length() > 0 );
 	}
diff --git a/src/saga_core/saga_cmd/module_library.h b/src/saga_core/saga_cmd/module_library.h
index 49235e3..388112d 100644
--- a/src/saga_core/saga_cmd/module_library.h
+++ b/src/saga_core/saga_cmd/module_library.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: module_library.h 2201 2014-08-26 13:22:14Z oconrad $
+ * Version $Id: module_library.h 2598 2015-09-23 14:12:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -112,7 +112,7 @@ private:
 
 	wxString					_Get_ID					(CSG_Parameter  *pParameter, const wxString &Modifier = "");
 
-	bool						_Set_Parameters			(CSG_Parameters *pParameters, bool bOptional);
+	bool						_Set_Parameters			(CSG_Parameters *pParameters);
 	bool						_Get_Parameters			(CSG_Parameters *pParameters, bool bInitialize);
 
 	bool						_Load_Input				(CSG_Parameter  *pParameter);
diff --git a/src/saga_core/saga_gui/data_source.cpp b/src/saga_core/saga_gui/data_source.cpp
index dd35b30..b138a0d 100644
--- a/src/saga_core/saga_gui/data_source.cpp
+++ b/src/saga_core/saga_gui/data_source.cpp
@@ -209,7 +209,7 @@ bool CData_Source::Set_Data_Source(CWKSP_Base_Item *pItem)
 	case WKSP_ITEM_TIN:
 	case WKSP_ITEM_PointCloud:
 	case WKSP_ITEM_Grid:
-		m_pFiles->SetPath(((CWKSP_Layer          *)pItem)->Get_Object()->Get_File_Name());
+		m_pFiles->SetPath(((CWKSP_Layer          *)pItem)->Get_Object()->Get_File_Name(false));
 		break;
 
 	case WKSP_ITEM_Module_Library:
diff --git a/src/saga_core/saga_gui/project.cpp b/src/saga_core/saga_gui/project.cpp
index b0cace9..2004905 100644
--- a/src/saga_core/saga_gui/project.cpp
+++ b/src/saga_core/saga_gui/project.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: project.cpp 2514 2015-06-19 16:03:47Z oconrad $
+ * Version $Id: project.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -497,6 +497,8 @@ bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 
 	if( !wxFileExists(File) )
 	{
+		MSG_Error_Add(wxString::Format("%s [%s]", _TL("data file does not exist"), File.c_str()));
+
 		return( false );
 	}
 
@@ -504,6 +506,8 @@ bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 
 	if( !pItem || !pItem->Get_Parameters() || !Entry.Get_Child("PARAMETERS") )
 	{
+		MSG_Error_Add(wxString::Format("%s [%s]", _TL("failed to load data"), File.c_str()));
+
 		return( false );
 	}
 
@@ -518,7 +522,7 @@ bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 
 			pEntry->Get_Child(i)->Set_Content(&s);
 
-		// if( SG_Compare_SAGA_Version(Version) < 0 )
+		//	if( SG_Compare_SAGA_Version(Version) < 0 )
 			{
 				if( pEntry->Get_Child(i)->Cmp_Property("id", "OVERLAY_1") )
 				{
@@ -543,7 +547,7 @@ bool CWKSP_Project::_Load_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 //---------------------------------------------------------
 bool CWKSP_Project::_Save_Data(CSG_MetaData &Entry, const wxString &ProjectDir, CSG_Data_Object *pDataObject, CSG_Parameters *pParameters)
 {
-	if( !pDataObject || !pDataObject->Get_File_Name() || !wxFileExists(pDataObject->Get_File_Name()) )
+	if( !pDataObject || !pDataObject->Get_File_Name(false) || !wxFileExists(pDataObject->Get_File_Name(false)) )
 	{
 		return( false );
 	}
@@ -560,7 +564,7 @@ bool CWKSP_Project::_Save_Data(CSG_MetaData &Entry, const wxString &ProjectDir,
 	case DATAOBJECT_TYPE_PointCloud:	pEntry->Add_Property("type", "POINTS");	break;
 	}
 
-	wxString	s(Get_FilePath_Relative(ProjectDir, pDataObject->Get_File_Name()));
+	wxString	s(Get_FilePath_Relative(ProjectDir, pDataObject->Get_File_Name(false)));
 
 	pEntry->Add_Child("FILE", &s);
 
@@ -703,9 +707,9 @@ bool CWKSP_Project::_Save_Map(CSG_MetaData &Entry, const wxString &ProjectDir, C
 		{
 			CSG_Data_Object	*pObject	= ((CWKSP_Map_Layer *)pMap->Get_Item(i))->Get_Layer()->Get_Object();
 
-			if( pObject && pObject->Get_File_Name() && wxFileExists(pObject->Get_File_Name()) )
+			if( pObject && pObject->Get_File_Name(false) && wxFileExists(pObject->Get_File_Name(false)) )
 			{
-				wxString	s(Get_FilePath_Relative(ProjectDir, pObject->Get_File_Name()));
+				wxString	s(Get_FilePath_Relative(ProjectDir, pObject->Get_File_Name(false)));
 
 				pEntry->Add_Child("FILE", &s);
 			}
@@ -730,7 +734,7 @@ bool CWKSP_Project::_Save_Map(CSG_MetaData &Entry, const wxString &ProjectDir, C
 //---------------------------------------------------------
 CWKSP_Base_Item * CWKSP_Project::_Get_byFileName(const wxString &FileName)
 {
-	return( g_pData->Get(SG_Get_Data_Manager().Find(&FileName)) );
+	return( g_pData->Get(SG_Get_Data_Manager().Find(&FileName, false)) );
 }
 
 
diff --git a/src/saga_core/saga_gui/res/saga.ger.txt b/src/saga_core/saga_gui/res/saga.ger.txt
index a0fb083..fc83786 100644
--- a/src/saga_core/saga_gui/res/saga.ger.txt
+++ b/src/saga_core/saga_gui/res/saga.ger.txt
@@ -46,14 +46,19 @@ TEXT	TRANSLATION
 "  Total Points:\t%ld"	""
 "  Total Pulses:\t%ld"	""
 "  Version:\t\t\t%d.%d"	""
+" Bed_shear_stress"	""
 "%.0f points from %d dataset(s) written to output grid %s."	""
 "%d points from %d dataset(s) written to output point cloud %s."	""
+"%d points from %s written to output %s."	""
+"%d points out of %d extracted."	""
+"%d points out of %d reclassified."	""
 "%d tiles created."	""
 "%d. %s"	""
 "%s_CORRPOINTS"	""
 "%s_DISP_VEC"	""
 "%s_colorised"	""
 "%s_merged"	""
+"%s_stats"	""
 "(Tw) wetness decline time constant"	"(TW) Feuchtigkeitsr�ckgang zeitkonstant"
 "(Tw) wetness decline time constant [lower bound]"	"(Tw) Feuchtigkeitsr�ckgang zeitkonstant [untere Grenze]"
 "(Tw) wetness decline time constant [upper bound]"	"(Tw) Feuchtigkeitsr�ckgang zeitkonstant [obere Grenze]"
@@ -63,6 +68,7 @@ TEXT	TRANSLATION
 "(b)"	""
 "(b) [lower bound]"	"(b) [untere Grenze]"
 "(b) [upper bound]"	"(b) [obere Grenze]"
+"(c) 2007 by O.Conrad, R.Heinrich"	""
 "(c) Parameter [lower bound]"	"(c) Parameter [untere Grenze]"
 "(c) Parameter [upper bound]"	"(c) Parameter [obere Grenz]"
 "(f) Temperature Modulation Factor [lower bound]"	"(f) Temperaturregulierungs Faktor [untere Grenze]"
@@ -88,7 +94,10 @@ TEXT	TRANSLATION
 "** Minimum: %.2lf K"	""
 "** Warning : Number of events might not be representative.\nMinimum number recommended: "	"**Warnung : Anzahl der Ereignisse ist nicht repr�sentativ. \nMinimale Anzahl erforderlich:"
 "** Warning : Outlet point was modified **"	"**Warnung : Ausgangspunkt wurde ver�ndert **"
-","	""
+"...anteilig aus Rasterzellen der Teileinzugegebiete"	""
+"...anteilig aus den Flussrasterzellen"	""
+"...anteilig aus den Hauptgerinnerasterzellen"	""
+"...genau den entsprechenden Wert aus der jeweiligen Rasterzelle entnehmen"	""
 "0"	""
 "0 - 1"	""
 "0 - 1.0"	""
@@ -204,7 +213,6 @@ TEXT	TRANSLATION
 "9 parameter 2nd order polynom (Zevenbergen & Thorne 1987)"	""
 ":-( :-( you are a loser :-( :-("	":-( :-( Du bist ein Versager :-( :-("
 ":-) :-) you are a winner :-) :-) Time:%ds\n"	":-) :-) Du bist ein Gewinner :-) :-) Zeit:%ds\n"
-";"	""
 "<"	""
 "<="	""
 "<all grid systems>"	"<alle Rastersysteme>"
@@ -226,26 +234,32 @@ TEXT	TRANSLATION
 "A grid that contains elevation data."	"Eine Rasterdatei die H�hendaten enth�lt."
 "A set of basic SAGA module programming examples."	"Ein Satz grundlegender Beispiele f�r die Modulprogrammierung."
 "A space separated list of key-value pairs (K=V)."	""
+"A text file with the full path to an input point cloud on each line"	""
 "A.Ringeler (c) 2003"	""
 "A3 Landscape"	"A3 Querformat"
 "A3 Portrait"	"A3 Hochformat"
 "A4 Landscape"	"A4 Querformat"
 "A4 Portrait"	"A4 Hochformat"
+"A:Garden"	""
 "A:Garden|Imagery"	""
+"A:Grid|Analysis|Macroecology"	""
 "A:Grid|Distances"	""
 "A:Grid|Filter"	""
 "A:Grid|Gaps"	""
 "A:Grid|Grid System"	""
+"A:Grid|Tools"	""
 "A:Grid|Values"	""
 "A:Imagery|Classification"	"A:Bildverarbeitung|Klassifizierung"
 "A:Imagery|Fourier Analysis"	""
 "A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	"A:Bildverarbeitung|Werkzeuge"
+"A:Jan Hohlbein"	""
 "A:Shapes|Construction"	"A:Vektoren|Konstruktion"
 "A:Shapes|Conversion"	"A:Vektoren|Umwandlung"
 "A:Shapes|Selection"	"A:Vektoren|Auswahl"
 "A:Shapes|Table"	"A:Vektoren|Tabelle"
 "A:Shapes|Tools"	"A:Vektoren|Werkzeuge"
+"A:Spatial and Geostatistics|Geographically Weighted Regression"	""
 "A:Spatial and Geostatistics|Points"	"A:Raum und Geostatistik|Punkte"
 "A:Table|Construction"	"A:Tabelle|Konstruktion"
 "A:Table|Selection"	"Tabelle|Auswahl"
@@ -277,6 +291,8 @@ TEXT	TRANSLATION
 "AWM2 Grid"	"AWM2 Raster"
 "AWT Grid"	"AWT Raster"
 "AZIMUTH"	"AZIMUTH"
+"Abflussmanipulation Rasterzelle 1... "	""
+"Abflussmanipulation Rasterzelle 2... "	""
 "About SAGA"	"�ber SAGA"
 "Above Elevation"	"�ber Anhebung"
 "Above this threshold snow will start to melt"	"�ber diesem Schwellenwert beginnt Schnee zu schmelzen"
@@ -321,6 +337,7 @@ TEXT	TRANSLATION
 "Add Grid Values to Points"	"Weise Rasterwerte Punkten zu"
 "Add Grid Values to Shapes"	"F�ge Rasterwerte in Vektor ein"
 "Add Identifier"	""
+"Add Indicator Fields for Categories"	""
 "Add Link to Files"	"Erzeuge Verkn�pfung zu Dateien"
 "Add Location Info"	""
 "Add Overlap"	""
@@ -343,8 +360,6 @@ TEXT	TRANSLATION
 "Add unique identifier attribute field to output, ID resembles processing order."	""
 "Added"	""
 "Addition"	"Addierung"
-"Additional Grids"	"Zus�tzliche Raster"
-"Additional Parameters"	"Zus�tzliche Parameter"
 "Additional Point Clouds"	"Zus�tzliche Punktwolken"
 "Additional Values"	"Zus�tzliche Werte"
 "Additional point clouds to merge with main point cloud."	""
@@ -365,6 +380,7 @@ TEXT	TRANSLATION
 "Aggregation"	"Vereinigung"
 "Aggregation Index"	"Zusammenf�hrungsindex"
 "Aggregation Size"	"Anh�ufung Gr��e"
+"Air Flow"	""
 "Air Humidity (2pm) [%%]"	"Luftfeuchte (2pm) [%%]"
 "Air Pressure, Water and Dust Content"	"Luftdruck, Wasser und Staub Inhalt"
 "Albedo"	""
@@ -381,12 +397,15 @@ TEXT	TRANSLATION
 "All Recognized Files"	"Alle erkannten Dateitypen"
 "All Times"	""
 "All Variables"	""
+"Allgemeine Parameter"	""
 "Allocation"	"Zuweisung"
 "Allocation Grid"	"Zuweisungsraster"
+"Allochthone Input"	""
+"Allochthoner Eintrag"	""
 "Allow Edge Pixels to be Seeds"	"Erlaube Kantenpixel Keime zu sein"
 "Allow longitudes outside -180 to 180 Range"	"Ber�cksichtige L�ngen au�erhalb -180 bis 180 Bereich"
 "Allow multiple observer positions."	""
-"Allows one to scale shade brightness [percent]"	""
+"Allows one to scale shade brightness [%]"	""
 "Allows to scale shade brightness, [percent]"	""
 "Allows to write cell values from additional grids to the output"	"Ber�cksichtige Zellwerte zus�tzlicher Rasterdateien bei der Ausgabe"
 "Alpha"	""
@@ -414,9 +433,11 @@ TEXT	TRANSLATION
 "Angle in degrees, counting clockwise from north"	"Winkel in Grad, Z�hlung im Uhrzeigersinn von Nord"
 "Angular Distance Weighted"	""
 "Annual"	""
+"Annual Climate"	""
 "Annual Course of Daily Insolation"	""
+"Answer"	""
+"Append Fields from another Table"	""
 "Append Rows from ..."	""
-"Append Rows from Table"	""
 "Applies also to the binary format header file."	"Anwendbar ebenfalls f�r die bin�re Formatkopfdatei"
 "Apply"	"Anwenden"
 "Apply Filter?"	""
@@ -432,6 +453,8 @@ TEXT	TRANSLATION
 "Approximate Terrain Slope [%]"	"ungef�hre Gel�ndeneigung [%]"
 "April"	"April"
 "Arc Vertex Distance [Degree]"	""
+"ArcGIS Version"	""
+"ArcSAGA Toolboxes"	""
 "Arcs to polygons"	"Kreissegmente zu Polygonen"
 "Area"	"Fl�che"
 "Area +"	"Fl�che +"
@@ -439,6 +462,7 @@ TEXT	TRANSLATION
 "Area Conversion"	""
 "Area [km2]"	"Fl�che [km�]"
 "Area [km2] Subbasin("	"Fl�che [km�] Teilbecken("
+"Area of an active channel within a cell"	""
 "Area of the Watershed in [km2]"	"Fl�che des Wassereinzugsgebietes in [km�]"
 "Area of the Watershed in [km2] used for unit conversion"	"Fl�che des Wassereinzugsgebietes [km�] die f�r Bereichsanpassung genutzt wird"
 "Area to Length Conversion"	"Fl�che f�r L�ngenanpassung"
@@ -469,10 +493,15 @@ TEXT	TRANSLATION
 "Atmospheric Pressure [mbar]"	"Atmospherischer Druck [mbar]"
 "Attribute"	"Attribut"
 "Attribute (Size)"	"Attribut (Gr��e)"
+"Attribute Field"	""
 "Attribute Field Properties"	"Eigenschaften Attributfeld"
+"Attribute Field to Grid"	""
 "Attribute Identification"	""
 "Attribute Table"	"Attributtabelle"
 "Attribute Values"	""
+"Attribute field number to copy is out of range!"	""
+"Attribute field number to grid is out of range!"	""
+"Attribute fields one to three (x;y;z) are mandatory!"	""
 "Attribute is Column ..."	"Attrbut steht in Spalte..."
 "Attribute to process."	"Attribute zum Bearbeiten"
 "Attribute used for naming the output file(s)"	""
@@ -480,11 +509,15 @@ TEXT	TRANSLATION
 "Attributes to add. Select none to add all"	""
 "Attributes to import besides x,y,z ..."	"Zu importierende Attribute au�er x,y,z..."
 "August"	"August"
+"Ausgabedaten"	""
+"Ausgangsgestein Layer"	""
+"Ausgangsrasterzelle Flusseinzugsgebiet [Default: Elbe5000]"	""
+"Auswahl der Art der anteiligen Flaechenwasserwasserentnahme."	""
+"Auswahl der Art der dynamischen Flaechenwasserwassernutzung (WUse). ACHTUNG: Funktioniert ggf. nur bei bereits initiierten Systemen bzw. nach Vorlauf"	""
 "Author"	"Autor"
 "Automated Cloud Cover Assessment"	""
 "Automatic"	""
 "Automatically adjust control points to grid's data range"	"Automatische Anpassung der Kontrollpunkte an den Wertebereich der Rasterdaten"
-"Automatically fits the grid to the shapes layers extent."	"Automatische Anpassung der Rasterdaten an die Ausdehnung der Vektorebene."
 "Automatically normalise attributes by standard deviation before clustering."	"Automatisches Normalisieren der Attribute mit Standardabweichung vor der Clusterbildung"
 "Automatically normalise grids by standard deviation before clustering."	"Automatisches Normalisieren der Rasterdaten mit Standardabweichung vor der Clusterbildung."
 "Available Choices"	"Auswahlm�glichkeiten"
@@ -498,7 +531,7 @@ TEXT	TRANSLATION
 "Average"	"Durchschnitt"
 "Average 2 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 1)."	"Durchschnitt 2 Mit Schwellenwert f�r die Rasterberechnung in x und y Entfernung, der nur Werte benutzt die sich weniger als der spezifische Schwellenwert vom zentralen Pixel unterscheiden. Jeder Wert hat eine Gewichtung die invers proportiona [...]
 "Average 3 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 2)."	"Durchschnitt 3 Mit Schwellenwert f�r die Rasterberechnung in x und y Entfernung, der nur Werte benutzt die sich weniger als der spezifische Schwellenwert von dem zentralen Pixel unterscheiden. Jeder Wert hat eine Gewichtung die invers proport [...]
-"Average Temperature"	""
+"Average Size"	""
 "Average With Mask 1"	"Durchschnitt mit Maske 1"
 "Average With Mask 1 calculates average for cells specified by a mask grid. Cell excluded by the mask grid are NOT used in the average calculation."	"Durchschnitt mit Maske 1 kalkuliert den Durchschnitt f�r Zellen innerhalb eines Schablonenrasters. Zellen au�erhalb des Schablonenrasters werden nicht f�r den berechneten Durchschnitt herangezogen."
 "Average With Mask 2"	"Mit Maske 2"
@@ -507,6 +540,8 @@ TEXT	TRANSLATION
 "Average With Thereshold 2"	"Durchschnitt mit Schwellenwert 2"
 "Average With Thereshold 3"	"Durchschnitt mit Schwellenwert 3"
 "Average With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. It's useful to remove noise whit a known maximum reducing the loss of informations"	"Durchschnitt Mit Schwellenwert f�r die Rasterberechnung in X und Y Entfernung, der nur Werte benutzt die sich weniger als der spezifische Schwellenwert vom zentralen Pixel unterscheiden. Es ist sinnvoll Noise mit einer bekannten Gr��e vorher zu  [...]
+"Average slope of watercourse: %.2f m/m"	""
+"Average velocity in watercourse: %.2f m/min"	""
 "Averages"	""
 "Avg. Curve Number"	"Durchschnittliche Kurvennummer"
 "Avg. Manning's N"	"Durchschnitt Manning�s N"
@@ -536,12 +571,14 @@ TEXT	TRANSLATION
 "BSL from File"	"BSL aus Datei"
 "Back Slope"	""
 "Background Color"	"Hintergrundfarbe"
+"Background Sample Density [Percent]"	""
 "Backpropagation algorithm"	""
 "Backpropagation parameters"	""
 "Backward"	"R�ckw�rts"
 "Backward Diagonal"	"R�ckw�rts diagonal"
 "Backward [Page Down]"	""
 "Backward diagonal hatch"	"Diagonal r�ckwarts schraffiert"
+"Bagnold"	""
 "Band"	""
 "Band 1"	""
 "Band 2"	""
@@ -553,7 +590,6 @@ TEXT	TRANSLATION
 "Band 7"	""
 "Band 8"	""
 "Bands"	"Banden"
-"Bandwidth"	""
 "Bandwidth (Cells)"	"Bandbreite (Zellen)"
 "Bare Earth"	"kahle Erde"
 "Bars"	"Balken"
@@ -564,9 +600,12 @@ TEXT	TRANSLATION
 "Basic measures for spatial point patterns."	"wesentliche Ma�einheiten f�r r�umliche Punktmuster"
 "Basin Type (Gravelius)"	"Becken Typ (Gravelius)"
 "Basins"	"Becken"
+"Bed_shear_stress"	""
 "Beep when finished"	""
 "Begin Transaction"	""
+"Begin with Year..."	""
 "Below this threshold precipitation will fall as snow"	"Unterhalb dieses Schwellenwertes f�llt  Niederschlag als Schnee"
+"Beruecksichtigung der Hauptgerinnerasterzellen?"	""
 "Beta"	""
 "Bicubic Spline"	""
 "Bicubic Spline Interpolation"	"Bikubische Spline Interpolation"
@@ -598,8 +637,10 @@ TEXT	TRANSLATION
 "Borders"	"Grenzen"
 "Bottom"	"Basis"
 "Bottom to Top"	"Unten bis Oben"
+"Boundary"	""
 "Boundary Effect"	""
 "Boundary Effect Color"	""
+"Boundery"	""
 "Bounding Box"	"Rahmen"
 "Bounding Box [B]"	""
 "Branches"	"Fachgebiete"
@@ -636,6 +677,7 @@ TEXT	TRANSLATION
 "CENTER"	"MITTE"
 "CFAC("	""
 "CFit\n(created by SAGA Wizard)."	"CPassend\n(durch SAGA Wizard erzeugt)."
+"CHELSA"	""
 "CLASS"	"KLASSE"
 "CLASS_ID"	""
 "CLASS_NR"	""
@@ -653,6 +695,7 @@ TEXT	TRANSLATION
 "Calculates the gradient based on the values of each triangle's points.\n\n"	"Berechnet den Gradient basierend auf dem Wert eines jeden Dreieckspunktes.\n\n"
 "Calculates weights for distance plus one, avoiding division by zero for zero distances"	"Berechnet die Gewichtung f�r Distanzen plus eins, Teilen durch null wird bei 0-Distanzen vermieden"
 "Calculating Catchment Area..."	"Berechne den Einzugsbereich..."
+"Calculating Contributing Area"	""
 "Calculating danger..."	"Berechne die Gefahr..."
 "Calculation"	"Berechnung"
 "Calculation Error"	""
@@ -675,13 +718,10 @@ TEXT	TRANSLATION
 "Case of contiguity"	"im Fall von N�he"
 "Cassini"	""
 "Catchment Area"	"Einzugsbereich"
-"Catchment Area (Flow Tracing)"	""
-"Catchment Area (Mass-Flux Method)"	""
-"Catchment Area (Recursive)"	""
-"Catchment Area (Top-Down)"	""
 "Catchment Area Calculation"	""
 "Catchment area"	"Einzugsbereich Fl�che"
 "Catchment slope"	"Einzugsbereich Gef�lle"
+"Categorical Features"	""
 "Categorical Grids"	""
 "Categories"	""
 "Cell Balance"	"Zellen Gleichgewicht"
@@ -713,6 +753,7 @@ TEXT	TRANSLATION
 "Centroid Y"	"Schwerpunkt Y"
 "Centroids"	"Schwerpunkt"
 "Centroids for each part"	"Schwerpunkt f�r jeden Teil"
+"Change"	""
 "Change Cell Values"	"�ndere Zellwerte"
 "Change Color Format"	""
 "Change Data Storage"	""
@@ -725,13 +766,17 @@ TEXT	TRANSLATION
 "Change Time Format"	"�nder Zeitformat"
 "Change Vector"	"�ndere Vektor"
 "Change Vector Analysis"	"Ver�nderungsvektor Analyse"
+"Change all values within radius."	""
 "Changed"	""
 "Changed Grid"	"Ge�ndertes Raster"
 "Changes"	"Ver�nderungen"
 "Channel"	""
 "Channel Definition Threshold (ha)"	"Gew�ssernetz Definition Schwellenwert (ha) "
 "Channel Density"	""
+"Channel Depth"	""
 "Channel Direction"	"Gew�sser Richtung"
+"Channel Initiation Threshold"	""
+"Channel Mask"	""
 "Channel Network"	"Gew�ssernetz"
 "Channel Network Base Level"	"Gew�ssernetz Ausgangsniveau"
 "Channel Network Distance"	""
@@ -743,9 +788,16 @@ TEXT	TRANSLATION
 "Channel Network: Pass 5"	"Gew�ssernetz: Durchlauf 5"
 "Channel Network: Pass 6"	"Gew�ssernetz: Durchlauf 6"
 "Channel Skeleton"	"Gew�sserger�st"
+"Channel Type"	""
 "Channel definition threshold"	"Gew�ssernetz Definition Schwellenwert"
+"Channel depth constant"	""
+"Channel depth exponent (depth = KDP * AREA^MDP)"	""
 "Channel network, all other cells NoData"	""
 "Channel side slope(m/m)"	"Gew�sserseite Neigung (m/m)"
+"Channel width constant ((s/m)^1/2"	""
+"Channel width constant [(s/m)^0.5]"	""
+"Channel_depth"	""
+"Channel_type"	""
 "Channels"	"Gew�sser"
 "Channels (Raster)"	"Gew�sser (Raster)"
 "Channels (Vector)"	"Gew�sser (Vektor)"
@@ -761,6 +813,7 @@ TEXT	TRANSLATION
 "Check the fields to export"	""
 "Check this in order to include NoData cells in the calculation."	""
 "Check this in order to include NoData points in the calculation."	""
+"Check this parameter to constrain the query by an attribute range."	""
 "Check this to create a new attribute with the reclassification result. If unchecked, the existing attribute is updated."	""
 "Checked"	""
 "Chessboard"	"Schachbrett"
@@ -771,9 +824,6 @@ TEXT	TRANSLATION
 "Choose 'slim' to trace grid node's shadow, 'fat' to trace the whole cell's shadow. The first is slightly faster but might show some artifacts."	""
 "Choose Cut from ..."	"W�hle Zuschnitt von.."
 "Choose Directory"	"Wechsle Verzeichnis"
-"Choose Grid"	"W�hle Raster"
-"Choose Grid Project"	"W�hle Rasterprojekt"
-"Choose Grid System"	"W�hle Rastersystem"
 "Choose Time Range"	"W�hle Zeitspanne"
 "Choose a flow routing algorithm that shall be used for the overland flow distance calculation:\n- D8\n- MFD"	"W�hle einen Flu�routingalgorithmus der f�r die �ber Land Flie�distanzberechnung genutzt werden soll:\n- D8\n- MFD "
 "Choose a method"	"W�hle eine Methode"
@@ -790,6 +840,8 @@ TEXT	TRANSLATION
 "Choose the activation function used by the neronal network."	""
 "Choose the classification constant to use"	""
 "Choose the map type to generate."	""
+"Choose the method how to insert additional points."	""
+"Choose the method to apply."	""
 "Choose the mode of operation"	""
 "Choose the training method used for the neronal network."	""
 "Choose the type of data used in this model."	""
@@ -805,9 +857,8 @@ TEXT	TRANSLATION
 "Class 1"	"Klasse 1"
 "Class 2"	"Klasse 2"
 "Class Identifier"	"Klassenidentifizierer"
-"Class Information"	"Klassen Information"
+"Class Name"	""
 "Class Selection"	"Klassenauswahl"
-"Class Statistics"	""
 "Classes"	"Klassen"
 "Classification"	"Klassifizierung"
 "Classification Constant"	"Klassifizierung Konstant"
@@ -815,11 +866,10 @@ TEXT	TRANSLATION
 "Classification Quality"	"Klassifizierungsqualit�t"
 "Classification Type"	"Klassifikationstyp"
 "Classification tools for grids."	"Klassifikationswerkzeug f�r Raster."
-"Classified"	""
 "Classify"	"Klassifiziere"
 "Claudy 3"	""
 "Clay"	"Ton"
-"Clay-Loam"	"Ton-Lehm"
+"Clay Loam"	""
 "Clear"	"L�schen"
 "Clear Fast Representativeness"	"L�sche Schnelle Vertreter"
 "Clear Generalisation"	"L�sche "
@@ -828,7 +878,10 @@ TEXT	TRANSLATION
 "Clear Selection"	""
 "Climate"	"Klima"
 "Climate Data"	"Klimadaten"
+"Climate and Weather Data"	""
+"Climate data regionalisation."	""
 "Climate parameters"	"Klima Parameter"
+"Climate|Climate Data"	""
 "Climatic Precession"	""
 "Clip Features"	""
 "Clip Grid with Polygon"	"Schneide Rasterdaten mit Polygon zu"
@@ -856,12 +909,16 @@ TEXT	TRANSLATION
 "Cloud Settings"	""
 "Cluster"	"Gruppe (Cluster)"
 "Cluster Analysis"	"Clusteranalyse"
+"Cluster Analysis (Shapes)"	""
 "Cluster Analysis PC"	"Clusteranalyse f�r Punktwolken"
 "Cluster Analysis for Grids"	"Clusteranalyse f�r Raster"
 "Cluster Analysis for Point Clouds"	"Clusteranalyse f�r Punktwolken"
 "ClusterID"	"Cluster ID"
 "Clusters"	"Cluster"
 "Coefficient of Determination"	"Bestimmtheitsma�"
+"Cold Air Height"	""
+"Cold Air Surface"	""
+"Cold Air Temperature [�C]"	""
 "Cold Cloud"	""
 "Collect values"	"Sammele Werte"
 "Collpase Options"	""
@@ -887,7 +944,6 @@ TEXT	TRANSLATION
 "Colouring"	""
 "Colours"	""
 "Colours Palette"	""
-"Cols"	"Spalten"
 "Columns"	"Spalten"
 "Combination A"	"Kombination A"
 "Combination B"	"Kombination B"
@@ -895,7 +951,9 @@ TEXT	TRANSLATION
 "Combined Minimum Distance / Hillclimbing"	"kombinierte Minimalentfernung / Bergsteigeralgorithmus"
 "Combined Shading"	"Kombinationsschummerung"
 "Comma Separated Values"	"durch Kommata getrennte Werte"
+"Command Line"	""
 "Command Line Arguments"	"Kommandozeilenargumente"
+"Command Line with Header"	""
 "Commands"	""
 "Comment"	"Kommentar"
 "Commit"	"�bergeben"
@@ -912,7 +970,10 @@ TEXT	TRANSLATION
 "CompuServe Graphics Interchange"	"CompuServe Graphics Interchange"
 "CompuServe Graphics Interchange (*.gif)"	"CompuServe Graphics Interchange (*.gif)"
 "Computed flow directions, 0=N, 1=NE, 2=E, ... 7=NW"	"Berechnete Flie�richtung. 0=N, 1=NE, 2=E, ... 7=NW"
+"Concentration"	""
+"Concentration Approximation Threshold"	""
 "Concentration time (h)"	"Sammlungszeit (h)"
+"Conceptualization of Spatial Relationships"	""
 "Condition"	"Bedingung"
 "Cone (Down)"	"Kegel (abw�rts)"
 "Cone (Up)"	"Kegel (aufw�rts)"
@@ -925,23 +986,29 @@ TEXT	TRANSLATION
 "Connected"	""
 "Connection to database failed"	""
 "Connections"	""
+"Connectivity"	""
 "Connectivity Analysis"	""
 "Connectivity Index (Pff)."	"Konnektivit�t Index"
+"Connectivity Neighbourhood"	""
 "Connectivity Weighting"	"Konnektivit�t Gewichtung"
 "Connectivity [Percent]"	"Konnektivit�t [Prozent]"
+"Conrad"	""
 "Constant Grid"	""
 "Constant Value"	""
 "Constant Variation Range [Degree]"	"konstanter Streubereich [Grad]"
 "Constant Wind Direction"	""
 "Constant variation range"	"konstanter Streubereich"
 "Constrain"	""
+"Constrain Query"	""
 "Constrain model through central window cell"	""
+"Constraining attribute field number is out of range!"	""
 "Constraints"	"Einschr�nkungen"
 "Contour"	""
 "Contour Lines"	"Isolinien"
 "Contour Lines from Grid"	"Isolinien von Rasterdaten"
 "Contour lines equidistance [map units]."	""
 "Contours"	""
+"Contributing Area"	""
 "Control Points"	"Kontrollpunkte"
 "Convergence"	"Ann�herung"
 "Convergence (FD8)"	"Ann�herung (FD8)"
@@ -966,6 +1033,7 @@ TEXT	TRANSLATION
 "Convert track points"	"Wandle Streckenpunkte um"
 "Convert way points"	"Wandle Wegpunkte um"
 "Converted Grid"	"Umgewandeltes Raster"
+"Converting ..."	""
 "Converts a TIN data set to shapes layers.\n\n"	"Wandelt einen TIN-Datensatz in eine Vektorebene um.\n\n"
 "Convex Hull"	"Konvexe H�lle"
 "Convexity"	""
@@ -987,6 +1055,7 @@ TEXT	TRANSLATION
 "Coordinates of target point outside of DEM!"	""
 "Copied Selection"	""
 "Copy"	"Kopieren"
+"Copy Attributes"	""
 "Copy Legend to Clipboard [Ctrl+L]"	""
 "Copy Legend to Clipboard..."	""
 "Copy Map to Clipboard [Ctrl+C]"	""
@@ -994,6 +1063,8 @@ TEXT	TRANSLATION
 "Copy Selection to New Shapes Layer"	"Kopiere Auswahl zu Neuer Vektorebene"
 "Copy Settings from other Layer"	""
 "Copy Settings from..."	"Kopiere Einstellungen von.."
+"Copy attributes from input to output point cloud."	""
+"Copy existing Attributes"	""
 "Copy to Clipboard"	""
 "Copying original data..."	"Kopiere Originaldaten�"
 "Copyright (c) 2007 by Thomas Schorr"	""
@@ -1031,6 +1102,7 @@ TEXT	TRANSLATION
 "Count Only Above Base Level"	"Z�hle nur �ber Ausgangsniveau"
 "Count Only Below Base Level"	"Z�hle nur unter Ausgangsniveau"
 "Count Points in Polygons"	"Anzahl Punkte in Polygonen"
+"Counter for function calls greater 0"	""
 "Covariance"	"Kovarianz"
 "Covariance Surface"	"Kovarianz Oberfl�che"
 "Covered Distance"	"zur�ckgelegte Entfernung"
@@ -1047,13 +1119,14 @@ TEXT	TRANSLATION
 "Create PDF Docs"	"Erzeuge PDF Dokumente"
 "Create PDF Documents"	"Erzeuge PDF Dokumente"
 "Create Point Grid"	"Erzeuge Punktraster"
+"Create Propabilities"	""
+"Create Reference Data"	""
 "Create Reference Points"	"Erzeuge Referenzpunkte"
 "Create Script Command File"	""
 "Create Single Multipart Polygon"	""
 "Create TIN from shapes"	""
 "Create Tileshape from Virtual Point Cloud"	""
 "Create Tool Description Files"	"Erstelle Werkzeugbeschreibungen als Dateien"
-"Create Variance Grid"	"Erzeuge Streuungsraster"
 "Create Virtual Point Cloud Dataset"	""
 "Create Web Content"	"Erzeuge Web-Inhalt"
 "Create X/Y Grids"	"Erzeuge X/Y-Raster"
@@ -1068,6 +1141,7 @@ TEXT	TRANSLATION
 "Croke et al. (2005)"	""
 "Croke et al. (2005) !!! not yet implemented !!!"	"Croke et. al. (2005) !!!noch nicht umgesetzt !!!"
 "Crop Coefficients"	"Ernte-Koeffizient"
+"Crop Statistics"	""
 "Crop to Data"	"Auf Daten zuschneiden"
 "Cropped Grids"	""
 "Cross"	"Gekreuzt"
@@ -1099,6 +1173,7 @@ TEXT	TRANSLATION
 "Cut"	"Schnitt"
 "Cut Shapes Layer"	"Schneide Vektorebene zu"
 "Cuts"	"Schnitte"
+"Cutting %s resulted in an empty point cloud, skipping output!"	""
 "Cycles"	"Zyklen"
 "Cylindrical Equal Area"	"Zylindrisch Fl�chentreu"
 "D"	""
@@ -1116,6 +1191,7 @@ TEXT	TRANSLATION
 "DEFAULT_BRIGHT"	"VOREINSTELLUNG_HELL"
 "DELAY("	"VERZ�GERUNG("
 "DEM"	"DGM"
+"DEM without Sinks"	""
 "DEMON"	"DEMON"
 "DEMON - Min. DQV"	""
 "DEMON - Minium Drainage Quota Volume (DQV) for traced flow tubes"	"DEMON - Minimales Abflussquotenvolumen (DQV) f�r aufgezeichnete Flie�r�hren"
@@ -1123,10 +1199,12 @@ TEXT	TRANSLATION
 "DIFF_MEAN"	"DIFFERENZ_DURCHSCHNITT"
 "DN"	""
 "DSN"	"Datenbank Server Name (DSN)"
+"DT Time step size (yrs)"	""
 "DTM 1"	""
 "DTM 2"	""
 "DTM Filter (slope-based)"	"DGM Filter (Neigungsbasiert)"
 "DTM, digital terrain model [m]"	"DTM, digitales Gel�ndemodell [m]"
+"DTMIN Minimum sub-time"	""
 "DXF"	""
 "DXF Files (*.dxf)|*.dxf|All Files|*.*"	"DXF Dateien (*.dxf)|*.dxf|Alle Dateien|*.*"
 "Daily Data"	""
@@ -1136,6 +1214,7 @@ TEXT	TRANSLATION
 "Dark Object Subtraction"	""
 "Darkness Digital Number (DN)"	""
 "Data"	""
+"Data Directory"	""
 "Data History"	""
 "Data Manager"	"Datenverwaltung"
 "Data Object"	""
@@ -1154,7 +1233,7 @@ TEXT	TRANSLATION
 "Database Connection Error"	"Datenbank Verbindungs Fehler"
 "Database Name"	""
 "Database access through the libmysql.lib interface."	"Datenbank-Zugriff durch das libmysql.lib Interface."
-"Database with Coordinate Reference System (CRS) definitions. You have to restart SAGA to make changes take affect!"	"Datenbestand mit Koordinaten-Referenz- System (CRS) Definitionen. SAGA muss neu gestartet werden, damit die �nderungen wirksam werden! "
+"Database with Coordinate Reference System (CRS) definitions. A restart of SAGA is required to have the changes take effect!"	""
 "Database|ODBC"	""
 "Database|PostgreSQL"	""
 "Dataset creation failed"	""
@@ -1197,14 +1276,18 @@ TEXT	TRANSLATION
 "Deepen Drainage Routes"	"Vertiefen der Entw�sserungsrouten"
 "Default"	"Voreinstellung"
 "Default Filter Matrix (3x3)"	"Voreinstellung Filter Matrix (3x3)"
+"Default Reference Height"	""
 "Default Rotation"	""
 "Default Size"	"Vorgegebene Gr��e"
+"Default Weathering Formula"	""
 "Defaults"	"Vorgaben"
 "Defaults for New Maps"	""
 "Define AOI by ..."	"Definiere AOI durch.. "
 "Define Georeference for Grids"	""
 "Definition"	""
 "Degree"	"Grad"
+"Dekang Lin"	""
+"Delay"	""
 "Delete"	"Entfernen"
 "Delete All Positions"	""
 "Delete All Positions [Ctrl + X]"	""
@@ -1223,6 +1306,8 @@ TEXT	TRANSLATION
 "Delete selected shape(s)."	"Entferne ausgew�hlte(n) Vektor(en)."
 "Deleting table"	"Entferne Tabelle"
 "Delineated watershed basins"	"eingezeichnete Wassereinzugsgebiete"
+"Delivery Index"	""
+"Dem"	""
 "Denoised"	""
 "Denoised Grid"	""
 "Denormalisation"	"Denormalisierung"
@@ -1239,6 +1324,9 @@ TEXT	TRANSLATION
 "Depression-free digital elevation model"	"Senkenfreies digitales H�henmodell"
 "Depth"	"Tiefe"
 "Depth to which data history is stored. Set -1 keeps all history entries (default), 0 switches history option off."	"Tiefe bis zu der die Datengeschichte gespeichert wird. -1 beh�lt alle Eintr�ge (Voreinstellung), 0 schaltet die Funktion ab."
+"Depth_base_rock"	""
+"Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 1 manipuliert werden. "	""
+"Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 2 manipuliert werden. "	""
 "Derivation of slope lengths from catchment areas. These are rough approximations! Applies not to Desmet & Govers' method."	"Abweichung der Hangl�nge vom Einzugsgebiet. Dieses sind grobe Absch�tzungen! Entspricht nicht der Methode von Desmet & Govers."
 "Derive contour lines."	""
 "Description"	"Beschreibung"
@@ -1267,8 +1355,8 @@ TEXT	TRANSLATION
 "Diameter plant elements"	""
 "Dictionary Files (*.dic)"	"W�rterbuch Dateien (*.dic)"
 "Dictionary Files (*.lng)"	"Sprachdateien (*.lng)"
-"Dictionary for Proj.4/OGC WKT translations. You have to restart SAGA to make changes take affect!"	"W�rterbuch f�r Proj.4/OGC WKT �bersetzungen. SAGA muss neu gestartet werden damit die �nderungen wirksam werden."
-"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply changes."	""
+"Dictionary for Proj.4/OGC WKT translations. A restart of SAGA is required to have the changes take effect!"	""
+"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply the changes."	""
 "Difference"	"Differenz"
 "Difference (A - B)"	"Differenz (A-B)"
 "Difference Input - Reconstruction"	""
@@ -1280,6 +1368,15 @@ TEXT	TRANSLATION
 "Difference to left neighbour (using a while loop)"	"Differenz zum linken Nachbarn ( Gebrauch w�hrend Schleife)"
 "Difference to local gradient."	"Differenz zum lokalen Gradient."
 "Diffuse Insolation"	"Diffuse Einstrahlung"
+"Diffuse Pollution Risk"	""
+"Diffusive Hillslope Evolution (ADI)"	""
+"Diffusive Hillslope Evolution (FTCS)"	""
+"Diffusivity [m2 / kyr]"	""
+"Diffusivity coefficient Kd (m^2/yr"	""
+"Diffusivity coefficient Kd (m^2/yr)"	""
+"Diffusivity coefficient Kd [m^2/a]"	""
+"Difuse Pollution Risk"	""
+"Digital Elevation Model"	""
 "Digital Elevation Model that has to be processed"	"Digitales Gel�ndemodell dass berechnet werden soll"
 "Digital Terrain Model"	"Digitales Gel�ndemodell"
 "Digital elevation model"	"Digitales H�henmodell"
@@ -1308,7 +1405,10 @@ TEXT	TRANSLATION
 "Directional Statistics for Points"	"Gerichtete Statistik f�r Punkte"
 "Directional Statistics for Single Grid"	"Gerichtete Statistik f�r Einzelraster"
 "Directory"	"Verzeichnis"
+"Directory with NCAR Grib Files"	""
 "Directory, where temporary cache files shall be saved."	"Verzeichnis, in dem tempor�re Dateipuffer gespeichert werden sollen."
+"Discharge exponent Mb for bedrock channel erosion"	""
+"Discharge exponent Mf for fluvial sediment transport"	""
 "Disconnect All"	""
 "Disconnect from ODBC Source"	""
 "Disconnect from PostgreSQL"	""
@@ -1319,6 +1419,9 @@ TEXT	TRANSLATION
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	"Anzeige"
+"Display Maximun"	""
+"Display Minimum"	""
+"Display Minimun"	""
 "Display Resolution"	"Aufl�sung Anzeige"
 "Display Type"	"Anzeige Typ"
 "Dissolve Buffers"	"Aufgel�ste Puffer"
@@ -1338,11 +1441,16 @@ TEXT	TRANSLATION
 "Distance Weighting"	"Entfernungs Gewichtung"
 "Distance Weighting Exponent"	""
 "Distance between points (grid units)."	"Entfernung zwischen Punkten (in Rastereinheiten)"
+"Distance to the Channel"	""
+"Distance to the Crest"	""
 "Distances"	""
 "Distinct"	"Deutlich"
 "Diurnal Anisotropic Heating"	"T�gliche anisotrope Erw�rmung"
 "Divergence"	"Abweichung"
+"Divergent Flow Accumulation / Object Update"	""
+"Divergent Upslope Curvature"	""
 "Diversity"	"Diversit�t"
+"Diversity of Categories"	""
 "Dividend"	""
 "Division"	"Division"
 "Division Height"	""
@@ -1364,13 +1472,17 @@ TEXT	TRANSLATION
 "Down"	"Ab"
 "Down [+]"	""
 "Down [End]"	""
-"Down-Scaling"	"herunterskalieren"
 "Downhill flow is bound to preferred routing cells, where these are not no-data. Helps to model e.g. small ditches, that are not well represented in the elevation data."	""
+"Downscaling Method"	""
 "Downslope Area"	"Hangfl�chengebiet"
 "Downslope Basins"	"Hangfl�chenbecken"
+"Downslope Curvature"	""
 "Downslope Distance Gradient"	"Hangfl�chendistanz Gradient"
+"Downstream weighting factor (between zero and ~1/2)"	""
+"Drainage Area"	""
 "Drainage Basins"	""
 "Drainage Network"	"Entw�sserungsnetzwerk"
+"Drainage_area"	""
 "Drape Map"	""
 "Draw Box"	""
 "Draw Faces"	""
@@ -1388,10 +1500,14 @@ TEXT	TRANSLATION
 "Duration of Insolation"	"Dauer der Sonneneinstrahlung"
 "Dust [ppm]"	"Staub [ppm]"
 "Dust factor: 100 ppm (standard)"	"Staubfaktor: 100 ppm (standard)"
+"Dynamics"	""
+"Dynamische Flaechenwassernutzung und Abflussreduktion"	""
+"Dynamische Flaechenwassernutzung..."	""
 "EDGES"	"KANTEN"
 "EHD, Effective hydrological depth of the soil [m]"	""
 "ENUM_ID"	""
 "EPSG Code"	"EPSG Kode"
+"EPSG code error"	""
 "ERDAS files other than version 7.4 are not supported."	"ERDAS-Dateien mit Ausnahme der Version 7.4 werden nicht unterst�tzt."
 "ESRI Arc/Info ASCII Grids (*.asc)"	"ESRI Arc/Info ASCII Rasterdateien (*.asc)"
 "ESRI Arc/Info Binary Grids (*.flt)"	"ESRI Arc/Info bin�re Rasterdateien (*.flt)"
@@ -1413,6 +1529,8 @@ TEXT	TRANSLATION
 "Edge"	"Rahmen"
 "Edge Contamination"	"Flankenkontamination"
 "Edge Detection (ViGrA)"	""
+"Edge Points"	""
+"Edge Segments"	""
 "Edge threshold for nonlinear smoothing"	"Grenzschwellenwert f�r nichtlineare Gl�ttung"
 "Edges"	"Kanten"
 "Edit"	"Bearbeiten"
@@ -1422,18 +1540,25 @@ TEXT	TRANSLATION
 "Edit Selected Shape"	"Ausgew�hlte Vektoren bearbeiten"
 "Edit Shapes"	"Vektoren bearbeiten"
 "Efective friction = stated friction ^f , where f = cos(DifAngle)^k."	"effektive Reibung = vorgegebene Reibung ^f , wobei f = cos(DifWinkel)^k. "
+"Eff. Precipitation Rate"	""
 "Effective Air Flow Heights"	"Effektive Luftflussh�hen"
 "Effective Flow Length"	""
 "Effective Rainfall"	""
 "Effective hydrological depth"	""
+"Effective precipitation rate (m/yr, or m/s for MPM)"	""
+"Effective precipitation rate, [m/a] or [m/s] for MPM"	""
 "Eigen Vectors"	""
 "Eigen reduction failed"	"Eigen Reduktion fehlgeschlagen"
 "Eigenvalue"	"Eigenwert"
 "Eigenvectors"	"Eigenvektoren"
+"Eingangsdaten"	""
+"Einheit in der die WUse Daten vorliegen"	""
+"Einlesen der NCache Textdatei"	""
 "Element Shape"	"Element Vektor"
 "Elements"	"Elemente"
 "Elevation"	"H�he"
 "Elevation Averaging"	""
+"Elevation Difference"	""
 "Elevation Grid"	"H�henraster"
 "Elevation Range"	"Erhebungsbereich"
 "Elevation Threshold"	""
@@ -1441,12 +1566,16 @@ TEXT	TRANSLATION
 "Elevation at Reference Station [m]"	"H�he an Referenzstation [m]"
 "Elevation grid"	"H�henraster"
 "Elevation range (zMax (%.2f) - zMin (%.2f)) is equal or lower than zero!"	""
+"Elevations"	""
 "Ellipsoid Definition"	"Ellipsoid Definition"
 "Ellipsoid Height [m]"	"Ellipsoid H�he [m]"
 "Ellipsoids"	"Ellipsoide"
 "Encountered invalid path description in *.spcvf file!"	""
+"Encountered invalid path description in *.spcvf_tile_info file!"	""
 "End Latitude"	""
 "End Longitude"	""
+"End Time"	""
+"End with Year..."	""
 "Enforce True Color"	"Erzwinge Echtfarben"
 "Enhanced Vegetation Index"	""
 "Entropy"	""
@@ -1469,7 +1598,9 @@ TEXT	TRANSLATION
 "Error in Trend Calculation"	"Fehler in Trendberechnung"
 "Error in formula"	"Fehler in Formel"
 "Error parsing attribute fields: can't convert to number"	"Fehler beim Analysieren der Attributfelder: Umwandlung in Zahl nicht m�glich"
+"Error parsing attribute fields: can't convert to number!"	""
 "Error parsing attribute fields: field index out of range"	"Fehler beim Analysieren der Attributfelder: Feldindex au�erhalb des Wertebereiches"
+"Error parsing attribute fields: field index out of range!"	""
 "Error parsing field type: can't convert to number"	""
 "Error: Continue anyway ?"	"Fehler: Trotzdem fortfahren?"
 "Errors"	"Fehler"
@@ -1480,12 +1611,20 @@ TEXT	TRANSLATION
 "Estimated noise relative to mean standard deviation"	"abgesch�tztes Rauschen relativ zur mittleren Standardabweichung"
 "Et/Eo, ratio of actual to potential evapotranspiration"	""
 "Euclidean"	"Euklidisch"
+"Euclidian Distance"	""
+"EvP1 Name"	""
+"EvP2 Name"	""
+"EvP3 Name"	""
+"Evaluierungspunkt 1 [Default: Elbe5000]"	""
+"Evaluierungspunkt 2 [Default: Elbe5000]"	""
+"Evaluierungspunkt 3 [Default: Elbe5000]"	""
 "Evapotranspiration"	""
 "Evapotranspiration [m / dt]"	""
 "Exact"	""
 "Exaggeration"	"�berh�hung"
 "Exaggeration Factor"	"�berh�hung"
 "Exaggeration Z"	""
+"Excess shear stress exponent"	""
 "Exclude No-Data Area"	""
 "Exclude NoData Cells"	"Zellen ohne Wert ausschlie�en"
 "Execute"	"Ausf�hren"
@@ -1502,8 +1641,6 @@ TEXT	TRANSLATION
 "Expansion Degree"	""
 "Exponent"	"Exponent"
 "Exponent for distance weighting (0.0-4.0)"	"Exponent f�r Distanzgewichtung"
-"Exponential Model"	"Exponentialmodell"
-"Exponential Regression"	"Exponentielle Regression"
 "Export Atlas Boundary File"	"Export Atlas Boundary Datei"
 "Export ESRI Arc/Info Grid"	"Export ESRI Arc/Info Rasterdaten"
 "Export GPX"	"Export GPX"
@@ -1568,20 +1705,24 @@ TEXT	TRANSLATION
 "Feigenbaum's Bifurcation"	"Feigenbaum�s Verzweigung"
 "Ferhat Bing�l (c) 2009"	""
 "Field"	"Feld"
+"Field %d: Name=\"%s\" "	""
 "Field (ID)"	"Feld (ID)"
 "Field (Name)"	"Feld (Name)"
 "Field Capacity [mm]"	"Feldkapazit�t [mm]"
 "Field Definition"	"Feld Definition"
 "Field Description"	"Feld Beschreibung"
+"Field Identifier"	""
 "Field Name"	"Feld Name"
 "Field Names"	"Feldnamen"
 "Field Naming"	"Feldbenennung"
 "Field Properties"	"Feld Eigenschaften"
 "Field Separator"	"Feld Trennzeichen"
+"Field Statistics"	""
 "Field Type"	"Feld Typ"
 "Field Types"	"Feldtypen"
 "Field data type"	"Feld Datentyp"
 "Field for Summary"	"Feld f�r Zusammenfassung"
+"Field numbers (starting from 1) of the attributes to copy, separated by semicolon; fields one to three (x;y;z) are mandatory."	""
 "Field with identifier."	"Feld mit Identifizierer"
 "Field with measure information."	""
 "Field with x-coordinate."	"Feld mit X-Koordinate"
@@ -1620,7 +1761,9 @@ TEXT	TRANSLATION
 "Fill Color"	"F�llfarbe"
 "Fill Color 1"	""
 "Fill Color 2"	""
+"Fill Gaps (Mean Value Cellular Automat)"	""
 "Fill Gaps in Records"	""
+"Fill Increment"	""
 "Fill NoData"	"F�llen der NoData-Zellen"
 "Fill Sinks"	"F�lle Senken"
 "Fill Sinks (Planchon/Darboux, 2001)"	"F�lle Senken (Planchon/Darboux, 2001)"
@@ -1658,12 +1801,12 @@ TEXT	TRANSLATION
 "Fire Spreading Analysis"	""
 "First Class"	"Erste Klasse"
 "First Day"	"Erster tag"
+"First Derivative is singular! Probably the shape containes consecutive identical points.\n\n"	""
 "First input grid"	"Erstes Eingaberaster"
 "Fit"	"Passend"
 "Fit Color Palette to Grid Values"	"Passe Farbpalette an Rasterwerte an"
 "Fit Column Sizes"	""
 "Fit Diagram to Window"	"Diagramm an Fenster anpassen"
-"Fit Extent"	"Passe an Bereich an"
 "Fit Map Scale"	"Kartenmassstab anpassen"
 "Fit N Points to shape"	"N Punkte an Vektor anpassen"
 "Fit Row Sizes"	""
@@ -1678,8 +1821,10 @@ TEXT	TRANSLATION
 "Fixed angle"	"Fester Winkel"
 "Fixed value to be replaced"	"Auszutauschender fester Wert"
 "Fixed|Cell value|"	"Fest|Zellwert|"
+"Flaechenverbrauch-Auswahl (FvA)"	""
 "Flame Length"	"Flammenl�nge"
 "Flame Length (m)"	"Flammenl�nge (m)"
+"Flat Area Threshold"	""
 "Flat Area Values"	"Wohngebietwerte"
 "Flat Areas"	"Wohngebiete"
 "Flat Detection"	"Flacherkennung"
@@ -1691,10 +1836,22 @@ TEXT	TRANSLATION
 "Floating Point (4 byte)"	"Flie�kommazahl (4 Byte)"
 "Floating Point (8 byte)"	"Flie�kommazahl (8 Byte)"
 "Floating point"	""
+"Flood Depth"	""
+"Flood Height"	""
+"Flooded"	""
+"Flooded Surface"	""
 "Flooded digital elevation model"	"�berflutetes Digitales H�henmodell"
+"Flooding Status"	""
+"Flooding_status"	""
+"Flow"	""
 "Flow Accumulation"	"Str�mung Akkumulierung"
+"Flow Accumulation (Flow Tracing)"	""
+"Flow Accumulation (Mass-Flux Method)"	""
 "Flow Accumulation (Parallel)"	"Str�mung Akkumulierung (Parallel)"
+"Flow Accumulation (Recursive)"	""
+"Flow Accumulation (Top-Down)"	""
 "Flow Accumulation (Trace)"	"Str�mung Akkumulierung (Spur)"
+"Flow Accumulation Unit"	""
 "Flow Algorithm"	"Str�mung Algorithmus"
 "Flow Connectivity"	"Str�mung Konnektivit�t"
 "Flow Correction"	"Str�mung Korrektur"
@@ -1703,6 +1860,7 @@ TEXT	TRANSLATION
 "Flow Depth Grid (m)"	"Str�mung Tiefenraster (m)"
 "Flow Direction"	"Str�mung Richtung"
 "Flow Direction (up and down)"	"Str�mung Richtung (auf und ab)"
+"Flow Direction Algorithm"	""
 "Flow Directions"	"Str�mung Richtungen"
 "Flow Distance"	"Flie�entfernung"
 "Flow Distances"	"Flie�entfernungen"
@@ -1719,6 +1877,8 @@ TEXT	TRANSLATION
 "Flow Width and Specific Catchment Area"	""
 "Flow at Gauges"	"Str�mung an Messlehren"
 "Flow threshold, given as amount of cells, above which flow transport is unlimited. Ignored if range equals zero."	""
+"Fluvial Transport"	""
+"Fluvial sediment transport coefficient Kf"	""
 "Flux"	""
 "Flux out of each cell, i.e. everything accumulated so far."	""
 "Flying Height"	""
@@ -1760,9 +1920,11 @@ TEXT	TRANSLATION
 "Frame Width"	"Rahmenbreite"
 "Frame Width [Pixels]"	"Rahmenbreite [Pixel]"
 "Frequency"	"Frequenz"
+"From"	""
 "Fuel Model"	"Treibstoff Modell"
 "Full path to the directory for the output grids of each model step"	""
 "Function"	"Funktion"
+"Function Calls > 0"	""
 "Function Fit"	"Funktionsanpassung"
 "Function Fitting Range"	"Funktionsanpassungsbereich"
 "Function Parameters"	"Funktionsparameter"
@@ -1792,6 +1954,7 @@ TEXT	TRANSLATION
 "GPX file"	"GPX Datei"
 "GPX files (*.gpx)|*.gpx|All Files|*.*"	"GPX Datei (*.gpx)|*.gpx|Alle Dateien|*.*"
 "GPX to shapefile"	"GPX zu Vektordatei"
+"GRAD * MFD"	""
 "GREEN_BLUE"	"GR�N_BLAU"
 "GREEN_GREY_BLUE"	"GR�N_GRAU_BLAU"
 "GREEN_RED_BLUE"	"GR�N_ROT_BLAU"
@@ -1817,6 +1980,7 @@ TEXT	TRANSLATION
 "Games"	"Spiele"
 "Gamma"	""
 "Garden"	""
+"Garden|Dynamics"	""
 "Garden|Introducing Module Programming"	"Testversionen|Einf�hrung in die Modulprogrammierung"
 "Garden|Recreations|Fractals"	"Testversionen|Erholung|Fraktale"
 "Garden|Recreations|Games"	"Testversionen|Erholung|Spiele"
@@ -1824,11 +1988,12 @@ TEXT	TRANSLATION
 "Gauges"	"Ma�e"
 "Gaussian"	"Gau�sche"
 "Gaussian Filter"	"Gau�filter"
+"Gaussian Filtering"	""
 "Gaussian Landscape"	"Gaussche Landschaft"
 "Gaussian Landscapes"	"Gaussche Landschaften"
-"Gaussian Model"	"Gaussches Model"
 "Gaussian and Exponential Weighting Bandwidth"	"Gaussche und exponentiale gewichtete Bandbreite"
 "Gc"	""
+"Geary's C"	""
 "General"	"Allgemein"
 "General Curvature"	""
 "General Settings"	"Allgemeine Einstellungen"
@@ -1836,8 +2001,10 @@ TEXT	TRANSLATION
 "Generalized Surface"	""
 "Generate Shapes"	"Erzeuge Vektoren"
 "Generated Shapefile."	"Erzeuge Vektordatei."
+"Generic"	""
 "Geo-Reference"	"Georeferenz"
 "GeoTIFF (*.tif)"	""
+"GeoTIFF Files"	""
 "GeoTRANS"	""
 "GeoTRANS engine initializing error!\n\nPlease check your data path settings!"	"GeoTRANS modul Initialisierungsfehler!\n\nBitte die Einstellungen des Datenpfades �berpr�fen!"
 "GeoTrans (Grid)"	"GeoTRANS (Raster)"
@@ -1849,13 +2016,15 @@ TEXT	TRANSLATION
 "Geographic Coordinate System"	"Geographisches Koordinatensystem"
 "Geographic Coordinate Systems"	"Geographische Koordinatensysteme"
 "Geographic Coordinates"	""
+"Geographic Distances"	""
+"Geographic Distances (Pair of Coordinates)"	""
 "Geoid"	"Geoid"
 "Geometric Figures"	"Geometrische Figur"
 "Geometry Type"	""
+"Geopotential Height"	""
 "Geoprocessing"	"Geoverarbeitung"
 "Georeferencing"	""
 "Get CRS Definition from..."	"Hole CRS-Definitionen von...."
-"Get Class Statistics from..."	""
 "Get Extent for ..."	""
 "Get Grid from Virtual Point Cloud"	""
 "Get Heights from ..."	""
@@ -1863,12 +2032,15 @@ TEXT	TRANSLATION
 "Get Shapes Extents"	"Nimm Vektorausdehnung"
 "Get Subset from Virtual Point Cloud"	""
 "Get table from MySQL server.\n"	"Hole Tabelle vom MySQL-Server.\n"
-"Gianluca Massei (c) 2007 (g_massa at libero.it)"	""
 "Global Irradiation"	""
 "Global Moran's I for Grids"	"Globales Moran�s I f�r Raster"
 "Globe Viewer for Grids"	""
 "Gnomonic"	"Gnomonisch"
 "Gpx2shp path"	"Gpx2shp Pfad"
+"GraD"	""
+"Grad"	""
+"Grad Norm"	""
+"Grad_Poss"	""
 "Gradient"	"Gradient"
 "Gradient Calculation"	"Gradientkalkulation"
 "Gradient Difference"	"Gradient Differenz"
@@ -1879,15 +2051,18 @@ TEXT	TRANSLATION
 "Gradient Vectors from Directional Components"	""
 "Gradient Vectors from Surface"	""
 "Gradient threshold"	"Gradient Schwellenwert"
+"Gradient_Tangs"	""
 "Graduated"	""
 "Graduated Colors"	""
 "Graduated Colours"	""
 "Graticule"	"Gitternetz"
+"Great Elliptic"	""
 "Greater than"	"Gr��er als"
 "Green"	"Gr�n"
 "Green (TM 3)"	"Gr�n (TM 3)"
 "Green-Ampt Infiltration"	"Gr�n-ampt Infiltration"
 "Greenness"	""
+"Grib Files (*.grb)"	""
 "Grid"	"Raster"
 "Grid 1"	"Raster 1"
 "Grid 2"	"Raster 2"
@@ -1897,16 +2072,18 @@ TEXT	TRANSLATION
 "Grid Difference"	"Raster Differenz"
 "Grid Division"	""
 "Grid Interpolation"	"Raster Interpolation"
+"Grid List"	""
 "Grid Manager"	"Rasterverwaltung"
 "Grid Masking"	"Raster Abdeckung"
 "Grid Normalisation"	"Raster Normierung"
 "Grid Orientation"	"Raster Ausrichtung"
 "Grid Project"	"Raster Projekt"
 "Grid Proximity Buffer"	"Raster Nachbarschaftspuffer"
-"Grid Size"	"Raster Gr��e"
 "Grid Skeletonization"	"Raster Ger�st"
 "Grid Spacing (Map Units)"	""
 "Grid Standardisation"	"Raster Standardisation"
+"Grid Statistics"	""
+"Grid Statistics for Points"	""
 "Grid Statistics for Polygons"	"Rasterstatistik f�r Polygone"
 "Grid System"	"Rastersystem"
 "Grid System Extent"	"Raster Ausdehnung"
@@ -1939,6 +2116,8 @@ TEXT	TRANSLATION
 "Grid to filter"	"zu filterndes Raster"
 "Grid to reclassify"	"neueinzuteilendes Raster"
 "Grid value equals low value"	"Rasterwert ist gleich zu niedrigem Wert"
+"Grid with Gaps"	""
+"Grid with Gaps Filled"	""
 "Grid with category of nearest source cell [Category]"	"Raster mit Gruppen n�chster Ausgangszellen [Kategorie]"
 "Grid with euclidian distance to nearest source cell [grid units]"	"Raster mit euklidischer Entfernung zu n�chsten Ausgangszellen [Rastereinheiten]"
 "Grid with features to be buffered [Category/NoData]"	"Raster mit Merkmalen die zu puffern sind [Kategorie/NoData]"
@@ -1970,9 +2149,12 @@ TEXT	TRANSLATION
 "Gz"	""
 "HTML"	""
 "Hafer"	"Hafer"
+"Half the size of the moving window [vertex count], controls smoothing sensitivity."	""
 "Halo Width"	""
 "Has Field Names"	"Hat den Feldnamen"
+"Hauptgerinne-Parameter (erweitertes HD-Modell)"	""
 "Having"	"Haben"
+"Headline"	""
 "Heads"	"K�pfe"
 "Height"	"H�he"
 "Height (Cells)"	"H�he (Zellen)"
@@ -2001,6 +2183,7 @@ TEXT	TRANSLATION
 "Hill Radius"	""
 "Hill-Climbing (Rubin 1967)"	"Bergsteigeralgorithmus (Rubin 1967)"
 "Hillslope Index"	""
+"Hillslope_reservoir"	""
 "Histogram"	"Histogramm"
 "Histogram Stretch"	""
 "Histogram Stretch Dialog"	""
@@ -2011,6 +2194,8 @@ TEXT	TRANSLATION
 "Histogram cloud signature:"	""
 "History"	"Entstehung"
 "History Depth"	"Stufen der Entstehung"
+"Hodge-Podge"	""
+"Hodge-Podge Machine"	""
 "Hollow"	""
 "Homepage"	""
 "Homogenous"	"Homogen"
@@ -2020,6 +2205,7 @@ TEXT	TRANSLATION
 "Horizontal Offset"	""
 "Horizontal Overland Flow Distance"	"Horizontale �ber Land Str�mungsdistanz"
 "Horizontal Range"	"Horizontaler Bereich"
+"Horizontal Tracer Density"	""
 "Horizontal hatch"	"horizontale Schraffur"
 "Horizontally mirrored"	"horizontal gespiegelt"
 "Host"	""
@@ -2034,6 +2220,10 @@ TEXT	TRANSLATION
 "Humedad del combustible muerto en 100-horas"	""
 "Humification Factor"	"Humifizierungsfaktor"
 "Humus to Charcoal"	"Humus zu Kohle"
+"Hydro CA"	""
+"Hydro CA 2"	""
+"Hydro CA 3"	""
+"Hydro CA 4"	""
 "Hydrology"	""
 "Hydrology: IHACRES"	""
 "Hypsometric Curve"	"Hypsometriekurve"
@@ -2067,6 +2257,7 @@ TEXT	TRANSLATION
 "Ice"	"Eis"
 "Identifier"	"Bezeichner"
 "Identity"	""
+"If Table exists..."	""
 "If checked the snow module is active"	"Wenn abgehakt ist das Schneemodul aktiv"
 "If checked, it means there is no external inflow to the subbasin"	"Wenn abgehakt, gibt es keinen externen Zustrom zu dem Teilbecken"
 "If checked, snow-melt module is used."	"Wenn abgehakt wird das Schneeschmelzmodul benutzt."
@@ -2094,6 +2285,8 @@ TEXT	TRANSLATION
 "Image Files"	"Bild Dateien"
 "Image Grid"	"Bild Raster"
 "Image Import/Export."	"Bild Import/Export"
+"Image Properties"	""
+"Image Resolution"	""
 "Image Rotation [Degree]"	"Bild Drehung [Grad]"
 "Image acquisition date (yyyy-mm-dd)"	""
 "Image creation date (yyyy-mm-dd)"	""
@@ -2120,9 +2313,12 @@ TEXT	TRANSLATION
 "Import Filter"	"Import Filter"
 "Import GPX"	"Import GPX"
 "Import GRIB2 record"	"Import GRIB2 Datensatz"
+"Import GSOD Stations to Data Base"	""
+"Import GSOD to Data Base"	""
 "Import GStat Shapes"	"Import GStat Vektoren"
 "Import Grid from Table"	"Import Raster von Tabelle"
 "Import Grid from XYZ"	"Import Raster von XYZ"
+"Import Grids from KML"	""
 "Import Image (bmp, jpg, png, tif, gif, pnm, xpm)"	"Import Bild (bmp, jpg, png, tif, gif, pnm, xpm)"
 "Import LAS Files"	"Import LAS Dateien"
 "Import MOLA Grid (MEGDR)"	"Import MOLA Raster (MEGDR)"
@@ -2152,6 +2348,7 @@ TEXT	TRANSLATION
 "Import and export filter for ESRI's E00 file exchange format."	"Import und Export Filter f�r ESRI�s E00 Dateiaustauschformat."
 "Import from File"	""
 "Import from Open Street Map"	"Importiere von Open Street Map"
+"Import, Clip and Resample Grids"	""
 "Import/Export"	""
 "Importing"	"Einlesend"
 "Importing data ..."	"Daten einlesend..."
@@ -2174,10 +2371,10 @@ TEXT	TRANSLATION
 "Increase factor n_plus. Must be > 1."	""
 "Independent Variable (per Grid and Cell)"	"Unabh�ngige Variable (f�r Raster und Zelle)"
 "Independent Variable (per Grid)"	"Unabh�ngige Variable (f�r Raster)"
-"Independent Variables"	""
 "Index"	""
 "Indicatrix"	""
 "Indices"	""
+"Infection Speed"	""
 "Infiltration excess runoff [m/dt]"	"Versickerungs�berschuss Abfluss [m/dt]"
 "Infiltration rate [m/dt]"	"Versickerungsrate"
 "Informe"	"Benachrichtigen"
@@ -2189,23 +2386,29 @@ TEXT	TRANSLATION
 "Initial Number of Fishes [%]"	"Anfangsanzahl von Fischen [%]"
 "Initial Number of Sharks [%]"	"Anfangsanzahl von Haien [%]"
 "Initial State"	"Anfangszustand"
+"Initial Surface"	""
 "Initial Threshold for Slope"	"Anfangsschwellenwert f�r das Gef�lle"
 "Initial root zone storage deficit [m]"	"Anfangswurzelzonen Speicher Defizit [m]"
+"Initial sediment cover (m)"	""
+"Initial sediment cover thickness (m)"	""
 "Initial subsurface flow per unit area [m/h]"	"Anf�ngliche unterirdische Str�mung pro Fl�cheneinheit [m/h]"
 "Initial update value"	""
 "Initial value delta_0 of update-values delta_ij."	""
 "Initialisation"	"Initialisierung"
 "Initialization Value"	"Initialisierungswert"
+"Initialize"	""
 "Initializing ..."	"Initialisierend..."
 "Initializing Fields"	""
 "Initializing direction matrix..."	"Initialisere Richtungsmatrix..."
 "Initiation Grid"	"Startraster"
 "Initiation Threshold"	"Anfangsschwellenwert"
 "Initiation Type"	"Anfangs Typ"
+"Inlet Concentration"	""
 "Inner Buffer"	""
 "Input"	"Eingabe"
 "Input Binary Grid"	""
 "Input Features"	""
+"Input File List"	""
 "Input File's NoData Value"	"Eingabedatei�s NoData-Wert"
 "Input Files"	"Eingabedatei"
 "Input Format"	"Eingabeformat"
@@ -2217,6 +2420,7 @@ TEXT	TRANSLATION
 "Input data for the trained network."	""
 "Input data to train the network."	""
 "Input file"	"Eingabedatei"
+"Input file list could not be opened!"	""
 "Input for Mean over Catchment Calculation"	""
 "Input for module calculations."	"Eingabe f�r Modulberechnungen."
 "Input for the morphological reconstruction"	""
@@ -2230,10 +2434,11 @@ TEXT	TRANSLATION
 "Input table or shapefile"	""
 "Insert"	"Einf�gen"
 "Insert Additional Points"	"Zus�tzliche Punkte einf�gen"
-"Insert Distance"	"Entfernung einf�gen"
 "Insert Method"	"Einf�gemethode"
 "Insert Position"	"Einf�geposition"
 "Insert Record"	"F�ge Datensatz ein"
+"Insertion"	""
+"Insertion Distance"	""
 "Integer"	""
 "Integer (1 byte)"	"Ganzzahl (1 Byte)"
 "Integer (2 byte)"	"Ganzzahl (2 Byte)"
@@ -2257,6 +2462,7 @@ TEXT	TRANSLATION
 "Interpolated Colors"	"Interpolierte Farben"
 "Interpolation"	"Interpolation"
 "Interpolation Method"	"Interpolationsmethode"
+"Interpolation Scale"	""
 "Interpolation Steps"	"Interpolationsschritte"
 "Intersect"	""
 "Intersection"	"Schnittfl�che"
@@ -2296,6 +2502,10 @@ TEXT	TRANSLATION
 "JPEG - JFIF Compliant"	"JPEG - JFIF konform"
 "JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)"	"JPEG - JFIF konform (*.jpg, *.jif, *.jpeg)"
 "JPG Files"	"JPG Dateien"
+"Ja, Abfluss manuell vorgeben: res. Abfluss = Speicherinhalt * q + a"	""
+"Ja, TestRoutine1 fuer Flusseinzugsgebiet bis zu der HG-Rasterzelle"	""
+"Ja, TestRoutine1 nur fuer Teileinzugsgbiet der HG-Rasterzelle"	""
+"Ja, berechneten Abfluss veraendern: res. Abfluss = berechn. Abfluss * q + a"	""
 "Jakeman & Hornberger (1993)"	""
 "January"	"Januar"
 "Johan Van de Wauw (c) 2009"	""
@@ -2317,7 +2527,10 @@ TEXT	TRANSLATION
 "K2"	""
 "K3"	""
 "KE"	""
+"KF Fluvial sediment transport coefficien"	""
 "KML files (*.kml)"	""
+"KML/KMZ File"	""
+"KML/KMZ Files"	""
 "Kappa"	""
 "Kappa Offset [degree]"	""
 "Kappa [degree]"	""
@@ -2331,9 +2544,11 @@ TEXT	TRANSLATION
 "Kernel"	"Kern"
 "Kernel Density"	"Kern Dichte"
 "Kernel Density Estimation"	"Kern Dichteabsch�tzung "
+"Kernel Size"	""
 "Kernel Type"	""
 "Kind of initializing Precipitation Event"	"Art der Initialisierung des Niederschlagsereignisses"
 "Kinematic Routing Algorithm"	"kinematischer Routing Algorithmus"
+"Known Crops"	""
 "Known X"	""
 "Known Y"	""
 "Kriging"	""
@@ -2345,6 +2560,7 @@ TEXT	TRANSLATION
 "LAS Info"	"LAS Info"
 "LAS header exception: %s"	""
 "LAS reader exception: %s"	""
+"LEM 2013-02-21"	""
 "LFAC("	"LFAC("
 "LP, Saturated lateral permeability of the soil [m/day]"	""
 "LS"	""
@@ -2363,10 +2579,13 @@ TEXT	TRANSLATION
 "Lake Flood"	"See Hochwasser"
 "Lambert Conformal Conic (1 parallel)"	"Lambert konformer Kegel (1 parallel)"
 "Lambert Conformal Conic (2 parallel)"	"Lambert konformer Kegel (1 parallel)"
+"Land Cover Weights"	""
 "Land Surface Temperature"	"Bodenoberfl�chentemperatur"
 "Land Surface Temperature [Deg.Celsius]"	"Bodenoberfl�chentemperatur (Grad Celsius)"
 "Land Use"	"Landnutzung"
 "Land Use ID"	"Landnutzungs ID"
+"Land Use Scenario"	""
+"Land Use Scenario Generator"	""
 "Landform"	""
 "Landforms"	""
 "Landsat"	"Landsat"
@@ -2386,10 +2605,15 @@ TEXT	TRANSLATION
 "Landsat-5 TM"	""
 "Landsat-7 ETM+"	""
 "Landsat-8 OLI/TIRS"	""
+"Landscape Evolution"	""
+"Landscape Evolution Model"	""
+"Landscape Evolution Modelling"	""
 "Language Translations"	"Sprach�bersetzungen"
 "Laplace Filter"	"Laplace Filter"
 "Laplacian Filter"	"Laplace Filter"
+"Laplacian Filter Kernel"	""
 "Last Day"	"Letzter Tag"
+"Last RingeLEM"	""
 "Lat"	""
 "Lat. of True Scale"	"Breitengrad des genauen Massstabs"
 "Latitude"	"Breitengrad"
@@ -2436,16 +2660,17 @@ TEXT	TRANSLATION
 "Legend: Save"	"Legende: Speichern"
 "Legend: Zoom"	"Legende: Vergr��erung"
 "Length"	"L�nge"
+"Length of the Gaussian window:\t %d"	""
 "Less than"	"Weniger als"
-"Let pixel stay unclassified, if maximum likelihood probability is less than threshold."	"Lasse Pixel unklassifiziert, wenn die maximale Wahrscheinlichkeit kleiner ist als der Schwellenwert."
-"Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."	"Lasse Pixel unklassifiziert, wenn das Minimum oder die Mahalanobis-Distanz gr��er als der Schwellenwert ist."
+"Let pixel stay unclassified, if maximum likelihood probability value is less than threshold."	""
+"Let pixel stay unclassified, if minimum euclidian or mahalanobis distance is greater than threshold."	""
 "Let pixel stay unclassified, if spectral angle distance is greater than threshold."	"Lasse Pixell unklassifiziert, wenn die spektale Blickwinkelentfernung gr��er als der Schwellenwert ist."
 "Level"	"Stufe"
 "Level Aggregation"	"flache Anh�ufung"
 "Level Heights"	""
 "Level of Detail"	"Detaillierungsgrad"
 "Level of Generalisation"	"Stufe der Generalisierung"
-"Level of significance for automated predictor selection, given as percentage"	""
+"Levels"	""
 "Library"	"Bibliothek"
 "Life"	"Leben"
 "Life Cycle"	"Lebenszyklus"
@@ -2466,6 +2691,7 @@ TEXT	TRANSLATION
 "Line Properties"	"Linie Eigenschaften"
 "Line Simplification"	"Linie Vereinfachung"
 "Line Size"	""
+"Line Smoothing"	""
 "Line Style"	"Linienstil"
 "Line Transect(s)"	"Linie Transsekte"
 "Line or polygon shapefile to simplify."	""
@@ -2477,7 +2703,6 @@ TEXT	TRANSLATION
 "Linear Flow Threshold"	"Lineare Str�mung Schwellenwert"
 "Linear Flow Threshold Grid"	"Lineare Str�mung Schwellenwert Raster"
 "Linear Module"	"Lineares Modul"
-"Linear Regression"	"Lineare Regression"
 "Linear: a + b * x"	"Linear: a + b * x"
 "Lines"	"Linien"
 "Lines (extended)"	""
@@ -2492,6 +2717,8 @@ TEXT	TRANSLATION
 "List of Measured Points as PC"	""
 "List of Shapes Layers"	"Vektordatens�tze"
 "Listing"	""
+"Lithology"	""
+"Lithology_of_uppermost_rock_layer"	""
 "Litter to Humus"	"Abfall zu Humus"
 "Litterfall Rate [g/m\xb2/a]"	""
 "Little Endian (Intel)"	""
@@ -2503,11 +2730,13 @@ TEXT	TRANSLATION
 "Load Project"	"Lade Projekt"
 "Load Settings"	"Lade Einstellungen"
 "Load Shapes"	"Lade Vektor"
+"Load Statistics from File..."	""
 "Load TIN"	""
 "Load Table"	"Lade Tabelle"
 "Load Text"	"Lade Text"
 "Load Tool Library"	"Lade Werkzeugbibliothek"
 "Load all bands"	""
+"Load from File..."	""
 "Load grid"	"Lade Raster"
 "Load library"	"Lade Bibliothek"
 "Load point cloud"	"Lade Punktwolke"
@@ -2516,6 +2745,7 @@ TEXT	TRANSLATION
 "Load shapefile after conversion"	"Lade Vektordatei nach Umwandlung"
 "Load shapes"	"Lade Vektoren"
 "Load table"	"Lade Tabelle"
+"Load to Memory"	""
 "Load tool chain"	""
 "Loaded Grid"	""
 "Loaded Shapes"	""
@@ -2523,19 +2753,27 @@ TEXT	TRANSLATION
 "Loam"	"Lehm"
 "Loamy Sand"	"lehmiger Sand"
 "Local Cartesian"	"�rtlich Kartesisch"
+"Local Correlation"	""
+"Local Curvature"	""
+"Local Downslope Curvature"	""
+"Local Geary's C"	""
 "Local Maxima"	"Lokales Maximum"
 "Local Minima"	"Lokales Minimum"
 "Local Minima and Maxima"	"Lokale Minima und Maxima"
+"Local Moran's I"	""
 "Local Ridges"	""
 "Local Ridges, Hills in Valleys"	""
 "Local Rotation Base Level"	"Lokale Rotation der Grundlinie"
 "Local Rotation [Degree]"	"Lokale Rotation [Grad]"
 "Local Sky View Factor"	"Lokaler Himmelsblickfaktor"
+"Local Spatial Autocorrelation"	""
 "Local Time (user defined reference)"	"Ortszeit (Benutzerdefinierte Referenz)"
+"Local Upslope Curvature"	""
 "Local time relates to grid's..."	"Ortszeit bezieht sich auf Raster.."
 "Locate STRM30 Data File"	"Lokalisiere STRM30 Datendateien"
 "Locate..."	"Lokalisiere..."
 "Location"	"Position"
+"Locational Risk"	""
 "Locations"	"Orte"
 "Logarithmic (down)"	"Logarithmisch (abw�rts)"
 "Logarithmic (up)"	"Logarithmisch (aufw�rts)"
@@ -2548,6 +2786,7 @@ TEXT	TRANSLATION
 "Long Dashed"	""
 "Long dashed style"	"lang gestrichelt"
 "Long text"	""
+"Longest watercourse length: %.2f m"	""
 "Longitude"	""
 "Longitude 1"	"L�ngengrad 1"
 "Longitude 2"	"L�ngengrad 2"
@@ -2581,6 +2820,8 @@ TEXT	TRANSLATION
 "Lower Border (Y)"	"Untere Grenze (Y)"
 "Lower Tolerance"	"Untere Toleranz"
 "Lower left corner"	"Untere linke Ecke"
+"Loxodrome"	""
+"Loxodromes"	""
 "Lumped Atmospheric Transmittance"	"konzentrierte atmosph�rische Durchl�ssigkeit"
 "Lumped Atmospheric Transmittance [Percent]"	"konzentrierte atmosph�rische Durchl�ssigkeit [Prozent]"
 "Luv Factor"	"Luv Faktor"
@@ -2590,6 +2831,7 @@ TEXT	TRANSLATION
 "MDE"	""
 "MEAN"	"MITTELWERT"
 "MFD"	""
+"MFD * Gradient"	""
 "MIN"	"MIN"
 "MINIMUM"	"MINIMUM"
 "MLRA Coefficients"	""
@@ -2598,6 +2840,7 @@ TEXT	TRANSLATION
 "MMF-SAGA Soil Erosion Model"	""
 "MOLA Grids (*.img)|*.img|All Files|*.*"	"MOLA Raster (*.img)|*.img|Alle Dateien|*.*"
 "MORAN_I"	""
+"MPM"	""
 "MRRTF"	""
 "MRVBF"	""
 "MS Windows Bitmap (*.bmp)|*.bmp|All Files|*.*"	"MS Windows Bitmap (*.bmp)|*.bmp|Alle Dateien|*.*"
@@ -2618,6 +2861,8 @@ TEXT	TRANSLATION
 "Mandelbrot"	"Mandelbrot"
 "Mandelbrot Set"	"Mandelbrot Zusammenstellung"
 "Manhattan"	"Manhattan"
+"Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 1"	""
+"Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 2"	""
 "Manning's N"	"Manning�s N"
 "Manning's Roughness"	"Manning�s Rauhigkeit"
 "Manning-Strickler Coefficient"	""
@@ -2634,6 +2879,7 @@ TEXT	TRANSLATION
 "Map Selection"	"Kartenauswahl"
 "Map Units"	"Karte Einheiten"
 "Map Width [Pixels]"	"Kartenbreite [Pixel]"
+"Map Window Arrangement"	""
 "Map/Table Size Ratio [%]"	"Karten/Tabellen Gr��enverh�ltnis [%]"
 "Maps"	"Karten"
 "March"	"M�rz"
@@ -2662,7 +2908,9 @@ TEXT	TRANSLATION
 "Maximal Number of Points"	"Maximale Anzahl der Punkte"
 "Maximimum Number of Samples"	"Maximale Anzahl Proben"
 "Maximum"	"Maximum"
+"Maximum Angle"	""
 "Maximum Cells (C Correction Analysis)"	"Maximum Zellen (C Korrekturanalyse)"
+"Maximum Change"	""
 "Maximum Contour Value"	"Maximaler Isolinienwert"
 "Maximum Curvature"	""
 "Maximum Deviation between estimated excess rainfall and observed streamflow volumes"	"Maximale Abwewichung zwischen abgesch�tzten Niederschlagsereignissen und beobachteten Abflussvolumina"
@@ -2670,6 +2918,9 @@ TEXT	TRANSLATION
 "Maximum Disparity"	""
 "Maximum Distance"	"Maximale Entfernung"
 "Maximum Distance [Cells]"	"Maximale Entfernung (Zellen)"
+"Maximum Entropy"	""
+"Maximum Entropy Classifcation"	""
+"Maximum Entropy Presence Prediction"	""
 "Maximum Flow Distance"	"Maximale Flie�entfernung"
 "Maximum Height"	""
 "Maximum Iterations"	"Maximale Iterationen"
@@ -2683,17 +2934,19 @@ TEXT	TRANSLATION
 "Maximum Search Distance"	""
 "Maximum Search Radius"	"Maximaler Suchradius"
 "Maximum Search Radius (cells)"	"Maximaler Suchradius (Zellen)"
-"Maximum Search Radius (map units)"	"Maximaler Suchradius (Karteneinheiten)"
 "Maximum Selection"	""
 "Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"	"Maximale Summe von �bereingesch�tztem �berschussregen zu totalem �berschussregen in [%]"
 "Maximum Temperature"	""
+"Maximum Thickness"	""
 "Maximum Time Span (Seconds)"	""
 "Maximum Total Order"	"Maximale Gesamtanordnung"
 "Maximum Value"	"Maximaler Wert"
 "Maximum X Order"	"Maximum X Reihenfolge"
 "Maximum Y Order"	"Maximum Y Reihenfolge"
+"Maximum angular difference as degree between adjacent segment points."	""
 "Maximum deviation allowed between original and simplified curve [map units]."	""
 "Maximum distance parameter is ignored if set to zero (default)."	"Maximaler Entfernungsparameter wird ignoriert wenn auf null gesetzt (Voreinstellung)."
+"Maximum entropy based classification and prediction."	""
 "Maximum number of classes in entire grid."	"maximale Anzahl der Klassen in vollst�ndigem Raster"
 "Maximum number of classes in the entire grid."	"maximale Anzahl der Klassen in vollst�ndigem Raster"
 "Maximum number of grid cells used for trend analysis as required by C correction."	"Maximale Anzahl von Rasterzellen die f�r die Trendanalyse benutzt werden wie erforderlich f�r C Korrektur."
@@ -2715,8 +2968,10 @@ TEXT	TRANSLATION
 "Mean Flow Distance"	"Mittlere Flie�entfernung"
 "Mean Solar Irradiance"	""
 "Mean Squared Error"	""
+"Mean Temperature"	""
 "Mean Value"	"Mittlerer Wert"
 "Mean Value (cell area weighted)"	"Mittlerer Wert (Zellbereich gewichtet)"
+"Mean annual flow per unit area (m/s for MPM)"	""
 "Mean less Standard Deviation"	"Mittelwert abz�glich Standardabweichung"
 "Mean over Catchment"	""
 "Mean plus Standard Deviation"	"Mittelwert zuz�glich Standardabweichung"
@@ -2724,6 +2979,7 @@ TEXT	TRANSLATION
 "Mean saturation deficit (in watershed) [m]"	"Mittleres S�ttigungsdefizit (im Einzugsgebiet) [m]"
 "Mean soil loss"	""
 "Mean temperature"	""
+"Mean_elevation"	""
 "Measure Distance"	""
 "Measured Points (PC)"	""
 "Median"	"Medianwert"
@@ -2751,6 +3007,7 @@ TEXT	TRANSLATION
 "Metadata"	""
 "Metadata File"	""
 "Metadata Files (*.met, *.txt)"	""
+"Metadata from Header:"	""
 "Meteorological data"	"Meteorologische Daten"
 "Meteorological data for multiple timestep modelling [model step (day); temperature (Celsius); rainfall (mm), rainfall intensity (mm/h); rainfall duration (day); timespan (days)]"	""
 "Method"	"Methode"
@@ -2771,7 +3028,6 @@ TEXT	TRANSLATION
 "Min. Segment Length"	"Minimale Segmentl�nge"
 "Min. Size"	"Minimale Gr��e"
 "Min. Size (Cells)"	"Minimale Gr��e (Zellen)"
-"Min./Max. Number of m_Points"	"Min./Max. Anzahl der m_Punkte"
 "Mine Sweeper"	"Mine Sweeper"
 "Minima"	"Minima"
 "Minimal Curvature"	""
@@ -2785,12 +3041,16 @@ TEXT	TRANSLATION
 "Minimum Distance"	"Minimaldistanz"
 "Minimum Distance Analysis"	"Minimale Entfernung Analyse"
 "Minimum Exaggeration [%]"	"Minimale �berh�hung [%]"
+"Minimum Gradient"	""
 "Minimum Height"	""
+"Minimum Magnitude"	""
 "Minimum Nash-Sutcliffe Efficiency"	"Minimale Nash-Sutcliffe Effizienz"
 "Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"	"Minimale Nash-Sutcliffe Effizienz erfordert, dass die Simulation in die Kalibrierungstabelle �bertragen wird"
 "Minimum Node Split Size"	""
 "Minimum Number of Dark Object Cells"	""
 "Minimum Number of Points"	"Minimale Anzahl von Punkten"
+"Minimum Pressure Level [mb]"	""
+"Minimum Probability"	""
 "Minimum Redundancy Feature Selection"	""
 "Minimum Resolution (Degree)"	""
 "Minimum Segment Length (Cells)"	"Minimale Segmentl�nge (Zellen)"
@@ -2798,18 +3058,26 @@ TEXT	TRANSLATION
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	"Minimale Neigung [Grad]"
 "Minimum Standard Deviation"	"Minimale Standardabweichung"
+"Minimum Step Size"	""
 "Minimum Temperature"	""
+"Minimum Thickness"	""
 "Minimum Threshold"	""
+"Minimum Time Step [a]"	""
+"Minimum Time Step [years]"	""
 "Minimum Value"	"minimaler Wert"
+"Minimum and maximum of attribute range []."	""
 "Minimum and maximum x-coordinate of AOI."	""
 "Minimum and maximum y-coordinate of AOI."	""
+"Minimum magnitude as percentile."	""
 "Minimum number of cells in a group of adjacent cells."	""
 "Minimum of Darkness DN Cells"	""
 "Minimum pixels to consider digital number as dark object"	""
+"Minimum probability to accept a classification result for a cell."	""
 "Minimum shade brightness must be lower than maximum shade brightness!"	""
 "Minimum size"	"Minimalgr��e"
 "Minimum size of basin (cells)"	"Minimale Gr��e des Becken (Zellen)"
 "Minimum slope gradient to preserve from cell to cell; with a value of zero sinks are filled up to the spill elevation (which results in flat areas). Unit [Degree]"	"Minimaler Neigungsgradient der von Zelle zu Zelle eingehalten werden soll [Grad]"
+"Minimum sub-time step size (yrs)"	""
 "Minimum value of the range to be reclassified."	"Minimaler Wert des neueinzuteilenden Bereichs"
 "Minimum/Maximum"	"Minimum/Maximum"
 "Minimun"	"Minimum"
@@ -2834,6 +3102,8 @@ TEXT	TRANSLATION
 "Model parameter [m]"	"Modelparameter [m]"
 "Model parameters"	""
 "Model step %d/%d ..."	""
+"Modelled DEM"	""
+"Modelled Elevation"	""
 "Modelling erosion processes."	""
 "Modelling hydrological processes."	"Modellierung hydrologischer Prozesse."
 "Modelling the Human Impact on Nature"	""
@@ -2852,6 +3122,8 @@ TEXT	TRANSLATION
 "Monthly Global by Latitude"	""
 "Moore"	""
 "Moore & Nieber 1989"	""
+"Moore (8)"	""
+"Moore Contiguity"	""
 "Moore et al. 1991"	""
 "Moran's I"	""
 "Morphological Filter"	"Morphologischer Filter"
@@ -2881,6 +3153,7 @@ TEXT	TRANSLATION
 "Multi-Band Variation"	"Multi-Band Variation"
 "Multilevel B-Spline Interpolation"	"Multilevel B-Spline Interpolation"
 "Multilevel B-Spline Interpolation (from Grid)"	"Multilevel B-Spline Interpolation (von Rastern)"
+"Multilevel B-Spline Interpolation for Categories"	""
 "Multiple Flow Direction"	"Multiple Str�mungsrichtungen"
 "Multiple Flow Direction (FD8)"	"Multiple Str�mungsrichtungen (FD8)"
 "Multiple Flow Direction (Quinn et al. 1991)"	"Multiple Str�mungsrichtungen (Quinn et al. 1991)"
@@ -2891,8 +3164,9 @@ TEXT	TRANSLATION
 "Multiple Maximum Downslope Gradient Based Flow Directon"	""
 "Multiple Observer"	""
 "Multiple R-squared"	""
-"Multiple Regression Analysis (Grid/Grids)"	""
-"Multiple Regression Analysis (Points/Grids)"	"Multiple Regressionsanalyse (Punkte/Raster)"
+"Multiple Regression Analysis"	""
+"Multiple Regression Analysis (Grid and Predictor Grids)"	""
+"Multiple Regression Analysis (Points and Predictor Grids)"	""
 "Multiple Triangular Flow Directon"	"Multiple Triangulare Str�mungsrichtung"
 "Multiple m_Flow Direction"	""
 "Multiple of Standard Deviation used as default for histogram stretch."	""
@@ -2900,12 +3174,17 @@ TEXT	TRANSLATION
 "Multipoint"	"Multipoint"
 "Multipoints"	""
 "Multiresolution Index of Valley Bottom Flatness (MRVBF)"	"Multiresolution Index f�r Talbodenplattheit (MRVBF)"
+"Multleve B-Spline Interpolation"	""
 "Mutual Information Difference (MID)"	""
 "Mutual Information Quotient (MIQ)"	""
 "MySQL Data"	"MySQL Daten"
 "My_Module Module Sub Menu"	""
 "NAME"	"NAME"
+"NBR_X"	""
+"NBR_Y"	""
+"NCAR Climate Import"	""
 "NCELLS"	"NZELLEN"
+"NCache einlesen"	""
 "NEIGHBORS"	"NACHBARN"
 "NEON"	"NEON"
 "NO DATA"	""
@@ -2923,6 +3202,9 @@ TEXT	TRANSLATION
 "Name"	"Name"
 "Name Field"	"Namensfeld"
 "Name by..."	"Name durch..."
+"Name des Evaluierungspunktes 1"	""
+"Name des Evaluierungspunktes 2"	""
+"Name des Evaluierungspunktes 3"	""
 "Name of Landsat metadata file (.met or MTL.txt)"	""
 "Natural Neighbour"	"Nat�rliche Nachbarn-Methode"
 "Navaladi, Schoeller, Conrad (c) 2009"	""
@@ -2938,17 +3220,18 @@ TEXT	TRANSLATION
 "Neighborhood"	"Umgebung"
 "Neighborhood Type"	"Umgebungstyp"
 "Neighbourhood"	"Umgebung"
+"Neighbourhood (Radius)"	""
 "Net Primary Production [Gt Carbon / a]"	"Netz Prim�r Produktion [Gt Kohlenstoff / a]"
 "NetCDF Files (*.nc)"	""
 "Network topology"	""
 "Neumann"	""
+"Neumann Contiguity"	""
 "Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
 "Neural Networks (OpenCV)"	""
 "New"	"Neu"
 "New Grid Dimensions"	"Neue Rasterdimensionen"
 "New Shapes Layer"	"Neue Vektorebene"
 "New Table"	"Neue Tabelle"
-"New Value"	"Neuer Wert"
 "New grid filtered with the A1WiTh module"	"Neues Raster gefiltert mit dem A1WiTh Modul"
 "New grid filtered with the A2WiTh module"	"Neues Raster gefiltert mit dem A2WiTh Modul"
 "New grid filtered with the A3WiTh module"	"Neues Raster gefiltert mit dem A3WiTh Modul"
@@ -2976,20 +3259,25 @@ TEXT	TRANSLATION
 "No OUTPUT vector normalization"	""
 "No Options"	""
 "No PostgreSQL connection available!"	""
+"No Sinks"	""
+"No attribute fields selected!"	""
 "No attribute fields specified!"	""
 "No data"	""
 "No data loaded."	"Keine Daten geladen."
 "No description available"	"Keine Beschreibung verf�gbar"
 "No duplicates found."	"Keine Duplikate gefunden."
+"No grid in list"	""
 "No objects"	""
 "No parameters available."	"Keine Parameter verf�gbar."
 "No path for output files specified!"	""
 "No pen is used"	"Kein Stift im Gebrauch"
+"No projects in directory"	""
 "No shapes in selection"	"Keine Vektoren ausgew�hlt"
 "No sinks have been detected."	"Keine Senken gefunden."
 "No translation set by user"	"Keine �bersetzung durch den Nutzer ausgew�hlt"
 "NoData Output Grid"	""
 "NoData Value"	"NoDATA Wert"
+"NoData Value: %.6f"	""
 "NoData encountered in input grid %s: x %d (%.2f), y %d (%.2f)"	""
 "NoData value of input grid"	""
 "NoData value(s) in statistic grid(s)!"	"NoData Wert(e) in Statistikraster(n)!"
@@ -3023,13 +3311,13 @@ TEXT	TRANSLATION
 "Nothing to do: there is no intersection with additonal grid."	"Nichts zu tun: es gibt keine Schnittmenge mit zus�tzlichem Raster."
 "November"	"November"
 "No|Yes|"	"Nein|Ja|"
-"Nugget"	"Brocken"
 "Number Of Shapes"	"Anzahl der Vektoren"
 "Number in Latitudinal Direction"	""
 "Number in Meridional Direction"	""
 "Number of Attributes"	"Anzahl der Attribute"
 "Number of Buffer Zones"	"Anzahl der Pufferzonen"
 "Number of CPU Cores [# physical processors]"	"Anzahl der CPU-Kerne [#physische Prozessoren]"
+"Number of Categories"	""
 "Number of Cells"	"Anzahl der Zellen"
 "Number of Classes"	"Anzahl der Klassen"
 "Number of Clusters"	"Anzahl der Cluster"
@@ -3048,11 +3336,13 @@ TEXT	TRANSLATION
 "Number of Fields"	"Anzahl der Felder"
 "Number of Grid Cells"	"Anzahl der Rasterzellen"
 "Number of Grids"	"Anzahl der Raster"
+"Number of Infection States"	""
 "Number of Intervals"	""
 "Number of Iterations"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
 "Number of No-Data Cells"	""
+"Number of Numeric Value Classes"	""
 "Number of Pairs"	"Anzahl der Paare"
 "Number of Parts"	"Anzahl der Teile"
 "Number of Points"	"Anzahl der Punkte"
@@ -3068,8 +3358,10 @@ TEXT	TRANSLATION
 "Number of Values"	"Anzahl der Werte"
 "Number of Variables"	"Anzahl der Variablen"
 "Number of Vertices"	""
+"Number of added tools"	""
 "Number of additional attributes to import."	"Anzahl der zus�tzlichen Attribute die zu importieren sind."
 "Number of arguments for attribute fields (%d), names (%d) and types (%d) do not match!"	""
+"Number of attribute fields: %d"	""
 "Number of atttribute table columns."	"Nummer der Attributtabellenspalte"
 "Number of cells"	"Anzahl der Zellen"
 "Number of classes in the cloud temperature histogram"	""
@@ -3096,9 +3388,11 @@ TEXT	TRANSLATION
 "Numbering of Data Sets"	"Nummerierung der Datens�tze"
 "Numeric"	"Numerisch"
 "Numeric Attribute Values"	""
+"Numerical Features"	""
 "Numerical Precision"	"Numerische Pr�zision"
 "O. Conrad (c) 2009"	""
 "O. Conrad (c) 2011"	""
+"O.C.'s Tests"	""
 "O.Conrad (c) 2010"	""
 "O.Conrad (c) 2011"	""
 "O.Conrad (c) 2013"	""
@@ -3121,6 +3415,7 @@ TEXT	TRANSLATION
 "OUTPUT certainty"	""
 "OUTPUT classes"	""
 "Object Grid"	""
+"Object Update"	""
 "Objective Function"	"Objektive Funktion"
 "Objects removed from input grid"	"Objekte die aus dem Eingaberaster entfernt wurden"
 "Oblique Mercator"	"schiefer Merkator"
@@ -3144,6 +3439,7 @@ TEXT	TRANSLATION
 "Omega"	""
 "Omega [degree]"	""
 "One Point Cloud per Polygon"	""
+"One or several input point cloud datasets to cut."	""
 "One per x"	"Einer per x"
 "Online Help"	"Online Hilfe"
 "Only Header Info"	"Nur Kopfzeilen Info"
@@ -3154,8 +3450,10 @@ TEXT	TRANSLATION
 "Opaque"	""
 "Open"	"�ffnen"
 "Open Database Connection"	""
+"Open Project"	""
 "Open Slopes"	""
 "OpenCV"	""
+"OpenMP: Slope, Aspect"	""
 "Opening"	"Er�ffnung"
 "Openness"	""
 "Operation"	"Operation"
@@ -3163,8 +3461,10 @@ TEXT	TRANSLATION
 "Operator Type"	"Operatortyp"
 "Operator scale"	"Operator Umfang"
 "Opposite Neighbours"	"entgegengesetzte Nachbarn"
+"Optimised"	""
 "Optional Output Filepath"	""
 "Optional Target Grids"	""
+"Optional Tile Info Filename"	""
 "Optional floating-point vector of weights for each sample. Some samples may be more important than others for training."	""
 "Optional integer vector indicating the samples (rows of inputs and outputs) that are taken into account."	""
 "Optional output polygon shapefile"	""
@@ -3173,20 +3473,30 @@ TEXT	TRANSLATION
 "Order"	"Reihenfolge"
 "Order by"	"Sortiert nach"
 "Order by..."	"Sortiert nach.."
+"Order of Polynomial Function"	""
 "Ordered Weighted Averaging (OWA)"	"Sortierter gewichteter Durchschnitt (OWA)"
+"Ordern in den alle Ausgabedaten gespeichert werden sollen"	""
 "Ordinary Kriging"	"Ordinary Kriging"
-"Ordinary Kriging (Global)"	"Ordinary Kriging (Global)"
+"Ordnerpfad der Surface Runoff- und Drainagerasterdaten des Landoberflaechenschemas"	""
+"Ordnerpfad der WUse Daten"	""
+"Ordnerpfad in dem alle zu bearbeitenden WaterGap Raster abgelegt sind"	""
 "Orientation"	"Orientierung"
 "Origin Height"	"Originalh�he"
 "Origin Latitude"	"Original Breitengrad"
 "Original"	""
 "Original Channels"	""
+"Original DEM"	""
+"Original Grid"	""
 "Original Image"	"Original Bild"
+"Original River Elevations"	""
 "Orographic Coefficient"	"Orografischer Koeffizient"
 "Orthoclinal slope"	""
+"Orthodromes"	""
 "Orthographic"	"Orthografisch"
 "Ouput"	"Ausgabe"
+"Outflow"	""
 "Outlet"	""
+"Outlet Concentration"	""
 "Outlet Hydrographs"	"Abflussganglinien"
 "Outlet X"	"Auslass X"
 "Outlet Y"	"Auslass Y"
@@ -3197,8 +3507,11 @@ TEXT	TRANSLATION
 "Output Features"	""
 "Output Field Name"	"Ausgabe Feldname"
 "Output File"	"Ausgabe Datei"
+"Output Filepath"	""
 "Output Format"	"Ausgabeformat"
 "Output Grid"	"Ausgabe Raster"
+"Output Grid Down"	""
+"Output Grid Up"	""
 "Output Lod"	"Ausgabe Erfassungsgrenze"
 "Output Seeds"	"Ausgabe Samen"
 "Output Text File"	""
@@ -3211,14 +3524,21 @@ TEXT	TRANSLATION
 "Output file path"	""
 "Output format"	"Ausgabe Format"
 "Output grid"	"Ausgabe Raster"
+"Output interval"	""
+"Output interval (time steps)"	""
 "Output of Change Vector"	""
+"Output of Grids"	""
+"Output of Level Data"	""
 "Output of Model Parameters"	""
 "Output of Regression Parameters"	"Ausgabe Regressionsparameter"
+"Output of Trend Data"	""
 "Output of module calculations."	"Ausgabe der Modulberechnungen."
+"Output of..."	""
 "Output parameters"	""
 "Output shapes with field(s) deleted"	""
 "Output table with field(s) deleted"	""
 "Output will inherit shape type and table structure from the first layer in this list."	""
+"Overall Bounding Box:"	""
 "Overdip slope"	""
 "Overland"	""
 "Overland Flow - Kinematic Wave D8"	"�berland Str�mung - Kinematische Welle D8"
@@ -3228,13 +3548,11 @@ TEXT	TRANSLATION
 "Overlap [map units]"	""
 "Overlapping Areas"	""
 "Overlapping Cells"	"�berlappende Zellen"
-"Overlay 1"	""
-"Overlay 2"	""
 "Overlay Image"	"Overlaybild"
 "Override"	"�bergehen"
 "Overview"	"�berblick"
-"P in"	""
-"P out"	""
+"Overwrite"	""
+"P"	""
 "P/A"	""
 "P/sqrt(A)"	"P/Quadratwurzel(A)"
 "PATB"	""
@@ -3249,7 +3567,8 @@ TEXT	TRANSLATION
 "PDF Files (*.pdf)|*.pdf|All Files|*.*"	"PDF Dateien (*.pdf)|*.pdf|Alle Dateien|*.*"
 "PERCENTILE"	"PERCENTILE"
 "PERIMETER"	"UMFANG"
-"PET (after Hargreave)"	""
+"PET (after Hargreaves, Grid)"	""
+"PET (after Hargreaves, Table)"	""
 "PFAC("	""
 "PH, plant height [m], representing the effective height from which raindrops fall from the crop or vegetation"	""
 "PI, permanent interception expressed as the proportion [between 0-1] of rainfall"	""
@@ -3265,6 +3584,7 @@ TEXT	TRANSLATION
 "Panchromatic Channel Matching"	""
 "Panorama"	"Panorama"
 "Panorama Break [%]"	"Panoramaunterbrechung [%]"
+"Paolo"	""
 "Paper Format"	"Papierformat"
 "Parallelepiped"	"Parallelfl�chner"
 "Parameter"	"Parameter"
@@ -3278,15 +3598,12 @@ TEXT	TRANSLATION
 "Parameter (p)"	"Parameter (p)"
 "Parameter (p) [lower bound]"	"Parameter (p) [untere Grenze]"
 "Parameter (p) [upper bound]"	"Parameter (p) [obere Grenze]"
-"Parameter A for Power Function Regression:\n   y = A * x ^ B"	"Parameter A f�r Power Funktion Regression:\n y = A * x ^ B"
-"Parameter B for Exponential Regression:\n   y = Nugget * e ^ (B * x)"	"Parameter B f�r Exponentielle Regression :\n y = Nugget * e ^ (B * x)"
-"Parameter B for Linear Regression:\n   y = Nugget + B * x"	"Parameter B f�r lineare Regression:\n y = Nugget + B * x"
-"Parameter B for Power Function Regression:\n   y = A * x ^ B"	"Parameter B f�r Power Function Regression:\ y = A * x ^ B"
 "Parameter settings for No-Data and all other values."	"Parametereinstellungen f�r No-Data und alle anderen Werte."
 "Parameter settings for the NoData value of the output grid (header)."	""
 "Parameters"	"Parameterliste"
 "Parameters file could not be exported."	"Parameterdatei konnte nicht exportiert werden."
 "Parameters file could not be imported."	"Parameterdatei konnte nicht geladen werden."
+"Parameterwerte HD Modell"	""
 "Parsing %s ... "	""
 "Partial D."	""
 "Partially wet (WI = 0.1 - 1)"	""
@@ -3332,6 +3649,8 @@ TEXT	TRANSLATION
 "Perpendicular Vegetation Index (Walther and Shabaani)"	""
 "Perspectivic Distance"	""
 "Peucker & Douglas"	""
+"Pfad LS-Daten"	""
+"Pfad WaterGap Raster"	""
 "Phi [degree]"	""
 "Photogrammetry"	""
 "Photogrammetry tools."	"Photogrammetrie Werkzeuge"
@@ -3362,11 +3681,13 @@ TEXT	TRANSLATION
 "Please provide a shapefile with the 'Polygons' parameter!"	""
 "Please provide a shapefile with the 'Shapes Extent' parameter!"	""
 "Please provide a valid *.scpvf file!"	""
+"Please provide a valid *.scpvf_tile_info file!"	""
 "Please provide a valid AOI!"	""
 "Please provide a valid R,G,B fields for this kind of operation!"	""
 "Please provide a valid SAGA RGB field for this kind of operation!"	""
 "Please provide a valid base name for the output files!"	""
 "Please provide a valid output directory for the output files!"	""
+"Please provide a valid output file path!"	""
 "Please provide an attribute field with z-information!"	""
 "Please provide an output file name!"	""
 "Please provide at least one column to export!"	""
@@ -3375,6 +3696,7 @@ TEXT	TRANSLATION
 "Plot Holes"	"Zeichnungsl�cher"
 "Point"	"Punkt"
 "Point Cloud"	"Punktwolken"
+"Point Cloud %s is empty after removing overlap, skipping dataset!"	""
 "Point Cloud Attribute Calculator"	"Punktwolken Attributrechner"
 "Point Cloud Cutter"	"Punktwolken Zuschneider"
 "Point Cloud Manager"	"Punktwolken Verwaltung"
@@ -3384,6 +3706,7 @@ TEXT	TRANSLATION
 "Point Cloud Viewer Settings"	"Punktwolken Einstellungen Betrachter"
 "Point Cloud from Grid Points"	"Punktwolken von Rasterpunkten"
 "Point Cloud from Shapes"	"Punktwolken von Vektoren"
+"Point Cloud from Table"	""
 "Point Cloud list"	""
 "Point Cloud to Grid"	"Punktwolken von Rastern"
 "Point Cloud to Shapes"	"Punktwolken zu Vektoren"
@@ -3402,6 +3725,7 @@ TEXT	TRANSLATION
 "Point Statistics for Polygons"	"Punkt Statistik f�r Polygone"
 "Point View Settings"	""
 "Point clouds viewer."	"Punktwolkenbetrachter."
+"Point insertion distance [map units]."	""
 "Point shapefile with source point(s)"	"Punkt Vektordatei mit Ausgangspunkten"
 "Point summary contains no points!"	"Punktzusammenfassung enth�lt keine Punkte!"
 "Point to Keep"	""
@@ -3450,6 +3774,7 @@ TEXT	TRANSLATION
 "Portable Network Graphics"	"Portable Network Grafik"
 "Portable Network Graphics (*.png)"	"Portable Network Grafik (*.png)"
 "Position"	"Position"
+"Position as Geographic Coordinates"	""
 "Positive Openness"	""
 "Positive values result in a shift in E direction."	"Positive Werte resultieren in einem Verschieben in Ost-Richtung"
 "Positive values result in a shift in N direction."	"Positive Werte resultieren in einem Verschieben in Nord-Richtung"
@@ -3462,11 +3787,10 @@ TEXT	TRANSLATION
 "PostgreSQL source connected"	""
 "PostgreSQL source disconnected"	""
 "PostgreSQL source is already connected"	""
+"Potential Evapotranspiration"	""
 "Potential Incoming Solar Radiation"	"potentiell ankommende Sonneneinstrahlung"
 "Power"	"Power"
-"Power Function - A"	"Power Funktion - A"
-"Power Function - B"	"Power Funktion - B"
-"Power Function Regression"	"Power Funktion Regression"
+"Power (Distance Weighting)"	""
 "Power on soil (p)"	"Power am Boden (p)"
 "Power on soil (p) [lower bound]"	"Power am Boden (p) [untere Grenze]"
 "Power on soil (p) [upper bound]"	"Power am Boden (p) [obere Grenze]"
@@ -3481,6 +3805,7 @@ TEXT	TRANSLATION
 "Precipitation Column"	"Niederschlag Spalte"
 "Precipitation [m / dt]"	""
 "Precipitation [mm]"	"Niederschlag [mm]"
+"Precipition Quantitiy [mm]"	""
 "Precise Datum Conversion"	""
 "Precise Tracing"	"genaue Spurverfolgung"
 "Precisions"	""
@@ -3501,6 +3826,10 @@ TEXT	TRANSLATION
 "Preprocessed DEM"	"vorverarbeitetes DGM"
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	"Vorverarbeitetes DGM. Falls dieses nicht eingestellt ist werden die �nderungen im originalen DGM-Raster gespeichert."
 "Preprocessing"	""
+"Presence Data"	""
+"Presence Prediction"	""
+"Presence Probability"	""
+"Preservation"	""
 "Preserve 1px border Yes/No"	""
 "Preserve Data Type"	"Erhalte Datentyp"
 "Preset Selection"	""
@@ -3524,19 +3853,23 @@ TEXT	TRANSLATION
 "Print Setup"	"Druckeinstellungen"
 "Print only information available in LAS header."	"Drucke nur Informationen aus der LAS Kopfzeile."
 "Priority Index"	"Vorrangiger Index"
+"Probabilities"	""
 "Probability"	""
 "Probability Estimates"	""
 "Probability Reference"	"Wahrscheinlichkeit Referenz"
-"Probability Threshold (Percent)"	"Wahrscheinlichkeitsschwellenwert (Prozent)"
+"Probability Threshold"	""
 "Process Update Frequency [milliseconds]"	"Prozess Update Frequenz [Millisekunden]"
 "Processed DEM"	""
 "Processing"	"Verarbeitung"
 "Processing AOI %d ..."	""
 "Processing AOI ..."	""
+"Processing Sinks and Flats"	""
+"Processing dataset %d"	""
 "Processing first pass..."	""
 "Processing observer %d ..."	""
 "Product"	"Produkt"
 "Production"	""
+"Production Rates [m/h]"	""
 "Profile"	"Profile"
 "Profile (lines)"	"Profile (Linien)"
 "Profile (points)"	"Profile (Punkte)"
@@ -3555,6 +3888,7 @@ TEXT	TRANSLATION
 "Proj.4"	"Proj.4"
 "Proj.4 Version is "	""
 "Proj4 Parameters"	"Proj4 Parameter"
+"Proj4 definition string error"	""
 "Project"	"Projekt"
 "Project File"	"Projektdatei"
 "Project \'%s\'"	"Projekt \'%s\'"
@@ -3578,14 +3912,19 @@ TEXT	TRANSLATION
 "Projection_GeoTRANS_Geoid_EGM96.dat,\n"	"Projektion_GeoTRANS_Geoid_EGM96.dat,\n"
 "Projections"	"Projektionen"
 "Projection|Georeferencing"	"Projektion|Georeferenzierung"
+"Propability"	""
 "Properties"	""
 "Protection Index"	"Schutz Index"
 "Provide Radial Distortion Parameters?"	""
 "Provide Time stamp of Image?"	""
 "Proximity"	"N�he"
 "Proximity Grid"	"N�he Raster"
+"Punktuelle Rasterzellenmanipulation"	""
 "Pythagoras' Tree"	"Pythagoras Baum"
+"Python"	""
+"Python with Header"	""
 "Q, estimation of mean runoff [mm]"	""
+"QM of ESP"	""
 "QUALITY"	""
 "QuadTree"	""
 "QuadTree Structure to Shapes"	"QuadTree-Struktur f�r Vektoren"
@@ -3608,7 +3947,6 @@ TEXT	TRANSLATION
 "R,G,B value range"	"R,G,B Wertebereich"
 "R2"	"Bestimmtheitsma�"
 "R:Alternatives"	"R:Alternativen"
-"R:Catchment Area"	"R:Einzugsgebietsgr��en"
 "R:Classification"	"R:Klassifizierung"
 "R:Conversion"	"R:Umwandlung"
 "R:Conversions"	"R:Umwandlungen"
@@ -3616,7 +3954,6 @@ TEXT	TRANSLATION
 "R:Dynamics"	""
 "R:Export"	"R:Export"
 "R:Fragmentation Analysis"	"R:Fragmentierungsanalyse"
-"R:GWR"	""
 "R:Grid Generation"	"R:Raster Erstellung"
 "R:Grid Values"	"Rasterwerte"
 "R:Image Sharpening"	""
@@ -3637,7 +3974,6 @@ TEXT	TRANSLATION
 "R:Tools"	"R:Werkzeuge"
 "R:Topographic Indices"	""
 "R:Vectorization"	"Vektorisierung"
-"R:Without Variogram Fit"	"R:Ohne Variogrammanpassung"
 "RAINBOW"	"REGENBOGEN"
 "RANGE"	"BEREICH"
 "RED_BLUE"	"ROT_BLAU"
@@ -3646,9 +3982,10 @@ TEXT	TRANSLATION
 "RED_GREEN_BLUE"	"ROT_GR�N_BLAU"
 "RED_GREY_BLUE"	"ROT_GRAU_BLAU"
 "RED_GREY_GREEN"	"ROT_GRAU_GR�N"
+"REMO Level Interpolation"	""
 "RESIDUAL"	""
-"RFR, Surface roughness [cm/m]"	""
 "RGB"	""
+"RGB Coded Values"	""
 "RGB Composite"	"RGB Zusammensetzung"
 "RGB Image"	""
 "RGB Overlay"	""
@@ -3656,7 +3993,6 @@ TEXT	TRANSLATION
 "RGB coded data"	"RGB kodierte Daten"
 "RGB to IHS"	""
 "RMSE"	""
-"ROI_N"	""
 "RPROP parameters"	""
 "RTL Compression"	""
 "Radial Limit"	""
@@ -3680,9 +4016,11 @@ TEXT	TRANSLATION
 "Rainfall intensity"	""
 "Random"	"Zufall"
 "Random Field"	"Zufallsfeld"
-"Random Forest (ViGrA)"	""
 "Random Forest Classification"	""
-"Random Terrain Generation"	"zuf�llige Gel�ndeerstellung"
+"Random Forest Classification (ViGrA)"	""
+"Random Forest Options"	""
+"Random Forest Presence Prediction (ViGrA)"	""
+"Random Terrain"	""
 "Range"	"Bereich"
 "Range of R,G,B values in LAS file."	"Bereich der R,G,B Werte in LAS Datei."
 "Rank"	"Rankzahl"
@@ -3692,6 +4030,8 @@ TEXT	TRANSLATION
 "Raster Resolution (Pixel Size)"	"Raster Aufl�sung (Pixelgr��e)"
 "Raster Resolution (Pixels Size)"	"Raster Aufl�sung (Pixelgr��e)"
 "Raster Resolution (Pixels X)"	"Raster Aufl�sung (Pixel X)"
+"Rasterzelle 1"	""
+"Rasterzelle 2"	""
 "Rate Constant for Litter Loss [1/a]"	"Rate Konstant f�r Abfallverlust [1/a]"
 "Ratio Evapotranspiration"	""
 "Ratio Vegetation Index"	"Verh�ltnis Vegetationsindex"
@@ -3702,6 +4042,8 @@ TEXT	TRANSLATION
 "Rc"	""
 "Real"	""
 "Real Surface Area"	""
+"Real-valued Numerical Features"	""
+"Recalculate"	""
 "Reciprocal Flattening (rf)"	"reziproke Abflachung (rf)"
 "Reclassification of distance grid to buffer zones with a width equal to the equidistance value."	"Neueinteilung von Entfernungsraster zu Pufferzonen mit einer Breite entsprechend dem �quidistanzwert."
 "Reclassified Grid"	"Neueingeteiltes Raster"
@@ -3720,7 +4062,6 @@ TEXT	TRANSLATION
 "Red Reflectance"	""
 "Reduction"	"Verringerung"
 "Reference Chip Size (Cells)"	""
-"Reference Height"	""
 "Reference Points"	"Referenzpunkte"
 "Reference Points (Origin)"	"Referenz Punkte (Original)"
 "Reference Points (Projection)"	"Referenz Punkte (Projektion)"
@@ -3729,31 +4070,44 @@ TEXT	TRANSLATION
 "Referencing"	""
 "Reflectance"	""
 "Refresh"	"aktualisieren"
+"Region of Interest"	""
+"Regolith Smoothing"	""
+"Regolith Thickness"	""
+"Regolith_cover_thickness"	""
 "Regression"	"Regression"
 "Regression Analysis"	"Regressionsanalyse"
-"Regression Analysis (Points/Grid)"	"Regression Analyse (Punkte/Raster)"
+"Regression Analysis (Points and Predictor Grid)"	""
 "Regression Details"	""
 "Regression Formula"	""
 "Regression Function"	"Regression Funktion"
+"Regression Kriging"	""
 "Regression Model"	""
 "Regression Parameters"	"Regression Parameter"
 "Regression with Residual Correction"	""
+"Regression: Coefficients"	""
+"Regression: Model"	""
+"Regression: Steps"	""
 "Regularisation"	"Regelung"
+"Regularization"	""
+"Regularization Factor"	""
 "Relation B / A"	"Beziehung B / A"
 "Relationship KE - I"	""
 "Relationship between kinetic energy (KE) and rainfall intensity (I)"	""
 "Relative Area"	"Relative Fl�che"
 "Relative Height"	"Relative H�he"
 "Relative Heights and Slope Positions"	"Relative H�hen und Neigungspositionen"
+"Relative Relief Position"	""
 "Relative Richness"	"relativer Reichtum"
 "Relative Slope Position"	""
 "Relative from cell value"	"Relativ vom Zellwert"
 "Relative heights calculation..."	"Relative H�hen Berechnung..."
+"Relative position"	""
 "Relaxation"	"Entspannung"
 "Reload"	""
 "Reload tool chain"	""
 "Remove Border Regions?"	""
 "Remove Duplicate Points"	"Entferne doppelte Punkte"
+"Remove Overlap from Virtual Point Cloud Tiles"	""
 "Remove every i-th point."	"Entferne jeden i-ten Punkt"
 "Remove regions which have contact with (are adjacent to) the image borders?"	""
 "Removed Objects"	"entfernte Objekte"
@@ -3763,6 +4117,7 @@ TEXT	TRANSLATION
 "Rename Table"	""
 "Replace Condition"	"Austauschbedingungen"
 "Replace Text"	""
+"Replace first PC with PAN"	""
 "Replace with"	"Ersetze durch"
 "Replacement"	""
 "Replacements"	""
@@ -3777,8 +4132,11 @@ TEXT	TRANSLATION
 "Rescale to 0 - 1"	"Massstabs�nderung von 0 - 1"
 "Rescale to 0 - 1.0"	"Massstabs�nderung von 0 - 1.0"
 "Resection (Terrestrial)"	""
+"Reset Regolith"	""
 "Residual Analysis (Grid)"	"R�ckstandsanalyse (Raster)"
+"Residual Corrected Regression"	""
 "Residual Correction"	""
+"Residual Interpolation"	""
 "Residual standard error"	""
 "Residuals"	"R�ckst�nde"
 "Resilent propagation (RPROP)"	""
@@ -3790,6 +4148,8 @@ TEXT	TRANSLATION
 "Result table"	"Ergebnistabelle"
 "Result: Scene cloud free"	""
 "Result: Scene with clouds"	""
+"Resultierendes Raster ueber WasserENTNAHME erstellen"	""
+"Resultierendes Raster ueber WasserNUTZUNG erstellen"	""
 "Resulting Point Cloud."	"Resultierende Punktwolke"
 "Resulting Value"	"sich ergebender Wert"
 "Results"	"Ergebnisse"
@@ -3805,14 +4165,22 @@ TEXT	TRANSLATION
 "Right [Del]"	""
 "Right [F4]"	"Rechts [F4]"
 "Rill/Interrill Erosivity"	"Rinnsal/Erosivit�t"
+"RivFlow"	""
+"RivFlow."	""
+"River Flooding (Mean Value Cellular Automat)"	""
+"River Flow Terraces"	""
+"River Flow Terraces Elevations"	""
 "River Heads"	"Flussquellen"
 "River Mouths"	"Flussm�ndungen"
+"River Pixels"	""
 "Rn, number of rain days in timespan [-]"	""
 "Road Width"	"Strassenbreite"
+"Rock Layers"	""
 "Roll Left [F4]"	""
 "Roll Right[F3]"	""
 "Rook"	"Saatkr�he"
 "Rook's case"	"Rook�s Fall"
+"Rooke"	""
 "Roots"	"Wurzeln"
 "Roots to Humus"	"Wurzeln zu Humus"
 "Rotate"	"Drehen"
@@ -3831,17 +4199,24 @@ TEXT	TRANSLATION
 "Route soil loss along channel network to outlet"	""
 "Routing"	"Routenplanung"
 "Routing Error"	"Routenplanung Fehler"
+"Row Order"	""
 "Rows"	"Reihen"
 "Run Tool"	"Werkzeug ausf�hren"
+"Run duration"	""
 "Running Average"	"gleitendes Mittel"
 "Running Script"	""
 "Runoff"	"Abfluss"
+"S Model"	""
+"S u m"	""
 "S, slope [rad]"	""
 "SAFETYFACTOR"	""
 "SAGA Colors"	"SAGA Farben"
+"SAGA GUI Tool Menus"	""
+"SAGA Grid Files (*.sgrd)|*.sgrd|All Files|*.*"	""
 "SAGA Help"	"SAGA Hilfe"
 "SAGA Parameter Files"	"SAGA Parameter-Datei"
 "SAGA Point Cloud Virtual Format (*.spcvf)"	""
+"SAGA Point Cloud Virtual Format Tile Info (*.spcvf_tile_info)"	""
 "SAGA Point Clouds"	"SAGA Punktwolken"
 "SAGA Projects"	"SAGA Projekte"
 "SAGA RGB"	""
@@ -3850,14 +4225,17 @@ TEXT	TRANSLATION
 "SAGA Tool Libraries"	"SAGA Werkzeugbibliotheken"
 "SAGA User Group Associaton (c) 2002"	""
 "SAGA User Group Associaton (c) 2002-2013"	""
+"SAGA User Group Associaton (c) 2002-2014"	""
 "SAGA User Group Associaton (c) 2008"	""
 "SAGA Wetness Index"	"SAGA Feuchtigkeits Index"
 "SAGA: Print Map"	"SAGA: Karte drucken"
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
+"SALEM"	""
 "SECTIONS"	"ABSCHNITTE"
 "SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
+"SLOPE"	""
 "SLc"	""
 "SLs"	""
 "SLz"	""
@@ -3882,6 +4260,8 @@ TEXT	TRANSLATION
 "SVM Classification"	""
 "SVM Type"	""
 "SVR Epsilon"	""
+"S_Model"	""
+"S_Z_Model"	""
 "Saddle"	""
 "Sample Variogram"	"Proben Variogramm"
 "Sample from training population with or without replacement?"	""
@@ -3892,7 +4272,7 @@ TEXT	TRANSLATION
 "Samples per Tree"	""
 "Sand"	"Sand"
 "Sandy Clay"	"sandiger Ton"
-"Sandy Clay-Loam"	"sandiger Ton-Lehm"
+"Sandy Clay Loam"	""
 "Sandy Loam"	"sandiger Lehm"
 "Sat. lateral permeability"	""
 "Satellite Height [m]"	""
@@ -3924,6 +4304,7 @@ TEXT	TRANSLATION
 "Save Project As..."	"Projekt speichern als..."
 "Save Settings"	"Einstellungen speichern"
 "Save Shapes"	"Vektoren speichern"
+"Save Statistics to File..."	""
 "Save TIN"	""
 "Save Table"	"Tabelle speichern"
 "Save Table Header"	"Tabellenkopf speichern"
@@ -3940,9 +4321,12 @@ TEXT	TRANSLATION
 "Save tiles to disk individually"	""
 "Save to Clipboard"	""
 "Save to File"	""
+"Save to File..."	""
 "Save to Path"	""
+"Save to Script File"	""
 "Scalable Vector Graphics Files (*.svg)"	"Skalierbare Vector Graphics Dateien (*.svg)"
 "Scale"	"Massstab"
+"Scale (Cells)"	""
 "Scale 1 : "	""
 "Scale Bar"	""
 "Scale Factor"	"Massstabsfaktor"
@@ -3962,7 +4346,6 @@ TEXT	TRANSLATION
 "Score"	""
 "Screen"	"Bildschirm"
 "Search Chip Size (Cells)"	""
-"Search Direction"	"Suchrichtung"
 "Search Distance"	"Suchentfernung"
 "Search Distance (Map Units)"	"Suchentfernung (Karteneinheiten)"
 "Search Distance Increment"	"Suchdistanzerh�hung"
@@ -3971,10 +4354,14 @@ TEXT	TRANSLATION
 "Search Mode"	"Suche Betriebsart"
 "Search Options"	"Suchoptionen"
 "Search Radius"	"Suche Radius"
+"Search Radius (Cells)"	""
 "Search Range"	"Suche Bereich"
 "Search Result"	""
 "Search Shape"	"Vektoren suchen"
 "Search chip size set to %d"	""
+"Search distance given as number cells."	""
+"Search for Projects"	""
+"Search for Projects..."	""
 "Search for..."	"Suche nach..."
 "Search radius of kernel in cells."	"Suchradius des Kernels in Zellen"
 "Search text not found"	"Gesuchten Text nicht gefunden"
@@ -3983,27 +4370,38 @@ TEXT	TRANSLATION
 "Secondary Name"	"untergeordneter Name"
 "Section"	"Sektion"
 "Sections"	"Sektionen"
+"Sed_thickness_a"	""
+"Sed_thickness_b"	""
 "Sediment Balance"	""
 "Sediment Balance Clay"	""
 "Sediment Balance Sand"	""
 "Sediment Balance Silt"	""
+"Sediment Influx from Upstream"	""
 "Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"	""
 "Sediment Yield Delivery Ratio"	""
+"Sediment_infux_from_upstream"	""
 "Seed Generation"	"Keimgenerationen"
 "Seed Points"	"Saatpunkte"
 "Seed Type"	""
 "Seed Value"	"Keimwert"
 "Seeded Region Growing"	""
 "Seeds"	"Keime"
+"Seeds (Mask)"	""
 "Seeds Grid"	"Keime Raster"
 "Seeds Only"	"Keime ausschlie�lich"
+"Segment Connection"	""
 "Segment ID"	"Segment ID"
 "Segmentation"	"Segmentierung"
 "Segments"	"Segmente"
 "Select * FROM test"	"W�hle * von Test"
+"Select All"	""
 "Select File"	"Datei ausw�hlen"
+"Select Format"	""
+"Select Grid from List"	""
+"Select Look-up Table for Grid Visualization"	""
 "Select Points"	"W�hle Punkte"
 "Select Precipitation Column"	"W�hle Niederschlagsspalte"
+"Select Startup Project"	""
 "Select Temperature Column"	"W�hle Temperaturspalte"
 "Select a layer to copy settings from it."	""
 "Select a mode of operation"	""
@@ -4046,12 +4444,14 @@ TEXT	TRANSLATION
 "Semiminor Axis (b)"	"kleine Halbachse (b)"
 "Semiminor axis or polar radius."	"kleine Halbachse oder Polarradius"
 "Semivariance"	"Semi-Ver�nderungen"
+"Sensitivity"	""
 "Sensor"	""
 "Separate Line/Polygon Points"	"Trenne Linien/Polygonpunkte"
 "Separate by..."	"Separiere durch...."
 "Separate points by direction"	"Trenne Punkte durch Richtung"
 "Separator"	"Trennzeichen"
 "Separator (other)"	"Trennzeichen (andere)"
+"Seperate Beruecksichtigung und Berechnung ueber Hauptgerinnerasterzellen - neben den normalen Gerinnerasterzellen."	""
 "September"	"September"
 "Sequencer"	""
 "Sequencer Positions"	""
@@ -4070,6 +4470,8 @@ TEXT	TRANSLATION
 "Settings"	"Einstellungen"
 "Shade"	"Schattierung"
 "Shade Brightness"	""
+"Shade Brightness [%]"	""
+"Shade Transparency [%]"	""
 "Shading"	"Schummerung"
 "Shading Method"	"Schattierungsmethode"
 "Shadow"	""
@@ -4109,7 +4511,7 @@ TEXT	TRANSLATION
 "Shapes|Tools"	"Vektoren|Werkzeuge"
 "Shared Polygon Edges"	""
 "Sharpen"	"Sch�rfen"
-"Sharpend Channels"	""
+"Sharpened Channels"	""
 "Sharpening"	""
 "Shear factors"	"Abscherungsfaktor"
 "Shearing"	"Abscherung"
@@ -4163,16 +4565,19 @@ TEXT	TRANSLATION
 "Side Slope"	"Hangkante"
 "Sieved Classes"	""
 "Sieving Classes"	""
+"Sigma"	""
 "Sigmoid"	""
-"Sill"	"Schwelle"
+"Significance Level"	""
+"Significance level (aka p-value) as threshold for automated predictor selection, given as percentage"	""
 "Silt"	"Schluff"
-"Silt-Loam"	"Schlufflehm"
+"Silt Loam"	""
 "Silty Clay"	"schluffiger Ton"
-"Silty Clay-Loam"	"schluffiger Ton-Lehm"
+"Silty Clay Loam"	""
 "Similarity"	"�hnlichkeiten"
 "Similarity Threshold"	""
 "Simple"	"Einfach"
 "Simple Filter"	"Einfache Filter"
+"Simple Kriging"	""
 "Simple, flow path and swath profiles."	"Einfach, Fliessweg und Bahnprofile"
 "Simplified Lines"	"vereinfachte Linien"
 "Simplify Lines"	"Linien vereinfachen"
@@ -4186,12 +4591,15 @@ TEXT	TRANSLATION
 "Simulation Time"	"Simulation Zeit"
 "Simulation Time Step [h]"	"Simulation Zeitschritte [h]"
 "Simulation Time [h]"	"Simulation Zeit [h]"
+"Simulation Time [kyr]"	""
 "Simulation|Cellular Automata"	"Simulation|Zellularautomatik"
 "Simulation|Ecology|Modelling the Human Impact on Nature"	"Simulation|�kologie|Modellierung des menschlichen Einflusses auf die Natur"
 "Simulation|Erosion"	""
 "Simulation|Fire Spreading"	"Simulation|Feuerausbreitung"
 "Simulation|Hydrology"	"Simulation|Hydrologie"
 "Simulation|Hydrology|IHACRES"	"Simulation|Hydrologie|IHACRES"
+"Simulation|Hydrology|RivFlow"	""
+"Simulation|Quantitative Modeling of Earth Surface Processes"	""
 "Single Cell"	"Einzelzelle"
 "Single Colour"	""
 "Single Flow Direction"	"Einzelne Flie�richtung"
@@ -4200,9 +4608,11 @@ TEXT	TRANSLATION
 "Single Value Decomposition (OpenCV)"	""
 "Single value"	"Einzelner Wert"
 "Sink Drainage Route Detection"	"Senke Entw�sserungsroutendetektion"
+"Sink Fill Algorithm"	""
 "Sink Removal"	"Senke Beseitigung"
 "Sink Route"	"Senke Route"
 "Sink Routes"	"Senke Routen"
+"Sinks"	""
 "Sinuosity"	"Sinusit�t"
 "Sinusoidal"	"Sinusf�rmig"
 "Size"	"Gr��e"
@@ -4216,7 +4626,9 @@ TEXT	TRANSLATION
 "Size of smoothing filter"	"Gr��e des Gl�ttungsfilters"
 "Size relates to..."	""
 "Skeleton"	"Ger�st"
+"Skewness"	""
 "Skip"	""
+"Skip Lines"	""
 "Skip Number"	"Auslassungsnummer"
 "Skip cells (step value)."	"Zellen auslassen (Schrittwert)."
 "Skip first line"	"Lasse erste Zeile aus"
@@ -4237,6 +4649,8 @@ TEXT	TRANSLATION
 "Slope Tolerance"	""
 "Slope Units"	""
 "Slope Weighting"	""
+"Slope exponent Nb for bedrock channel erosion"	""
+"Slope exponent Nf for fluvial sediment transport"	""
 "Slope gradient to left neighbour [%%]"	"Neigungsgradient zum linken Nachbarn [%%]"
 "Slope gradient to left neighbour [Degree]"	"Neigungsgradient zum linken Nachbarn [Grad]"
 "Slope grid, in radians."	""
@@ -4244,10 +4658,16 @@ TEXT	TRANSLATION
 "Slope threshold, given as degree, above which flow transport is unlimited."	""
 "Slope tolerance that defines a 'flat' surface (degrees)"	""
 "Slope, Aspect, Curvature"	""
+"Slope_failure_locations"	""
 "Slopes"	""
 "Smith"	""
 "Smooth"	"Gl�tten"
+"Smooth River Flow Terraces"	""
+"Smoothed Lines"	""
+"Smoothed River Elevations"	""
+"Smoothing"	""
 "Smoothing (ViGrA)"	""
+"Smoothing Threshold"	""
 "Snap Distance"	""
 "Snap Features"	""
 "Snap Points to Grid"	""
@@ -4259,13 +4679,20 @@ TEXT	TRANSLATION
 "Soil"	""
 "Soil Adjusted Vegetation Index"	""
 "Soil Adjustment Factor"	""
+"Soil Depth"	""
+"Soil Depth Right"	""
+"Soil Friction Coefficient"	""
 "Soil Moisture"	"Bodenfeuchte"
 "Soil Moisture Content"	"Bodenfeuchte Gehalt"
 "Soil Moisture Deficit"	"Bodenfeuchte Defizit"
 "Soil Moisture Power Eq."	"Bodenfeuchte Kraft Eq."
 "Soil Nitrogen"	"Bodenstickstoff"
+"Soil Parameter"	""
 "Soil Texture"	"Bodentextur"
 "Soil Texture Classification"	"Bodentextureinteilung"
+"Soil Texture Classification for Tables"	""
+"Soil Thickness"	""
+"Soil Things"	""
 "Soil Water"	""
 "Soil moisture (at FC)"	""
 "Soil moisture index (l)"	"Bodenfeuchteindex (l)"
@@ -4314,6 +4741,7 @@ TEXT	TRANSLATION
 "Spatial Point Pattern Analysis"	"r�umliche Punktmusteranalyse"
 "Spatial Reference"	""
 "Spatial Reference System Files (*.srs)"	"r�umliche Referenzsystem Dateien (*.srs)"
+"Spatial Reference System: %s"	""
 "Spatial and Geostatistics"	""
 "Spatial and Geostatistics|Grids"	""
 "Spatial and Geostatistics|Kriging"	""
@@ -4333,15 +4761,18 @@ TEXT	TRANSLATION
 "Spectral Angle Threshold (Degree)"	"Spektralwinkel Schwellenwert (Grad)"
 "Spectral Information Divergence"	"Spektralinformation Abweichung"
 "Speed (m/s)"	"Geschwindigkeit (m/s)"
+"Speicherordner"	""
+"Speicherpfad der dynamischen Wassernutzungsdaten"	""
 "Spherical Harmonic Synthesis"	""
-"Spherical Model"	"sph�risches Modell"
 "Spline"	""
 "Spline Interpolation"	""
 "Spline sensitivity, reduce to get smoother results, recommended: 80 < Tolerance < 200"	"Splinesensitivit�t, verkleinere f�r glattere Ergebnisse, empfohlen: 80 < Toleranz < 200"
 "Split Channels"	"Trenne Kan�le"
 "Split Features"	""
+"Split Lines at Points"	""
 "Split Lines with Lines"	""
 "Split Parts"	"Trenne Teile"
+"Split Polygon Parts"	""
 "Split RGB Composite"	""
 "Split Shapes Layer"	"Trenne Vektorebenen"
 "Split Shapes Layer Completely"	"Teile Vektorebenen komplett"
@@ -4365,20 +4796,25 @@ TEXT	TRANSLATION
 "Standard Parallel"	"Standard Parallel"
 "Standard Score"	"Standard Punkte"
 "Standard deviation"	"Standardabweichung"
+"Standard deviation of the Gaussian filter [-]."	""
 "Standard kernel 3"	"Standard Kernel 3"
 "Standardisation"	"Standardisation"
 "Standardised Grid"	"Standardisiertes Raster"
 "Standardize"	""
 "Standardized Height"	"Standarisierte H�he"
+"Start"	""
 "Start Degree"	""
 "Start Latitude"	""
 "Start Longitude"	""
-"Start Project"	"Starte Projekt"
 "Start Size"	""
+"Start Time"	""
 "Start Value"	"Startwert"
 "Start Values"	"Startwerte"
+"Start [a BP]"	""
 "Start [ka]"	""
+"Start [years BP]"	""
 "Starting flood fill..."	"Beginne Flutf�llung"
+"Startup Project"	""
 "State t"	""
 "State t + 1"	""
 "Static table"	""
@@ -4389,20 +4825,30 @@ TEXT	TRANSLATION
 "Steepened escarpment"	""
 "Steepest gradient (first version)"	"steilster Gradient (erste Version)"
 "Steepest gradient (second version)"	"steilster Gradient (zweite Version)"
+"Steepest_slope"	""
 "Stems"	"Halme"
 "Stems to Litter"	"Halme zu Abfall"
 "Step"	"Schritt"
+"Step 1: Surface Gradient"	""
 "Step 1: low-pass of stripe"	"Schritt 1: Tiefpass von Streifen"
+"Step 2: Concentration"	""
 "Step 2: low-pass between stripe and its surruondings"	"Schritt 2: Tiefpass zwischen Streifen und ihrer Umgebung"
+"Step [a]"	""
 "Step [ka]"	""
+"Step [years]"	""
 "Steps"	""
+"Steps 1+2: Surface, Gradient, Concentration"	""
 "Steps to Next"	""
 "Stepwidth"	"Schrittweite"
 "Stereo Anaglyph"	""
 "Stereo Eye Distance [Degree]"	"Stereo Augendistanz [Grad]"
 "Stereo Match (OpenCV)"	""
 "Stereographic"	"Stereographisch"
+"Stop"	""
+"Stop [a BP]"	""
+"Stop [h]"	""
 "Stop [ka]"	""
+"Stop [years BP]"	""
 "Stop at Edge"	""
 "Stop on Error"	"Halt bei Fehler"
 "Storage"	"Speicherung"
@@ -4413,6 +4859,7 @@ TEXT	TRANSLATION
 "Stratification"	""
 "Stream Order"	""
 "Stream Power Index"	"Str�mungsenergie Index"
+"Stream_channel_length_between_cells"	""
 "Streamflow (obs.) Column"	"Str�mungsenergie (obs.) Spalte"
 "Streamflow Column"	"Str�mungsenergie Spalte"
 "Streams"	""
@@ -4433,6 +4880,7 @@ TEXT	TRANSLATION
 "Subtract Volumes Below Base Level"	"Ziehe Volumen unterhalb der Basislinie ab"
 "Subtraction"	"Subtraktion"
 "Successfully trained the network and predicted the values. Here comes the output."	""
+"Successive Flow Routing"	""
 "Suction"	""
 "Sudoku"	""
 "Sum"	"Sum"
@@ -4446,12 +4894,17 @@ TEXT	TRANSLATION
 "Sunrise"	"Sonnenaufgang"
 "Suns's Height"	""
 "Sunset"	"Sonnenuntergang"
-"Supervised Classification"	"�berwachte Klassifizierung"
-"Supervised Classification for Polygons"	""
+"Supervised Classification for Grids"	""
+"Supervised Classification for Shapes"	""
+"Supervised Classification for Tables"	""
 "Support Vector Machine"	""
+"Suppress Negative Flow Accumulation Values"	""
 "Surface"	"Oberfl�che"
+"Surface Approximation Threshold"	""
 "Surface Area"	""
+"Surface Elevation"	""
 "Surface Specific Points"	"Oberfl�che spezifische Punkte"
+"Surface Water [m]"	""
 "Surface hydraulic conductivity [m/h]"	"Oberfl�che hydraulische Durchl�ssigkeit [m/h]"
 "Surface roughness"	""
 "Surface used to derive the LDD network, e.g. a DTM."	""
@@ -4459,6 +4912,7 @@ TEXT	TRANSLATION
 "Surfer Blanking Files (*.bln)|*.bln|All Files|*.*"	"Surfer Blanking Dateien (*.bln)|*.bln|Alle Dateien|*.*"
 "Surfer Grid (*.grd)|*.grd|All Files|*.*"	"Surfer Rasterdateien (*.grd)|*.grd|Alle Dateien|*.*"
 "Surfer's No Data Value"	"Surfer NoData-Werte"
+"Surrounding Air Temperature [�C]"	""
 "Swath Profile"	"Schneisenprofile"
 "Swath Width"	"Schneisenbreite"
 "Swath width measured in map units."	"Schneisenbreite gemessen in Karteneinheiten."
@@ -4473,10 +4927,15 @@ TEXT	TRANSLATION
 "Synchronize Map Extents"	""
 "Syntax error at position #%d: \n%s\n"	"Syntaxfehler an Position #%: \n%s\n"
 "Synthesized Grid"	""
-"System"	"System"
+"T"	""
 "T Curvature"	"T Kurvatur"
+"T Height Correction"	""
+"T Offset"	""
 "T Slope"	"T Neigung"
 "T Vertical Distance to Channel Network"	"T Vertikale Entfernung zum Gew�ssernetz"
+"T [ka BP]"	""
+"T max"	""
+"T min"	""
 "T, mean temperature [degree C]"	""
 "TCI Low"	""
 "TCc"	""
@@ -4503,7 +4962,6 @@ TEXT	TRANSLATION
 "TOPMODEL"	"TOPMODEL"
 "TOPMODEL - Simulation Output"	"TOPMODEL - Simulation Ausgabe"
 "TOPOGRAPHY"	""
-"TOT_N"	""
 "TPI Based Landform Classification"	""
 "TYPE"	"Typ"
 "T_MELT("	"T_Schmelz("
@@ -4536,12 +4994,12 @@ TEXT	TRANSLATION
 "Target"	"Ziel"
 "Target Area"	"Zielbereich"
 "Target Areas"	"Zielbereiche"
+"Target Cell Size"	""
 "Target Cellsize"	"Ziel Zellgr��e"
 "Target Coordinate System Error"	"Ziel Koordinatensystemfehler"
 "Target Coordinate System Type Error"	"Ziel Koordinatensystemtypfehler"
 "Target Datum"	"Ziel Datum"
 "Target Datum Error"	"Ziel Datumsfehler"
-"Target Dimensions"	"Ziel Dimensionen"
 "Target Grid"	"Ziel Raster"
 "Target Grid System"	""
 "Target Grid Type"	"Ziel Rastertyp"
@@ -4555,6 +5013,7 @@ TEXT	TRANSLATION
 "Target X coordinate"	""
 "Target Y coordinate"	""
 "Tasseled Cap Transformation"	""
+"Temperatur offset"	""
 "Temperature"	""
 "Temperature (2pm) [DegreeC]"	"Temperatur (14.00 Uhr) [GradCelsius]"
 "Temperature Column"	"Temperatur Spalte"
@@ -4570,8 +5029,12 @@ TEXT	TRANSLATION
 "Temperature Threshold for Rainfall (lower bound)"	"Temperatur Schwellenwert f�r Regenf�lle (untere Grenze)"
 "Temperature Threshold for Rainfall (upper bound)"	"Temperatur Schwellenwert f�r Regenf�lle (obere Grenze)"
 "Temperature at Reference Station [Deg.Celsius]"	"Temperatur an Referenzstation [Grad.Celsius]"
+"Temperature from Pressure Levels to Surface"	""
+"Template"	""
 "Template Menu|Template Sub Menu"	"Vorlagenmenu|Vorlagen Untermen�"
+"Template."	""
 "Templates"	""
+"Template|Template"	""
 "Temporary files"	"tempor�re Dateien"
 "Tension Threshold"	"Spannungsschwellenwert"
 "Tension Threshold [Percentage of Cell Size]"	""
@@ -4590,11 +5053,14 @@ TEXT	TRANSLATION
 "Terrain Map View"	""
 "Terrain Path Cross Sections"	"Relief Pfad Querprofile"
 "Terrain Ruggedness Index (TRI)"	"Relief Rauheitsindex (TRI)"
-"Terrain Surface Classification"	""
+"Terrain Surface Classification (Iwahashi and Pike)"	""
 "Terrain Surface Convexity"	""
 "Terrain Surface Texture"	""
 "Terrain View Factor"	"Relief Sichtfaktor"
 "Terrain parameters"	""
+"Test- und Monitoring-Routinen"	""
+"TestRoutine 1"	""
+"Testroutine1 durchfuehren... "	""
 "Text"	"Text"
 "Text File"	"Textdatei"
 "Text Files"	"Textdateien"
@@ -4602,7 +5068,10 @@ TEXT	TRANSLATION
 "Text Replacements"	""
 "Text Table (*.txt)"	"Text Tabelle (*.txt)"
 "Text files (*.txt)"	"Textdateien (*.txt)"
+"Textdatei (*.txt)|*.txt|All Files|*.*"	""
+"Textdatei|*.txt|All Files|*.*"	""
 "Texture"	"Textur"
+"The (numeric) fields to calculate the statistics for."	""
 "The GDAL dataset to be created."	""
 "The GDAL datatype of the created dataset."	""
 "The GDAL raster format (driver) to be used."	""
@@ -4612,10 +5081,17 @@ TEXT	TRANSLATION
 "The SAGA grids to be exported."	""
 "The angle between the surface and the incoming light beams, measured in radians."	"Der Winkel zwischen der Oberfl�che und ankommenden Lichtstrahlen, gemessen in radiant."
 "The areas used to train the neural network."	""
+"The attribute field to grid. Field numbers start with 1, so elevation is attribute field 3."	""
+"The attribute field to use as constraint. Field numbers start with 1."	""
+"The attribute field with the x-coordinate."	""
+"The attribute field with the y-coordinate."	""
+"The attribute field with the z-coordinate."	""
 "The attribute fields to cluster"	""
+"The attribute fields to convert, optional."	""
 "The attribute with the class IDs, used to link the table and the grid."	""
 "The base name of the tiles"	""
 "The buffer distance must be greater than or equal to the cell size!"	""
+"The calculated statistics."	""
 "The calculated terrain slope [radians]."	""
 "The class field used to classify the shape. All classes will be vectorized."	""
 "The clipped grid."	""
@@ -4623,6 +5099,7 @@ TEXT	TRANSLATION
 "The column holding the Y-coordinate."	"Die Spalte, die die Y-Koordinate enth�lt."
 "The column holding the Z-coordinate."	"Die Spalte, die die Z-Koordinate enth�lt."
 "The converted shapefile."	""
+"The cutted output point cloud dataset(s)."	""
 "The datatype to use for each field, separated by semicolon, e.g. \"2;2;3;\". The number equals the choice selection, see GUI version."	""
 "The decimal precision to use for each field, separated by semicolon, e.g. \"2;2;2;0\""	""
 "The delay after the start of rainfall, before the discharge starts to rise."	"Die Verz�gerung zwischen dem Beginn des Regenfalls, bevor der Abfluss zu steigen beginnt."
@@ -4638,21 +5115,30 @@ TEXT	TRANSLATION
 "The first grid to correlate"	""
 "The flow depth used to calculate the actual flow velocity [m] (e.g. 0.005 unchannelled flow, 0.01 shallow rills, 0.25 deeper rills."	""
 "The full path and name of the .spcvf file"	""
+"The full path and name of the spcvf tile info file describing the point cloud tiles without overlap"	""
 "The full path to which the output(s) should be written. Leave empty to output the datasets as grid list."	""
 "The full path to which the output(s) should be written. Leave empty to output the datasets as point cloud list."	""
+"The full path to which the point cloud tiles without overlap should be written."	""
 "The generated contour lines."	""
 "The grid coded with the class IDs."	""
 "The grid to clip."	""
 "The grid to filter."	"zu filterndes Raster."
 "The grid to modify."	""
 "The grids geo-reference must be related either to the center or the corner of its lower left grid cell."	"Die Georeferenz des Rasters muss entweder mit dem Zentrum oder der Ecke ihrer unteren linken Rasterzelle verbunden sein."
+"The improved SIA model requires more than one smoothing iteration!"	""
+"The input line shapefile to smooth."	""
 "The input point cloud files to use"	""
 "The input table"	""
+"The input table."	""
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	"Die invertierte Auswahl ist nicht f�r die Eingabe von Vektordateien mit mehr als einem Polygon geeignet!"
+"The length of the Gaussian window is too small, please provide a larger sigma."	""
 "The merged point cloud."	""
 "The method used to identify surface specific points."	"Die Methode die zum Identifizieren spezifischer Oberfl�chenpunkte benutzt wird."
 "The name to use for each field, separated by semicolon, e.g. \"intensity;class;range\""	""
 "The number of days to model."	""
+"The number of smoothing iterations [-]."	""
+"The number of supplied grids exceeds the number of variables in formula."	""
+"The number of supplied grids is less than the number of variables in formula."	""
 "The numbers (starting from 1) of the fields to drop, separated by semicolon, e.g. \"5;8;9\""	""
 "The numbers (starting from 1) of the fields to export, separated by semicolon, e.g. \"1;2;3;5\""	""
 "The numbers (starting from 1) of the fields to import, separated by semicolon, e.g. \"5;6;8\""	""
@@ -4660,8 +5146,11 @@ TEXT	TRANSLATION
 "The output grids, one grid for each table column."	""
 "The output point cloud"	""
 "The output point cloud(s)"	""
+"The output point cloud."	""
 "The output table"	""
+"The parameter controls the position of relative height maxima as a function of slope."	""
 "The point cloud to export."	"Die zu exportierende Punktwolke."
+"The radius in map units"	""
 "The resulting grid gives the altitude above the channel network in the same units as the elevation data."	"Das resultierende Raster gibt die H�he �ber dem Gew�ssernetz in den gleichen Einheiten wie die H�hendaten aus."
 "The resulting table inherits its field structure from the first table in this list."	""
 "The second DTM used to assign height information to grid 2"	""
@@ -4669,9 +5158,12 @@ TEXT	TRANSLATION
 "The shaded DTM."	""
 "The shapefile to convert."	""
 "The shapefile to use for clipping."	""
+"The smoothed output line shapefile."	""
+"The smoothing preservation factor [-]."	""
 "The table with the (numeric) data values for each class. The module creates a grid for each table column (besides the ID)."	""
 "The terrain exaggeration factor allows to increase the shading contrasts in flat areas."	"Der Relief�berh�hungsfaktor erlaubt das Anheben der Schattenkontraste in flachen Fl�chen."
 "The transmittance of the atmosphere, usually between 60 and 80 percent."	"Der Durchl�ssigkeitswert der Atmosph�re, gew�hnlich zwischen 60 und 80 Prozent."
+"The transparency of the shade [%]"	""
 "The unobstructed hemisphere given as percentage."	"Die unversperrte Hemisph�re beschrieben in Prozent."
 "The value to apply."	""
 "The values in the specified radius is used in the average calculation only if its difference with the central value is lesser or equal to this threshold."	"Die Werte in dem spezifizierten Radius werden f�r die Berechnung des Durchschnitts nur benutzt wenn ihre Differenz zu dem zentralen Wert kleiner oder gleich des Schwellenwertes sind."
@@ -4688,12 +5180,13 @@ TEXT	TRANSLATION
 "These are the probabilities for the winner classes given by the neural network."	""
 "These are the winner class vectors."	""
 "Thiam's Transformed Vegetation Index"	"Thiams umgewandelter Vegetationsindex"
+"Thickness_of_uppermost_rock_layer"	""
 "Thiessen Polygons"	""
-"Thin Plate Spline (Global)"	"Thin Plate Spline (Global)"
-"Thin Plate Spline (Local)"	"Thin Plate Spline (Lokal)"
+"Thin Plate Spline"	""
 "Thin Plate Spline (TIN)"	"Thin Plate Spline (TIN)"
 "Thin Plate Spline: solving matrix"	"Thin Plate Spline: L�sungsmatrix"
 "Thinned Points"	"Ausged�nnte Punkte"
+"This Color"	""
 "This Is Not A Caption!"	""
 "This grid indicates the cells you want calculate the average."	"Dieses Raster zeigt die Zellen an mit denen der Durchschnitt berechnet wird."
 "This grid is used to select cells."	"Dieses Raster wird benutzt um Zellen auszuw�hlen."
@@ -4716,6 +5209,7 @@ TEXT	TRANSLATION
 "This will contain your output data of type grid."	"Dieses wird Deine Ausgabedaten vom Typ Rasterdaten enthalten."
 "This will contain your output data of type shapes."	"Dieses wird Deine Ausgabedaten vom Typ Vektordaten enthalten."
 "Thomas Schorr (c) 2007"	""
+"Thread"	""
 "Threshold"	"Schwellenwert"
 "Threshold (Grid Units)"	"Schwellenwert (Rastereinheiten)"
 "Threshold (Init.)"	"Schwellenwert (Init.)"
@@ -4724,7 +5218,9 @@ TEXT	TRANSLATION
 "Threshold Error"	"Schwellenwertfehler"
 "Threshold Grid"	"Schwellenwert Raster"
 "Threshold Height"	"Schwellenwert H�he"
+"Threshold Infected"	""
 "Threshold Linear Flow"	""
+"Threshold Sickness"	""
 "Threshold Type"	"Schwellenwert Typ"
 "Threshold [Percent]"	"Schwellenwert [Prozent]"
 "Threshold for Elevation Percentile (Lowness)"	"Schwellenwert f�r Erh�hung Perzentile (Niedrigkeit)"
@@ -4734,6 +5230,7 @@ TEXT	TRANSLATION
 "Threshold for different route"	"Schwellenwert f�r unterschiedliche Routen"
 "Threshold for linear flow, if exceeded D8 is used."	""
 "Threshold for plane"	"Schwellenwert f�r Ebene"
+"Threshold for sediment motion"	""
 "Thresholded Linear Flow"	""
 "Thresholds"	"Schwellenwert"
 "Thumbnail Size"	"Miniaturbildgr��e"
@@ -4742,6 +5239,7 @@ TEXT	TRANSLATION
 "Tiempo de inicio (min)"	""
 "Tiempo de simulacion (min)"	""
 "Tile Horizontally"	""
+"Tile Info File"	""
 "Tile Size (X)"	"Kachelgr��e (X)"
 "Tile Size (Y)"	"Kachelgr��e (Y)"
 "Tile Size Definition"	"Kachelgr��e Definition"
@@ -4758,7 +5256,7 @@ TEXT	TRANSLATION
 "Time Difference between Image & Points"	""
 "Time Field"	""
 "Time Interval [a]"	"Zeitintervall [a]"
-"Time Out (h)"	"Unterbrechung (h)"
+"Time Out [min]"	""
 "Time Out(h)"	"Unterbrechung (h)"
 "Time Period"	"Zeit Periode"
 "Time Range"	"Zeit Bereich"
@@ -4769,20 +5267,30 @@ TEXT	TRANSLATION
 "Time Span [a]"	"Zeitspanne [a]"
 "Time Span [h]"	"Zeitspanne [h]"
 "Time Stamp without date"	"Zeitstempel ohne Datum"
+"Time Step"	""
 "Time Step [h]"	"Zeitschritt [h]"
+"Time Step [kyr]"	""
 "Time [a]"	"Zeit [a]"
 "Time interval is to large for a stable solution."	"Das Zeitintervall ist zu gro� f�r eine sichere L�sung."
+"Time of Concentration [min]"	""
+"Time of Concentration [min] used to estimate flow speed."	""
 "Time span used for the calculation of daily radiation sums."	"Zeitspanne die f�r die Berechnung der t�glichen Strahlungssummen benutzt wird."
 "Time stamp of Image"	""
+"Time step exceeds duration"	""
+"Time step size (yrs)"	""
 "Time step size for a day's calculation given in hours."	"Zeitschrittgr��e f�r eine Tagesberechnung gegeben in Stunden."
 "Time step size for a range of days calculation given in days."	"Zeitschrittgr��e f�r eine Berechnung eines Bereichs von Tagen gegeben in Tagen."
+"Times"	""
 "Timespan (days)"	""
 "Tip of the Day..."	"Tip des Tages.."
 "Tissot's Indicatrix"	""
+"To"	""
 "Tolerance"	"Toleranz"
 "Tolerance (Degree)"	"Toleranz (Grad)"
 "Tolerance [Degree]"	"Toleranz [Grad]"
 "Tool"	"Werkzeug"
+"Tool Chain"	""
+"Tool Chain with Header"	""
 "Tool Chains"	""
 "Tool Description Source"	"Quelle f�r Werkzeugbeschreibung"
 "Tool Execution"	"Werkzeugausf�hrung"
@@ -4792,12 +5300,15 @@ TEXT	TRANSLATION
 "Tool Set"	""
 "Tool execution failed"	"Werkzeugausf�hrung schlug fehl"
 "Tool execution succeeded"	"Werkzeugausf�hrung war erfolgreich"
+"Toolbox Naming"	""
 "Tools"	"Werkzeuge"
 "Tools for (grid based) digital terrain analysis."	"Werkzeuge f�r (rasterbasierte) digitale Reliefanalysen."
 "Tools for GPS data handling."	""
+"Tools for Soil."	""
 "Tools for Triangulated Irregular Network (TIN) processing."	"Werkzeuge f�r die Berechnung dreieckiger irregul�rer Netzwerke (TIN). "
 "Tools for digital terrain analysis."	"Werkzeuge f�r digitale Reliefanalyse."
 "Tools for lines."	"Werkzeuge f�r Linien"
+"Tools for managing weather and climate data."	""
 "Tools for point clouds."	"Werkzeuge f�r Punktwolken"
 "Tools for polygons."	"Werkzeuge f�r Polygone"
 "Tools for regression analyses."	"Werkzeuge f�r die Regressionsanalyse"
@@ -4830,6 +5341,7 @@ TEXT	TRANSLATION
 "Topography"	""
 "Topograpic Wetness Index Calculation"	""
 "Total"	"Gesamt"
+"Total Catchment Area"	""
 "Total Catchment Area (TCA)"	"Gesamteinzugsbereich (TCA)"
 "Total Catchment Area [km2]"	"Gesamteinzugsbereich [km�]"
 "Total Curvature"	""
@@ -4841,6 +5353,10 @@ TEXT	TRANSLATION
 "Total flow [m/dt]"	"Gesamtstr�mung [m/dt]"
 "Total insolation, the sum of direct and diffuse incoming solar radiation."	"Gesamt Sonneneinstrahlung, die Summe direkt und diffus ankommender Solarstrahlung."
 "Total memory size"	"Gesamte Speichergr��e"
+"Total number of points: %s"	""
+"Total number of referenced datasets: %d"	""
+"Tracer"	""
+"Tracer Lines"	""
 "Tracing: Convergence"	"�berwachung: �bereinstimmung (Konvergenz)"
 "Tracing: Max. Divergence"	"�berwachung: max. Abweichung (Divergenz)"
 "Tracing: Stop after x cells with divergent flow"	"�berwachung: Anhalten nach x Zellen mit abweichender Flie�richtung"
@@ -4848,6 +5364,7 @@ TEXT	TRANSLATION
 "Track"	""
 "Train INPUT"	""
 "Training Areas"	"Trainingsgebiete"
+"Training Classes"	""
 "Training Options"	""
 "Training method"	""
 "Transactions"	"Transaktionen"
@@ -4862,6 +5379,7 @@ TEXT	TRANSLATION
 "Transformed Soil Adjusted Vegetation Index (Baret et al. 1989)"	""
 "Transformed Vegetation Index"	"Umgewandelter Vegetationsindex"
 "Transitional"	"vor�bergehend"
+"Translatable Elements"	""
 "Translation"	"Verschiebung"
 "Translation X"	"Verschiebung X"
 "Translation Y"	"Verschiebung Y"
@@ -4871,12 +5389,15 @@ TEXT	TRANSLATION
 "Transmissivity"	"Transmissivit�t"
 "Transparency [%]"	"Transparenz [%]"
 "Transparent"	""
+"Transport"	""
 "Transport Capacity Clay"	""
 "Transport Capacity Sand"	""
 "Transport Capacity Silt"	""
 "Transport Condition Clay"	""
 "Transport Condition Sand"	""
 "Transport Condition Silt"	""
+"Transport Function"	""
+"Transportation Depth"	""
 "Transpose Grids"	""
 "Transpose Table"	""
 "Transposed Grids"	""
@@ -4906,6 +5427,7 @@ TEXT	TRANSLATION
 "Type of Slope"	""
 "Type of distance calculation"	"Typ der Entfernungsberechnung"
 "Type of smoothing"	"Typ der Gl�ttung"
+"Type=\"%s\""	""
 "U-shaped Valleys"	""
 "UNRECOGNISED COMMAND ID"	""
 "USGS SRTM Grids (*.hgt)|*.hgt|All Files|*.*"	"USGS SRTM Raster (*.hgt)|*.hgt|Alle Dateien|*.*"
@@ -4921,22 +5443,24 @@ TEXT	TRANSLATION
 "Unable to open output file %s!"	""
 "Unable to read points from LAS file!"	"Kann keine Punkte von LAS Datei lesen!"
 "Unable to save %s file!"	""
+"Unable to save file %s!"	""
 "Unclassified"	"Unklassifiziert"
 "Uncond. stable"	""
 "Uncond. unstable"	""
 "Undefined"	"Undefiniert"
 "Undefined Coordinate System"	"undefiniertes Koordinatensystem"
+"Undefined or binary attribute field types are not supported!"	""
 "Underdip slope"	""
 "Undetermined"	"unbestimmt"
 "Uniform"	"einheitlich"
 "Union"	"Verbindung"
 "Unique"	"eindeutig"
+"Unique Production Rate [m/h]"	""
 "Unit"	"Einheit"
 "Unit Name"	"Einheitenname"
 "Units"	"Einheiten"
 "Units for output radiation values."	"Einheiten f�r die Ausgabe der Strahlungswerte."
 "Universal Kriging"	"Universal Kriging"
-"Universal Kriging (Global)"	"Universal Kriging (Global)"
 "Universal Transvers Mercator (UTM)"	"Universal Transversal Merkator (UTM)"
 "Unknown"	"Unbekannt"
 "Unknown Error"	"Unbekannter Fehler"
@@ -4949,10 +5473,10 @@ TEXT	TRANSLATION
 "Up"	""
 "Up [-]"	""
 "Up [Home]"	""
-"Up-Scaling"	"Heraufskalieren"
 "Up/Down"	"Auf/Ab"
 "Update"	"Aktualisiere"
 "Update Data"	""
+"Update Frequency"	""
 "Update Raster SRID"	""
 "Update Shapes SRID"	""
 "Update View"	"Aktualisiere Ansicht"
@@ -4965,14 +5489,24 @@ TEXT	TRANSLATION
 "Upland Drainages"	""
 "Upland Drainages, Headwaters"	""
 "Upper"	""
+"Upper Half"	""
 "Upper Slopes"	""
 "Upper Slopes, Mesas"	""
 "Upper Tolerance"	"Obere Toleranz"
+"Uppermost Rock Type"	""
+"Uppermost Rock Type Thickness"	""
+"Upscaling Method"	""
 "Upslope Area"	"Ansteigende Fl�che"
 "Upslope Basins"	"ansteigende Becken"
+"Upslope Curv UnNormalized"	""
+"Upslope Curvature"	""
+"Upslope Curvature Normalized"	""
+"Upslope Curvatures"	""
 "Upslope Flow Width"	""
 "Upslope Length Factor"	""
 "Upslope Slope"	""
+"Upslope Weighting"	""
+"Upslope and Downslope Curvature"	""
 "Urban"	""
 "Use 5 percent confidence interval"	"Nutze 5 Prozent Vertrauensintervall"
 "Use Confidence Interval"	"Nutze Vertrauensintervall"
@@ -4985,7 +5519,7 @@ TEXT	TRANSLATION
 "Use Target Area Polygon"	"Benutze Zielfl�chenpolygon"
 "Use Z-Range"	"Benutze Z-Bereich"
 "Use a user-specified elevation range instead of min/max of the input dataset"	""
-"Use old style namings (e.g. 'modules' instead of 'tools'). Ignored if translation file is used. You need to restart SAGA to apply changes."	""
+"Use old style namings (e.g. 'modules' instead of 'tools'). Ignored if translation file is used. You need to restart SAGA to apply the changes."	""
 "Use only features selected by the minimum Redundancy Maximum Relevance (mRMR) algorithm"	""
 "Use only seed cells as starting points."	"Benutze nur Keimzellen als Startpunkte."
 "Use sky view factor based on local slope (after Oke 1988), if no sky viev factor grid is given."	"Benutze Himmelsblickfaktor basierend auf lokaler neigung (nach Oke 1988), wenn kein Himmelsblickraster gegeben ist. "
@@ -5006,14 +5540,14 @@ TEXT	TRANSLATION
 "User Defined Polynomial"	"Benutzerdefiniertes Polynomial"
 "User Defined Size"	"Benutzdefinierte Gr��e"
 "User Name"	"Benutzername"
-"User defined"	"Benutzerdefiniert"
 "User defined NoData value for output grid."	""
 "User defined Orientation"	"Benutzerdefinierte Orientierung"
 "User defined Zero Direction"	"Benutzerdefinierte Nullrichtung"
-"User defined grid"	"Benutzerdefinertes Raster"
 "User defined range"	"Benutzerdefinierter Bereich"
 "User defined rank"	"Benutzerdefinierte Reihe"
 "User defined rescale"	"Benutzerdefinierte Massstabs�nderung"
+"User defined tool menus"	""
+"User defined tool menus."	""
 "User specified elevation range"	""
 "Username"	"Benutzername"
 "Using temperature data?"	"Nutzung der Temperaturdaten?"
@@ -5021,9 +5555,11 @@ TEXT	TRANSLATION
 "V / GR"	""
 "V / V"	""
 "V / X"	""
+"V. Olaya, V. Wichmann (c) 2004-2015"	""
 "V. Wichmann (c) 2013"	""
 "V. Wichmann, M. Setiawan (c) 2009-2012"	""
 "V.Olaya (c) 2004, O.Conrad (c) 2011"	""
+"V.Olaya (c) 2004, V.Wichmann (c) 2015"	""
 "VALUE"	"WERT"
 "VAR"	""
 "VARIANCE"	"VARIANZ"
@@ -5061,6 +5597,7 @@ TEXT	TRANSLATION
 "Van der Grinten"	"Van der Grinten"
 "Var.cum."	""
 "Variable"	""
+"Variables to Import"	""
 "Variance"	"Streuung"
 "Variance (version 1)"	"Varianz (Version 1)"
 "Variance (version 2)"	"Varianz (Version 2)"
@@ -5068,7 +5605,7 @@ TEXT	TRANSLATION
 "Variance in Feature Space"	"Varianz im Merkmal Raum"
 "Variance in Position Space"	"Varianz in Position Raum"
 "Variogram"	"Variogramm"
-"Variogram (Dialog))"	"Variogramm (Dialog))"
+"Variogram (Dialog)"	""
 "Variogram Cloud"	"Variogramm Wolke"
 "Variogram Model"	"Variogramm Modell"
 "Variogram Settings"	"Einstellungen Variogramm"
@@ -5086,6 +5623,8 @@ TEXT	TRANSLATION
 "Vegetation parameters"	"Parameter Vegetation"
 "Velocidad del viento"	""
 "Velocidad del viento (km/h)"	""
+"Velocity"	""
+"Velocity Calculation"	""
 "Verbose"	""
 "Verbose Messages"	""
 "Verbose Output"	""
@@ -5103,10 +5642,13 @@ TEXT	TRANSLATION
 "Vertical Overland Flow Distance"	"Vertikale �berlandflie�entfernung"
 "Vertical Range"	"Vertikaler Bereich"
 "Vertical Scaling"	""
+"Vertical Tracer Density"	""
 "Vertical hatch"	"vertikale Schraffur"
 "Vertical scaling factor"	""
 "Vertically mirrored"	"vertikal gespiegelt"
 "Vertices"	""
+"Vertikale Zufluesse"	""
+"Verwitterungsformeln"	""
 "ViGrA"	""
 "Victor Olaya (c) 2004"	""
 "Victor Olaya (c) 2005"	""
@@ -5136,6 +5678,9 @@ TEXT	TRANSLATION
 "WARNING: %d invalid points skipped!"	"WARNUNG: %te ung�ltige Punkte unterdr�ckt!"
 "WARNING: Skipping misformatted line: %d!"	""
 "WARNING: selected attribute is not numeric; generating unique identifiers instead."	"Warnung: das ausgew�hlte Attribut ist nicht numerisch; erzeuge stattdessen eindeutige Identifizierer."
+"WARNING: skipping non-numeric field '%s'!"	""
+"WARNING: smoothing sensitivity is greater than the number of iterations!"	""
+"WARNING: unable to smooth line because Gaussian window too large (number of line vertices too small or sigma too big)."	""
 "WASP Map Files (*.map)"	"WASP Map Datei (*.map)"
 "WEDGEFAIL"	""
 "WETNESS"	""
@@ -5144,10 +5689,16 @@ TEXT	TRANSLATION
 "WHITE_RED"	"WEISS_ROT"
 "WKT Files (*.wkt)"	"WKT Dateien (*.wkt)"
 "WKT Import"	""
+"WKT: %s"	""
 "WMS Import"	"WMS Import"
 "WMS Map"	"WMS Karte"
+"WRF Extract Data"	""
+"WRF Extract and Downscale to DEM"	""
+"WUse Einheit"	""
 "W_up"	""
 "Wa-Tor"	""
+"Waehlen ob TestRoutine 1 durchgefuehrt werden soll... 1) nur fuer Teileinzugsgebiet der HG-Rasterzelle oder 2) fuer das Flusseinzugsgebiet bis zum Erreichen der HG-Rasterzelle."	""
+"Wang/Liu"	""
 "Warm Cloud"	""
 "Warning"	""
 "Warning: there are more predictor variables then dependent ones, surplus will be ignored."	""
@@ -5155,14 +5706,21 @@ TEXT	TRANSLATION
 "Water"	"Wasser"
 "Water Content [cm]"	"Wassergehalt [cm]"
 "Water Retention Capacity"	"Wasserretentionskapazit�t"
+"Water Surface Exaggeration"	""
 "Water Vapour Pressure [mbar]"	"Wasserdampfdruck [mbar]"
 "Water content change across the wetting front"	"Wassergehalts�nderung �ber die Befeuchtungsfront"
 "Water content of a vertical slice of atmosphere in cm: 1.5 to 1.7, average=1.68"	"Wassergehalt einer vertikalen Scheibe Atmosph�re in cm: 1,5 bis 1,7, Durchschnitt=1,68"
+"Water_discharge"	""
 "Watershed Basins"	"Wassereinzugsgebiete"
 "Watershed Basins (Extended)"	"Wassereinzugsgebiete (erweitert)"
 "Watershed Segmentation"	"Wassereinzugsgebietteile"
 "Watershed Segmentation (ViGrA)"	""
 "Weather Records"	"Wetterdaten"
+"Weathering"	""
+"Weathering Formulas"	""
+"Weathering Variables"	""
+"Weathering rate decay constant (1/m)"	""
+"Weathering threshold area"	""
 "Web Service Data Access"	""
 "Weight"	"Gewichtung"
 "Weight for grid "	"Gewichtung f�r Raster"
@@ -5174,6 +5732,7 @@ TEXT	TRANSLATION
 "Weights"	"Massen"
 "Well Known Text File"	"Well Known Text Datei"
 "Well Known Text Format (*.wkt)"	""
+"Well Known Text file error"	""
 "West"	"West"
 "West []"	"West[]"
 "West-East"	"West/Ost"
@@ -5207,7 +5766,12 @@ TEXT	TRANSLATION
 "Winterweizen"	"Winterweizen"
 "Wire Frame Color"	"Drahtrahmenfarbe"
 "Wischmeier & Smith 1978"	""
+"Wombling (Edge Detection)"	""
+"Wombling Direction"	""
+"Wombling Magnitude"	""
 "Wood Fuel Moisture"	"Holzfeuchte"
+"World File"	""
+"World File from Flight and Camera Settings"	""
 "Write Field Names"	"Schreibe Feldnamen"
 "Write Header"	"Schreibe Kopf"
 "Write all calculated Time Series in a table?"	"Schreibe alle berechneten Zeitserien in eine Tabelle?"
@@ -5238,6 +5802,8 @@ TEXT	TRANSLATION
 "X11 Pixel Map"	"X11 Pixelkarte"
 "XML Files"	""
 "XML Files (*.xml)"	""
+"XMax: %.6f"	""
+"XMin: %.6f"	""
 "XYZ Files (*.xyz)"	"XYZ Dateien (*.xyz)"
 "XYZ files (*.xyz)"	"XYZ Dateien (*.xyz)"
 "Y"	""
@@ -5264,8 +5830,13 @@ TEXT	TRANSLATION
 "YELLOW_BLUE"	"GELB_BLAU"
 "YELLOW_GREEN"	"GELB_GR�N"
 "YELLOW_RED"	"GELB_ROT"
+"YMax: %.6f"	""
+"YMin: %.6f"	""
 "Year"	"Jahr"
+"Year [ka BP]"	""
 "Year [ka]"	"Jahr [ka]"
+"Years BP"	""
+"Yoshimasa Tsuruoka"	""
 "You can specify the number of layers in the network (including input and output layer)."	""
 "You can specify the number of neurons in each layer of the network."	""
 "You canceled printing"	"Druck abgebrochen"
@@ -5276,23 +5847,32 @@ TEXT	TRANSLATION
 "Z"	"Z"
 "Z Attribute"	"Z Attribute"
 "Z Axis"	"Z-Achse"
+"Z Model"	""
 "Z Multiplier"	""
 "Z Value"	"Z Wert"
 "Z Values"	"Z Werte"
 "Z is Column ..."	"Z ist Spalte..."
+"Z+S Model"	""
 "Z-Offset"	""
 "Z-Range"	"Z-Bereich"
 "Z-Rotation"	"Z-Rotation"
 "Z-Scale"	""
+"ZMax"	""
+"ZMax: %.6f"	""
+"ZMin"	""
+"ZMin: %.6f"	""
 "ZONE"	"ZONE"
+"Z_Model"	""
 "Zenith"	""
 "Zero"	"Null"
 "Zevenbergen & Thorne"	""
 "Zevenbergen & Thorne (1987) refer to this as plan curvature"	""
 "Zevenbergen & Thorne (1987) refer to this as profile curvature"	""
+"Zonal Multiple Regression Analysis (Points and Predictor Grids)"	""
 "Zonal Statistics"	"Zonale Statistik"
 "Zone"	"Zone"
 "Zone Grid"	"Zonenraster"
+"Zones"	""
 "Zoom"	""
 "Zoom To Active Layer"	"Zoome zur aktiven Ebene"
 "Zoom To Extent"	""
@@ -5326,12 +5906,8 @@ TEXT	TRANSLATION
 "[VAL] Bilinear"	""
 "[VAL] Inverse Distance"	"Umgekehrte Distanz"
 "[VAL] None"	"Nicht vorhanden"
-"[deprecated] Ordinary Kriging"	""
-"[deprecated] Ordinary Kriging (Global)"	""
 "[deprecated] Point Cloud Viewer"	""
 "[deprecated] TIN Viewer"	""
-"[deprecated] Universal Kriging"	""
-"[deprecated] Universal Kriging (Global)"	""
 "[not set]|"	"[nichts ausgew�hlt]|"
 "\n** Error : Invalid parameters **\n"	"\n**Fehler : Ung�ltige Parameter **\n"
 "\nError: Please verify your xMin, yMin, xMax, yMax settings!\n"	"\nFehler: Bitte �berpr�fe deine xMin, yMin, xMax, yMax Einstellungen!\n"
@@ -5343,6 +5919,33 @@ TEXT	TRANSLATION
 "\nValue of Target Function"	"\nWert der Zielfunktion"
 "\n\n ** Error : Could not close PDF engine ** \n\n"	"\n\n **Fehler: Konnte PDF-Modul nicht beenden **\n\n"
 "\n\n ** Error : Could not save PDF file ** \n\n"	"\n\n **Fehler: Konnte PDF-Datei nicht speichern **\n\n"
+"_TL"	""
+"__ACHAN__"	""
+"__C0__"	""
+"__CHANA__"	""
+"__DOWNWT__"	""
+"__DX__"	""
+"__KCI__"	""
+"__KC__"	""
+"__KDP__"	""
+"__KT__"	""
+"__MB__"	""
+"__MCI__"	""
+"__MDP__"	""
+"__MF__"	""
+"__MW__"	""
+"__NB__"	""
+"__NCI__"	""
+"__NF__"	""
+"__OPTDIFF__"	""
+"__OPTTRANS__"	""
+"__PF__"	""
+"__PMA__"	""
+"__PPT__"	""
+"__SCR__"	""
+"__TAUC__"	""
+"__TCI__"	""
+"__WRTINT__"	""
 "a * b"	""
 "a + b * (1 - exp(-(x / c)^2))"	""
 "a + b * (1 - exp(-x / c))"	""
@@ -5355,6 +5958,7 @@ TEXT	TRANSLATION
 "a(s)"	"a(s)"
 "a(s) [lower bound]"	"a(s) [untere Grenze]"
 "a(s) [upper bound]"	"a(s) [obere Grenze]"
+"abort"	""
 "abort export"	"breche Export ab"
 "absolute"	"absolut"
 "absolute catchment area"	""
@@ -5364,9 +5968,9 @@ TEXT	TRANSLATION
 "accufractionflux / state"	""
 "accuthresholdflux / state"	""
 "accutriggerflux / state"	""
+"add"	""
 "add buffer (map units) to extent"	""
 "add to current selection"	"f�ge zu gegenw�rtiger Auswahl hinzu"
-"add value"	""
 "added"	""
 "adjusted"	""
 "after"	"nach"
@@ -5386,12 +5990,14 @@ TEXT	TRANSLATION
 "already in transaction"	""
 "alternating scale bar"	""
 "alternative"	""
-"analyzing known classes"	""
+"always ask what to do"	""
 "angle calculation is only available when exact two features are compared"	""
 "another grid"	"andere Rasterdaten"
+"append"	""
 "append records, if table structure allows"	"H�nge Datens�tze an, wenn die Tabellenstruktur dieses erlaubt"
 "appending to existing table"	"an bestehende Tabelle anh�ngen"
-"apply linear flow routing (D8) to all cells, having a catchment area greater than the specified threshold"	""
+"apply coordinate transformation if appropriate"	""
+"apply linear flow routing (D8) to all cells, having a flow accumulation greater than the specified threshold"	""
 "approximating points..."	"Punkte angleichend�"
 "are completely within"	"sind vollkommen innerhalb"
 "are in the specified directory.\n"	"sind in der vorgegebenen Richtung.\n"
@@ -5410,8 +6016,11 @@ TEXT	TRANSLATION
 "attribute is identical with search expression"	"Attribut ist identisch mit dem Suchausdruck"
 "attribute to be searched; if not set all attributes will be searched"	"zu durchsuchende Attribute; wenn nichts eingetragen wird, werden alle Attribute durchsucht"
 "author      "	"Autor"
-"automatically save and load"	"automatisch speichern und laden"
+"automatically"	""
 "average"	"Durchschnitt"
+"average size of the area covered by each category that occurs within search area"	""
+"averages"	""
+"averages + standard deviations"	""
 "avoids precision problems when source and target crs use different geodedtic datums."	""
 "b(q)"	"b(q)"
 "b(q) [lower bound]"	"b(q) [untere Grenze]"
@@ -5422,6 +6031,7 @@ TEXT	TRANSLATION
 "band width smoothing"	""
 "bar"	"Balken"
 "bar (not outlined)"	"Balken (nicht umrandet)"
+"basic SIA model"	""
 "before"	"vor"
 "begin transaction command failed"	""
 "bi-linear saddle"	"bilinearer Sattel"
@@ -5437,10 +6047,12 @@ TEXT	TRANSLATION
 "blending distance given in map units"	""
 "blue channel color"	"Blauer Farbkanal"
 "bm"	""
+"both"	""
 "bottom"	"Unten"
 "bottom / left"	"unten / links"
 "bottom left"	"unten links"
 "bottom right"	"unten rechts"
+"bottom up"	""
 "bright - dark"	"hell - dunkel"
 "built-in"	"eingebaut"
 "c, Percentage clays [%]"	"c, Prozentanteil Tage [%]"
@@ -5452,11 +6064,11 @@ TEXT	TRANSLATION
 "calculating variance"	""
 "cartesian"	"kartesisch"
 "catchment area and slope..."	""
-"catchment area threshold (cells) for linear flow routing"	""
 "catchment length (square root of catchment area)"	""
 "catchment slope"	""
 "catchment specific parameter for sediment delivery ratio calculation"	""
 "categorical"	""
+"category and library name"	""
 "cell"	"Zelle"
 "cell area"	"Zellfl�che"
 "cells"	"Zellen"
@@ -5468,7 +6080,6 @@ TEXT	TRANSLATION
 "center cell's aspect direction"	"zentrale Zelle Bezugsrichtung"
 "central"	"zentral"
 "change"	"Wechsel"
-"character string"	"Zeichenkette"
 "check for building parts failed"	""
 "check this in case parameter 'water' is absolute water level"	"�berpr�fe dieses f�r den Fall dass der Parameter `Wasser`der absolute Wasserpegel ist"
 "check this in case seed cells are coded with absolute water level"	"�berpr�fe dieses wenn die Keimzellen mit dem absoluten Wasserpegel kodiert sind "
@@ -5487,30 +6098,40 @@ TEXT	TRANSLATION
 "classification"	"Klassifikation"
 "clay content given as percentage"	"Tongehalt gegeben in Prozentanteilen"
 "clean inner rings"	""
+"clip extent does not match extent of input grids"	""
 "clip extent does not match grid's extent"	""
 "clip features"	""
 "clipped"	""
 "clockwise"	"im Uhrzeigersinn"
+"closed"	""
 "closing"	"Schlie�en"
 "coef0"	""
 "coef0 in kernel function"	""
+"collecting background data"	""
+"collecting elements"	""
+"collecting presence data"	""
 "color"	"Farbe"
-"color (rgb)"	"Farbe (RGB)"
 "colors"	"Farben"
 "columns"	"Spalten"
 "comma"	"Komma"
 "comma (,)"	"Komma (,)"
+"command execution failed"	""
 "commit"	"�bergeben"
 "commit transaction command failed"	""
 "complete input times near points matrix"	""
 "completely contain"	"vollst�ndig enthalten"
 "completely contained"	"vollkommen umschlossen"
+"concavity"	""
 "confirm"	"Best�tige"
 "confirm with options"	"Best�tige mit Optionen"
+"conrad"	""
 "constant direction into the wind blows, given as degree"	""
 "contain the centeroid of"	"enth�lt den Schwerpunkt von "
 "continue"	"fortsetzen"
 "continuous"	""
+"conventional eight-neihbourhood"	""
+"conventional four-neighbourhood"	""
+"convexity"	""
 "coordinates (offset, range, cell size, tile size)"	"Koordinaten (Verschiebung, Bereich, Zellgr��e, Kachelgr��e)"
 "copying"	"kopieren"
 "copyrights (c) 2006 Stefan Liersch"	""
@@ -5520,7 +6141,9 @@ TEXT	TRANSLATION
 "corrupted file header"	"besch�digter Dateikopf"
 "corrupted record header"	"besch�digter Datensatzkopf"
 "corrupted shapefile."	"besch�digte Vektordatei."
+"could allocate memory for scaled grid"	""
 "could not add save point"	""
+"could not allocate memory for temporary grid."	""
 "could not allocate sufficient memory"	""
 "could not commit/rollback transactions."	"Konnte nicht �bergeben/wiederhole Transaktion."
 "could not connect ODBC source"	"kann nicht mit ODBC-Quelle verbinden"
@@ -5536,19 +6159,24 @@ TEXT	TRANSLATION
 "could not disconnect PostgreSQL source"	""
 "could not execute module"	"Werkzeug konnte nicht ausgef�hrt werden"
 "could not execute tool"	"Werkzeug konnte nicht ausgef�hrt werden"
+"could not find any band data"	""
+"could not find level data"	""
 "could not find module"	"Werkzeug konnte nicht lokalisiert werden"
 "could not find tool"	"Werkzeug konnte nicht lokalisiert werden"
 "could not import random forest"	""
+"could not initialize classifier from file"	""
+"could not initialize classifier from training areas"	""
 "could not initialize cluster engine"	""
 "could not initialize data objects"	""
+"could not initialize kernel"	""
 "could not initialize module"	"Werkzeug konnte nicht initialisiert werden"
-"could not initialize point search engine"	"Kann Suchmaschine f�r Punkte nicht starten"
 "could not initialize reference point search engine"	""
 "could not initialize search engine for hills"	""
 "could not initialize search engine for valleys"	""
 "could not initialize search kernel"	""
 "could not initialize tool"	"Werkzeug konnte nicht initialisiert werden"
 "could not load file"	""
+"could not load model from file"	""
 "could not locate line string to polygon conversion tool"	""
 "could not open GetMap stream"	""
 "could not open data source"	"kann Datenquelle nicht �ffnen"
@@ -5563,6 +6191,7 @@ TEXT	TRANSLATION
 "could not save shape"	""
 "could not start transaction"	""
 "counterclockwise"	"gegen den Uhrzeigersinn"
+"counting cells"	""
 "create data source"	"erzeuge Datenquelle"
 "create from training areas"	""
 "create layer"	"Erzeuge Ebene"
@@ -5571,16 +6200,15 @@ TEXT	TRANSLATION
 "creating batch file example"	"erzeuge Batch-Datei als Beispiel"
 "creating interpolator"	"erzeuge Interpolator"
 "creating tool documentation files"	"Erstelle Dateien zur Werkzeugdokumentation"
+"critical slope"	""
 "cross"	"Kreuz"
 "cubic convolution"	""
 "cubic surface"	"kubische Oberfl�che"
 "cyan - white"	"cyan - wei�"
 "dX"	""
 "dX (Map Units)"	"dX (Karteneinheiten)"
-"dX(GridUnits)"	"dX(Vektoreinheiten)"
 "dY"	""
 "dY (Map Units)"	"dY (Karteneinheiten)"
-"dY(GridUnits)"	"dY(Vektoreinheiten)"
 "dZ"	""
 "dZ (Map Units)"	""
 "dark - bright"	"dunkel - hell"
@@ -5591,10 +6219,10 @@ TEXT	TRANSLATION
 "dark object subtraction 4"	""
 "data / no-data"	""
 "data file could not be openend"	"Datendatei konnte nicht ge�ffnet werden"
+"data file does not exist"	""
 "data set has no attributes"	""
 "database table does not exist"	"Datentabelle existiert nicht"
 "date"	"Datum"
-"date (dd.mm.yyyy)"	"Datum (dd.mm.yyyy)"
 "day"	"Tag"
 "dbf read: could not open file"	""
 "dbf read: could not read header"	""
@@ -5608,6 +6236,7 @@ TEXT	TRANSLATION
 "default (same brightness)"	"Standard (gleiche Helligkeit)"
 "default value if no attribute has been selected"	"Vorgabewert wenn kein Attribut ausgew�hlt wurde"
 "default value if no grid has been selected"	"Vorgabewert wenn kein Raster ausgew�hlt wurde"
+"defines the maximum resolution [km] for the re-projected distance segments"	""
 "degree"	"Grad"
 "degree in kernel function"	""
 "degree to radians"	"Grad zu Radians"
@@ -5615,7 +6244,11 @@ TEXT	TRANSLATION
 "delete data source"	"Entferne Datenquelle"
 "delete feature"	"entferne Eigenschaft"
 "delete layer"	"Entferne Ebene"
+"delivery index calculation failed"	""
 "descending"	"absteigend"
+"diffuse pollution risk calculation failed"	""
+"diffusive"	""
+"diffusive and fluvial"	""
 "digital elevation model"	"digitales H�henmodell"
 "digital elevation model [m]"	"Digitales H�henmodell [m]"
 "digitzing a polygon"	"Digitalisiere ein Polygon"
@@ -5647,6 +6280,8 @@ TEXT	TRANSLATION
 "edge detection"	"Eckenerkennung"
 "edge of flight line flag"	"Ecken der Flugroute flag"
 "effective flow length"	""
+"eight-neihbourhood"	""
+"eight-neihbourhood (distance based weighting)"	""
 "elevation"	"Erhebung"
 "elevation and roughness"	"Erhhebung und Rauheit"
 "elevation threshold used to identify hills/valleys"	""
@@ -5668,7 +6303,6 @@ TEXT	TRANSLATION
 "error saving index file"	"Fehler beim Speichern der Indexdatei"
 "exclude range"	"grenze Bereich aus"
 "executing tool"	"Werkzeugausf�hrung"
-"existing grid system"	"bestehendes Rastersystem"
 "expand"	""
 "expand and shrink"	""
 "expected"	""
@@ -5676,7 +6310,6 @@ TEXT	TRANSLATION
 "explained cumulative variance"	"ausgef�hrte kumulative Streuung"
 "explained variance"	"Varianzaufkl�rung"
 "exponential"	"exponential"
-"exponential weighting scheme"	"exponentiell gewichtetes Schema"
 "export grid"	""
 "extent of lake, coded with local water depth"	"Ausdehnung des Sees, kodiert mit lokaler Wassertiefe"
 "extent of lake, coded with water depth"	"Ausdehnung des Sees, kodiert mit der Wassertiefe"
@@ -5689,19 +6322,29 @@ TEXT	TRANSLATION
 "failed to estimate target extent"	""
 "failed to initialise search engine"	"Initialisierung der Suchmaschine fehlgeschlagen"
 "failed to initialize target grid"	""
+"failed to launch default application"	""
+"failed to load KML ground overlay icon"	""
+"failed to load data"	""
+"failed to load file"	""
+"failed to load georeference for KML ground overlay"	""
+"failed to load or parse xml file"	""
 "failed to project target grid"	""
 "failed to set radius"	""
 "failed: could not find a suitable import driver"	"fehlgeschlagen: konnte keinen passenden Importtreiber finden"
 "fat"	""
 "feathering"	""
+"feature has been dropped"	""
 "feature space"	"Merkmal Raum"
 "feature space and position"	"Merkmal Raum und Position"
 "field cannot be mapped to binary object"	"Feld kann nicht als bin�res Objekt abgebildet werden"
+"fields layer does not contain any records"	""
 "file could not be opened"	"Datei konnte nicht ge�ffnet werden"
 "file could not be opened."	"Datei konnte nicht ge�ffnet werden."
 "file does not exist."	"Datei existiert nicht."
 "file not found"	"Datei nicht gefunden"
 "file path, name and type used to save frames to image files"	""
+"fill sinks permanently"	""
+"fill sinks temporarily"	""
 "find inner rings"	""
 "find local minima"	"finde lokales Minimum"
 "first"	"zu Erst"
@@ -5720,21 +6363,28 @@ TEXT	TRANSLATION
 "fixed value"	"fester Wert"
 "floating"	""
 "floating point"	"Flie�komma"
+"flow accumulation threshold (cells) for linear flow routing"	""
 "flow depth [m] for flow travel time estimation"	""
 "flow directions..."	"Flie�richtungen..."
 "flow travel time to channel expressed in hours based on Manning's Equation"	""
 "flow width (original)"	"Flie�breite (original)"
+"fluvial"	""
 "forward"	"vorw�rts"
+"found less than two categories, nothing to do"	""
+"four-neighbourhood"	""
+"from line center"	""
 "from list"	"von Liste"
 "full frame"	""
 "function fitting failed !"	"Funktionsanpassung fehlgeschlagen!"
 "function not found"	"Funktion nicht gefunden"
+"function parameters"	""
+"function parameters + trend quality"	""
 "function table full"	"Funktionstabelle voll"
 "gamma in kernel function"	""
+"gaps filled"	""
 "gaussian"	"Gaussche"
 "gaussian kernel"	"Gausscher kernel"
 "gaussian weighting"	"Gaussche Gewichtung"
-"gaussian weighting scheme"	"gewichtetes Gaussches Schema"
 "geographical"	"geographisch"
 "give output of an edge twice, i.e. once for each of the two adjacent polygons"	""
 "given as map units or meters if polar coordinates switch is on; ignored if set to zero"	"als Karteneinheiten oder Meter gegeben wenn Polarkoordinaten eingestellt sind; bei Einstellung 0 ignoriert"
@@ -5772,7 +6422,9 @@ TEXT	TRANSLATION
 "hh:mm:ss"	""
 "hhmmss, fix size"	"hhmmss, feste Gr��e"
 "high"	""
+"highest"	""
 "highest z"	"h�chster z"
+"hillslope length-to-channel"	""
 "histogram match"	""
 "horizontal"	"horizontal"
 "hours"	"Stunden"
@@ -5788,6 +6440,7 @@ TEXT	TRANSLATION
 "immediate"	"direkt"
 "importing line strings"	""
 "improper function syntax"	"unsachgem��e Funktionssyntax"
+"improved SIA model"	""
 "in the formula these grids are addressed in order of the list as 'g1, g2, g3, ...'"	""
 "in the formula these grids are addressed in order of the list as 'h1, h2, h3, ...'"	""
 "include all"	"alles einschlie�en"
@@ -5800,12 +6453,16 @@ TEXT	TRANSLATION
 "index file could not be opened"	"Indexdatei konnte nicht ge�ffnet werden"
 "index number"	""
 "index out of bounds"	"Index au�erhalb der Regeln"
+"index out of range"	""
+"initial map window arrangement after a project is loaded"	""
 "initial number of lag distance classes"	""
+"initial number of lag distance classes for variogram estimation"	""
 "initialisation error"	"Initialisierungsfehler"
 "initialising gradient..."	"Initialisiere Gradient..."
 "initialising planetary bending..."	"initialisiere planetare Beugung"
 "initialization"	"Initialisierung"
-"initializing"	""
+"initialization failed"	""
+"initialize grid cells"	""
 "input"	"Eingabe"
 "input file"	"Eingabedatei"
 "instable (thawing)"	"instabil (auftauend)"
@@ -5815,7 +6472,7 @@ TEXT	TRANSLATION
 "interpolate values if projection is needed"	""
 "interpolating"	"interpolierend"
 "interpolation method to use if grid needs to be aligned to coordinate system"	""
-"intersect"	"�berkreuzen"
+"intersect"	"�berschneiden"
 "intersects"	"Schnittmenge"
 "invalid E00 file"	"ung�ltige E00 Datei"
 "invalid NetCDF file"	""
@@ -5825,6 +6482,7 @@ TEXT	TRANSLATION
 "invalid control points"	"ung�ltige Kontrollpunkte"
 "invalid data"	"ung�ltige Daten"
 "invalid division size"	""
+"invalid features"	""
 "invalid field selection"	"ung�ltige Feldauswahl"
 "invalid file code"	"ung�ltiger Dateicode"
 "invalid filter matrix"	"ung�ltige Filtermatrix"
@@ -5849,7 +6507,9 @@ TEXT	TRANSLATION
 "invalid project file."	"ung�ltige Projektdatei."
 "invalid snap features"	""
 "invalid table"	"ung�ltige Tabelle"
+"invalid target grid"	""
 "invalid tool definition"	""
+"invalid training data"	""
 "invalid user specified value range."	""
 "invalid utm zone"	"ung�ltige UTM Zone"
 "invalid word size"	"ung�ltige Wortl�nge"
@@ -5858,15 +6518,24 @@ TEXT	TRANSLATION
 "inverse transformation not available"	"inverse Umwandlung nicht verf�gbar"
 "is ignored if set to zero"	"wird nicht ber�cksichtigt wenn auf Null gesetzt"
 "j-shaped"	"j-f�rmig"
+"ja; bestimmen anhand eines Hauptgerinnerasters (HG Raster)"	""
+"ja; bestimmen ueber das Wasserflussvolumen (P:RFlow)"	""
+"ja; bestimmen ueber die jeweilige Anzahl der ZuflussRasterzellen (IR:NumInFlowCells, P:NumCells"	""
 "k factor"	"k Faktor"
 "k-fold"	""
+"keep accumulated weights above zero; useful e.g. when accumulating measures of water balance."	""
 "keep maxima (with tolerance)"	"benutze Maxima (mit Toleranz)"
 "keep minima (with tolerance)"	"behalte Minima (mit Toleranz)"
 "keep original line attributes"	"benutze urspr�ngliche Linienattribute"
+"keine"	""
+"kernel size defined as radius number of cells"	""
+"kml and image files"	""
+"kmz file"	""
+"kmz, kml and image files"	""
 "label minima"	"Bezeichnungsminima"
 "last"	"zu Letzt"
-"last opened"	"zuletzt ge�ffnet"
 "last point"	"letzter Punkt"
+"last state"	""
 "last value"	"letzter Wert"
 "layer uses undefined coordinate system, assuming geographic coordinates"	""
 "learning"	""
@@ -5874,17 +6543,18 @@ TEXT	TRANSLATION
 "least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"	""
 "leave one out"	""
 "left"	"links"
+"less than two classes in model"	""
 "less than two polygons in layer, nothing to do!"	""
 "level"	"Level"
 "level 1"	"Level 1"
 "level 2"	"Level 2"
 "library     "	""
+"library file name"	""
 "library name"	"Bibliotheksname"
 "library path"	"Bibliothekspfad"
 "line simplification can only be applied to lines and polygons"	"Linienvereinfachung kann nur mit Linien oder Polygonen genutzt werden"
 "linear"	"linear"
 "linear: u'*v\npolynomial: (gamma*u'*v + coef0)^degree\nradial basis function: exp(-gamma*|u-v|^2)\nsigmoid: tanh(gamma*u'*v + coef0)"	""
-"linearly decreasing within search radius"	"mit dem Suchradius linear abnehmend"
 "lines"	"Linien"
 "lines with same attribute value(s)"	"Linien mit gleichem Attributwert(en)"
 "list order"	""
@@ -5910,11 +6580,15 @@ TEXT	TRANSLATION
 "lower cell's value to neighbours minimum value minus epsilon"	""
 "lower left and upper right center coordinates"	""
 "lower left and upper right corner coordinates"	""
+"lowest"	""
 "lowest z"	"niedrigster z"
 "m"	""
 "m2"	""
 "m2/h"	""
-"m_Flow Path Length"	""
+"m3/Monat"	""
+"m3/s"	""
+"m_pBoundary"	""
+"m_pRock_Top_Idx"	""
 "magenta - white"	"magenta - wei�"
 "main basins..."	"Hauptbecken..."
 "majority"	""
@@ -5934,6 +6608,8 @@ TEXT	TRANSLATION
 "max_sd"	""
 "maxima of variance"	""
 "maximum"	"maximum"
+"maximum difference between original and median filtered elevation (3x3 moving window) that still is recognized flat"	""
+"maximum distance for variogram estimation"	""
 "maximum number of calculated first components; set to zero to get all"	"maximale Anzahl der berechneten ersten Komponenten; auf null setzen um alle zu erhalten"
 "maximum number of iterations, ignored if set to zero (default)"	""
 "maximum number of nearest points"	""
@@ -5960,21 +6636,28 @@ TEXT	TRANSLATION
 "minima of variance"	""
 "minimum"	"Minimum"
 "minimum number of points to use"	"minimale Anzahl zu benutzender Punkte"
+"minimum number of upslope contributing cells to start a channel"	""
 "minimum requirement"	""
 "minimum slope angle preserved from one cell to the next, zero results in flat areas [Degree]"	"minimaler Neigungswinkel der von einer Zelle zur n�chsten erhalten bleibt, null ergibt eine ebene Fl�che [Grad]."
+"minimum sub-time step size in years"	""
 "minimum value"	"Minimalwert"
 "minimum value of all duplicates"	""
 "minimum x value"	"minimaler x-Wert"
 "minimum y value"	"minimaler y-Wert"
 "minutes"	"Minuten"
+"missing icon tags"	""
 "missing operand"	"fehlender Operand"
+"missing tool chain tags"	""
+"missing year"	""
 "model application"	""
 "model creation"	""
 "moment"	"Moment"
+"month"	""
 "more than one field in selection"	"mehr als ein Feld ausgew�hlt"
 "morpological gradient"	"morphologischer Gradient"
 "most significant first"	"das bedeutenste zuerst"
 "multi scale"	"multima�st�blich"
+"multiple"	""
 "multiple flow direction"	""
 "multiplicative"	"vielfach"
 "n"	""
@@ -5984,6 +6667,7 @@ TEXT	TRANSLATION
 "nearest neigbhour"	""
 "nearest neighbour"	""
 "needs at least two attributes in selection"	""
+"nein"	""
 "neon"	""
 "new"	"neu"
 "new selection"	"Neue Auswahl"
@@ -5999,6 +6683,7 @@ TEXT	TRANSLATION
 "no class definitions for initial state"	"Keine Klassendefinitionen f�r Ausgangszustand"
 "no conversion (areas already given as specific catchment area)"	"keine Umwandlung (Gebiete sind bereits als spezifische Einzugsgebiete gegeben)"
 "no data entries in project file."	""
+"no data objects"	""
 "no data values"	"keine Datenwerte"
 "no database connection"	"Keine Datenbankverbindung"
 "no description"	""
@@ -6009,9 +6694,11 @@ TEXT	TRANSLATION
 "no features to buffer."	"keine Eigenschaften zum Puffern."
 "no fields in selection"	"Keine Felder in der Auswahl"
 "no fields to add"	""
+"no files in selection"	""
 "no gaps"	"Keine L�cken."
 "no geometry in selection"	""
 "no grid in list"	"kein Raster in Auflistung"
+"no grids have been imported"	""
 "no grids in list"	"keine Raster in Liste"
 "no grids in selection"	"keine Raster in Auswahl"
 "no histogram for unclassified data"	"kein Histogramm f�r unbestimmte Werte"
@@ -6021,12 +6708,14 @@ TEXT	TRANSLATION
 "no layers in data source"	"Keine Ebenen in Datenquelle"
 "no lines for splitting"	""
 "no memory"	"kein Speicher"
+"no output"	""
 "no output parameter in selection"	"kein Ausgabeparameter in der Auswahl"
 "no parameter output specified"	""
+"no points in input layer"	""
 "no points in layer"	"kkeine Punkte in der Ebene"
 "no points removed"	"keine Punkte entfernt"
 "no polygons in input"	"keine Polygone in der Eingabe"
-"no polygons in polygon layer"	"keine Polygone in Polygonebene"
+"no polygons in input layer"	""
 "no predictors available"	""
 "no predictors have been selected"	""
 "no predictors in selection"	""
@@ -6044,6 +6733,7 @@ TEXT	TRANSLATION
 "no shapes for intersection found"	"keine Vektoren f�r Schnittmenge gefunden"
 "no shapes in selection"	"keine Vektoren in Auswahl"
 "no sinks"	"keine Senken"
+"no spatial intersection between grid(s) and points layer"	""
 "no spatial intersection between grid(s) and polygon layer"	"keine r�umliche �berschneidung zwischen Raster(n) und Polygonebenen"
 "no target specified"	"kein Ziel ausgew�hlt"
 "no target variable in selection"	""
@@ -6073,7 +6763,6 @@ TEXT	TRANSLATION
 "not enough points for interpolation"	"nicht genug Punkte f�r eine Interpolation"
 "not enough points to perform pattern analysis"	"nicht genug Punkte f�r eine Musteranalyse"
 "not enough reference points"	""
-"not entries in statistics table."	""
 "not in transaction"	""
 "not more than one point in layer"	"nicht mehr als ein Punkt in der Ebene"
 "not supported by PostGIS versions less than 2.1"	""
@@ -6082,25 +6771,32 @@ TEXT	TRANSLATION
 "nothing to do. transformation needs at least two components."	""
 "nothing to do: input format is same as output format"	""
 "nothing to do: no data in selection"	"nichts zu tun: keine Daten ausgew�hlt"
+"nothing to do: no output to memory or file has been specified"	""
 "nothing to do: original and desired field types are identical"	""
 "nu-SVC"	""
 "nu-SVR"	""
 "number of added polygons"	"Anzahl zugef�gter Polygone"
+"number of categories"	""
+"number of cells"	""
 "number of cells in S-N direction"	"Anzahl der Zellen in S-N-Richtung"
 "number of cells in W-E direction"	"Anzahl der Zellen in W-E-Richtung"
+"number of different categories (unique values) within search area"	""
 "number of dropped observations"	""
 "number of dropped shapes"	"Nummer der abgeworfenen Vektoren"
 "number of grid cells per tile"	"Nummer der Rasterzellen pro Kachel"
 "number of initial and final state grids differs"	""
 "number of inner rings"	""
+"number of model features do not fit input features list"	""
 "number of order"	"Nummer des Auftrages"
 "number of pits above threshold level"	"Anzahl der Gruben zwischen Schwellenwertpegel"
 "number of points"	"Anzahl der Punkte"
 "number of processed sinks"	"Anzahl der berechneten Senken"
 "number of replacements"	""
 "number of returns of given pulse"	"Anzahl der Antworten auf gegebene Pulse"
+"number of scanned files"	""
 "number of subsamples for k-fold cross validation"	""
 "number of the return"	"Anzahl der Antworten"
+"number of translatable elements"	""
 "object"	""
 "objects"	""
 "offset in minutes relative to 00:00 (midnight)"	""
@@ -6118,16 +6814,18 @@ TEXT	TRANSLATION
 "only during start up phase"	"nur w�hrend der Programminitialisierung"
 "only entities with layer definition"	"nur Instanzen mit Ebenendefinition"
 "only entities without layer definition"	"nur Instanzen ohne Ebenendefinition"
+"only one class in training data"	""
 "only points with given minimum number of points in search radius will be processed"	"nur Punkte mit einer gegebenen Mindestanzahl von Punkten im Suchradius werden bearbeitet"
 "only show within scale range; values are given as extent measured in map units"	""
 "only z"	"nur z"
+"open"	""
 "open transactions committed"	"offene Transaktionen �bermittelt"
 "open transactions rollbacked"	"offene Transaktionen wiederholt"
 "open transactions rolled back"	""
 "opening"	"�ffnend"
 "operator"	"Operator"
 "optional"	"optional"
-"optional grid providing values to be compared with linear flow threshold instead of catchment area"	""
+"optional grid providing values to be compared with linear flow threshold instead of flow accumulation"	""
 "optional input"	"optionale Eingabe"
 "optional output"	"optionale Ausgabe"
 "origin adjustment for Z axis (heading)"	""
@@ -6143,14 +6841,18 @@ TEXT	TRANSLATION
 "output of intermediate results to execution message window"	""
 "ovalooblonga-rectangularoblonga"	""
 "ovaloredonda-ovalooblonga"	""
+"overwrite previous output if adequate"	""
 "p-value"	""
 "parallel"	"parallel"
 "parameter C (cost) of C-SVC, epsilon-SVR, and nu-SVR"	""
+"parameter not found"	""
 "parameter nu of nu-SVC, one-class SVM, and nu-SVR"	""
 "parameters"	"Parameter"
 "pass"	"Ablauf"
 "patch size"	""
 "pdf"	"pdf"
+"per line"	""
+"per line segment"	""
 "percent"	"Prozent"
 "percentiles"	""
 "perform region growing"	"ausf�hren des Regionen wachsen"
@@ -6181,19 +6883,23 @@ TEXT	TRANSLATION
 "polynomial"	""
 "polynomial trend"	""
 "polynomial trend (coefficient interpolation)"	""
+"polyonom fit"	""
 "post-processing..."	""
 "power of distance"	"power of distance"
 "prediction"	""
 "preparing distance calculation..."	"bereite Entfernungsberechnung vor�"
 "press any key"	"Dr�cke eine beliebige Taste"
 "processed DEM"	"berechnetes DGM"
+"processing"	""
 "processors  "	""
+"projection initialization failed"	""
 "projection initialization failure"	"Projektionsinitialisierungsfehler"
 "proportional"	""
 "quadrants"	"Quadrant"
 "quadratic surface"	"quadratische Oberfl�che"
 "quantiles"	"Quantile"
 "quartic kernel"	"biquadratischer Systemkern"
+"r2"	""
 "radial basis function"	""
 "radians"	"Radians"
 "radians to degree"	"Radians zu Grad"
@@ -6201,8 +6907,10 @@ TEXT	TRANSLATION
 "radius given in map units used to fill valleys"	""
 "radius in map units"	"Radius in Karteneinheiten"
 "rainbow"	"Regenbogen"
+"random"	""
 "random read"	"zuf�llig lesen"
 "random write"	"zuf�llig schreiben"
+"range"	""
 "range of days"	"Bereich von tagen"
 "raster"	"Raster"
 "re-projection"	""
@@ -6219,15 +6927,12 @@ TEXT	TRANSLATION
 "red > grey > blue"	"rot > grau > blau"
 "red > grey > green"	"rot > grau > gr�n"
 "red channel color"	"roter Farbkanal"
-"red=1, green=2, blue=this"	"rot=1, gr�n=2, blau=dieses"
-"red=1, green=this, blue=2"	"rot=1, gr�n=dieses, blau=2"
-"red=2, green=1, blue=this"	"rot=2, gr�n=1, blau=dieses"
-"red=2, green=this, blue=1"	"rot=2, gr�n=dieses, blau=1"
 "red=this, green=1, blue=2"	"rot=dieses, gr�n=1, blau=2"
-"red=this, green=2, blue=1"	"rot=dieses, gr�n=2, blau=1"
 "redonda-ovaloredonda"	""
 "regression"	""
 "regression analysis could not detect a significant predictor"	""
+"regression model applied to predictor grids"	""
+"regression model applied to predictor grids with interpolated residuals added"	""
 "relative"	"relativ"
 "remove above percentile"	"entferne oberes Perzentil"
 "remove below percentile"	"entferne unteres Perzentil"
@@ -6235,6 +6940,7 @@ TEXT	TRANSLATION
 "remove maxima (with tolerance)"	"entferne Maxima (mit Tolernz)"
 "remove minima (with tolerance)"	"entferne Minima (mit Toleranz)"
 "removed"	""
+"replace"	""
 "replace existing table"	"ersetze bestehende Tabelle"
 "replacements"	"Austausch"
 "resampling"	"Neuberechnung"
@@ -6260,7 +6966,6 @@ TEXT	TRANSLATION
 "rotation clockwise in degree"	"Drehung im Uhrzeigersinn in Grad"
 "roughness"	"Rauigkeit"
 "rows"	"Reihen"
-"running classification"	"laufende Klassifizierung"
 "s, Percentage sand [%]"	""
 "same as in graphical user interface"	""
 "same as input grid"	"genau wie Eingaberaster"
@@ -6274,6 +6979,7 @@ TEXT	TRANSLATION
 "scale line"	""
 "scale to size range"	""
 "scan angle"	"Scanwinkel"
+"scanning"	""
 "search distance is less than half of grid cell size"	"Die Suchentfernung ist kleiner als die H�lfte einer Rasterzellengr��e"
 "seconds"	"Sekunden"
 "sectors"	"Sektoren"
@@ -6292,7 +6998,9 @@ TEXT	TRANSLATION
 "separate layer for each polygon"	"einzelne Ebene f�r jedes Polygon"
 "separate lines"	""
 "sequential write"	"sequentielles Schreiben"
-"set constant value"	""
+"set"	""
+"set greater one for line smoothing"	""
+"set input"	""
 "sgbm"	""
 "shading"	"Schummerung"
 "shading (fixed light source)"	"Schummerung (feste Lichtquelle)"
@@ -6302,7 +7010,9 @@ TEXT	TRANSLATION
 "shapes extent"	""
 "shapes have been dropped"	"Vektoren wurden zugewiesen"
 "shapes layer extent"	"Vektorebenen-Umfang"
+"shear stress coefficient Kt:"	""
 "show direct insolation for each time step."	"zeige direkte Sonneneinstrahlung f�r jeden Zeitschritt."
+"show mouse position in statusbar using geographic coordinates if possible"	""
 "shows cell values when zoomed"	""
 "shrink"	""
 "shrink and expand"	""
@@ -6317,10 +7027,12 @@ TEXT	TRANSLATION
 "simple planar surface"	"einfache planare Oberfl�che"
 "simply decrease cell's value by epsilon"	""
 "sin(x*x + y*y)"	""
+"single"	""
 "single class"	""
 "single flow direction"	""
 "single|range|simple table|user supplied table|"	"einzeln|Bereich|einfache Tabelle|durch Nutzer bereitgestellte Tabelle|"
 "size range as percentage of step"	""
+"skewness of the area size per category distribution"	""
 "slim"	""
 "slope threshold must not be zero!"	""
 "slope value has to be greater than zero"	""
@@ -6350,6 +7062,10 @@ TEXT	TRANSLATION
 "standard kernel 2"	"Standard Kernel 2"
 "standardize"	""
 "standardized"	""
+"statistics table does not contain any records"	""
+"statistics table is missing required fields"	""
+"stddev"	""
+"steepest neighbour"	""
 "step"	"Schritt"
 "step size should not exceed number of cells in x or y direction"	""
 "stepwise"	"Schrittweise"
@@ -6358,7 +7074,7 @@ TEXT	TRANSLATION
 "stretch to specified value range"	""
 "string"	"Zeichenkette"
 "subbasins..."	"Teilbecken..."
-"subtract value"	""
+"subtract"	""
 "success"	"Erfolgreich"
 "sum"	""
 "sums-of-squares-and-cross-products matrix"	"Summe von Quadrat und Kreuprodukten Matrix"
@@ -6388,7 +7104,7 @@ TEXT	TRANSLATION
 "tolerance of termination criterion"	""
 "too few parameters"	"Zu wenige Parameter"
 "too many constants"	"Zu wenige Konstanten"
-"too many input grids"	"zu viele Eingaberaster"
+"too many input variables"	""
 "too many parameters"	"Zu viele Parameter"
 "tool        "	""
 "tool execution failed"	""
@@ -6397,6 +7113,7 @@ TEXT	TRANSLATION
 "tools"	"Werkzeuge"
 "top"	"Oben"
 "top / right"	"oben / rechts"
+"top down"	""
 "top hat"	""
 "top left"	"Oben links"
 "top right"	"Oben rechts"
@@ -6405,7 +7122,7 @@ TEXT	TRANSLATION
 "topography"	"Topographie"
 "total catchment area"	""
 "trace stream network downstream"	""
-"training areas"	""
+"training"	""
 "training failed"	""
 "transaction started"	""
 "triangle (down)"	"Dreieck (Spitze abw�rts)"
@@ -6437,6 +7154,7 @@ TEXT	TRANSLATION
 "unsorted"	"unsortiert"
 "unsupported file version"	"nicht unterst�tzte Dateiversion"
 "unsupported shape type."	"nicht unterst�tzter Vektortyp."
+"unsupported tool chain version"	""
 "unsupported vector type"	""
 "until user closes it"	"bis Mausklick"
 "up"	"auf"
@@ -6444,14 +7162,15 @@ TEXT	TRANSLATION
 "update, fixed colour stretch"	"aktualisieren, feste Farbkennzeichnung"
 "upscaling of predictors"	""
 "upsetting model domain"	""
+"use a zero value for hillslopes, any other value for channel cells."	""
 "use more averaged elevations when looking at increasing distances"	""
 "use old version for constant wind direction (no acceleration and averaging option)"	""
 "use this for (linear) flow routing, if the value is a valid direction (0-7 = N, NE, E, SE, S, SW, W, NW)"	""
 "use this grid's system for output grids"	""
+"use values in selected cold air height output grid"	""
 "user data"	"Benutzerdaten"
 "user defined"	"nutzerdefiniert"
 "user defined NoData value"	""
-"user defined grid system"	"Benutzerdefiniertes Rastersystem"
 "user defined kernel"	"Benutzerdefinierter Kernel"
 "user defined reference"	"Benutzerdefinierte Referenz"
 "user defined size"	"Benutzer definierte Gr��e"
@@ -6466,12 +7185,18 @@ TEXT	TRANSLATION
 "variance-covariance matrix"	"Varianz-Kovarianz Matrix"
 "variogram model"	""
 "vertical"	"vertikal"
+"virus 1"	""
+"virus 2"	""
+"von Neumann (4)"	""
 "w"	""
+"wang/liu"	""
 "warning"	""
 "warning, input uses less than 4 bytes per value"	""
 "warning: albedo is ignored"	""
+"warning: local sink detected"	""
 "warning: number of Eigen vectors and components differs."	""
 "warning: number of component grids and components differs."	""
+"weathering only"	""
 "weighting factor for slope in index calculation"	""
 "whether to train a SVC or SVR model for probability estimates"	""
 "whether to use the shrinking heuristics"	""
@@ -6499,6 +7224,8 @@ TEXT	TRANSLATION
 "y Position"	"y Position"
 "yMax"	""
 "yMin"	""
+"years"	""
+"years before present"	""
 "yellow - white"	"gelb - wei�"
 "yellow > blue"	"gelb > blau"
 "yellow > green"	"gelb > gr�n"
diff --git a/src/saga_core/saga_gui/res/saga.lng.txt b/src/saga_core/saga_gui/res/saga.lng.txt
index a713a16..2aaf06b 100644
--- a/src/saga_core/saga_gui/res/saga.lng.txt
+++ b/src/saga_core/saga_gui/res/saga.lng.txt
@@ -46,14 +46,19 @@ TEXT	TRANSLATION
 "  Total Points:\t%ld"	""
 "  Total Pulses:\t%ld"	""
 "  Version:\t\t\t%d.%d"	""
+" Bed_shear_stress"	""
 "%.0f points from %d dataset(s) written to output grid %s."	""
 "%d points from %d dataset(s) written to output point cloud %s."	""
+"%d points from %s written to output %s."	""
+"%d points out of %d extracted."	""
+"%d points out of %d reclassified."	""
 "%d tiles created."	""
 "%d. %s"	""
 "%s_CORRPOINTS"	""
 "%s_DISP_VEC"	""
 "%s_colorised"	""
 "%s_merged"	""
+"%s_stats"	""
 "(Tw) wetness decline time constant"	""
 "(Tw) wetness decline time constant [lower bound]"	""
 "(Tw) wetness decline time constant [upper bound]"	""
@@ -63,6 +68,7 @@ TEXT	TRANSLATION
 "(b)"	""
 "(b) [lower bound]"	""
 "(b) [upper bound]"	""
+"(c) 2007 by O.Conrad, R.Heinrich"	""
 "(c) Parameter [lower bound]"	""
 "(c) Parameter [upper bound]"	""
 "(f) Temperature Modulation Factor [lower bound]"	""
@@ -88,7 +94,10 @@ TEXT	TRANSLATION
 "** Minimum: %.2lf K"	""
 "** Warning : Number of events might not be representative.\nMinimum number recommended: "	""
 "** Warning : Outlet point was modified **"	""
-","	""
+"...anteilig aus Rasterzellen der Teileinzugegebiete"	""
+"...anteilig aus den Flussrasterzellen"	""
+"...anteilig aus den Hauptgerinnerasterzellen"	""
+"...genau den entsprechenden Wert aus der jeweiligen Rasterzelle entnehmen"	""
 "0"	""
 "0 - 1"	""
 "0 - 1.0"	""
@@ -204,7 +213,6 @@ TEXT	TRANSLATION
 "9 parameter 2nd order polynom (Zevenbergen & Thorne 1987)"	""
 ":-( :-( you are a loser :-( :-("	""
 ":-) :-) you are a winner :-) :-) Time:%ds\n"	""
-";"	""
 "<"	""
 "<="	""
 "<all grid systems>"	""
@@ -226,26 +234,32 @@ TEXT	TRANSLATION
 "A grid that contains elevation data."	""
 "A set of basic SAGA module programming examples."	""
 "A space separated list of key-value pairs (K=V)."	""
+"A text file with the full path to an input point cloud on each line"	""
 "A.Ringeler (c) 2003"	""
 "A3 Landscape"	""
 "A3 Portrait"	""
 "A4 Landscape"	""
 "A4 Portrait"	""
+"A:Garden"	""
 "A:Garden|Imagery"	""
+"A:Grid|Analysis|Macroecology"	""
 "A:Grid|Distances"	""
 "A:Grid|Filter"	""
 "A:Grid|Gaps"	""
 "A:Grid|Grid System"	""
+"A:Grid|Tools"	""
 "A:Grid|Values"	""
 "A:Imagery|Classification"	""
 "A:Imagery|Fourier Analysis"	""
 "A:Imagery|Segmentation"	""
 "A:Imagery|Tools"	""
+"A:Jan Hohlbein"	""
 "A:Shapes|Construction"	""
 "A:Shapes|Conversion"	""
 "A:Shapes|Selection"	""
 "A:Shapes|Table"	""
 "A:Shapes|Tools"	""
+"A:Spatial and Geostatistics|Geographically Weighted Regression"	""
 "A:Spatial and Geostatistics|Points"	""
 "A:Table|Construction"	""
 "A:Table|Selection"	""
@@ -277,6 +291,8 @@ TEXT	TRANSLATION
 "AWM2 Grid"	""
 "AWT Grid"	""
 "AZIMUTH"	""
+"Abflussmanipulation Rasterzelle 1... "	""
+"Abflussmanipulation Rasterzelle 2... "	""
 "About SAGA"	""
 "Above Elevation"	""
 "Above this threshold snow will start to melt"	""
@@ -321,6 +337,7 @@ TEXT	TRANSLATION
 "Add Grid Values to Points"	""
 "Add Grid Values to Shapes"	""
 "Add Identifier"	""
+"Add Indicator Fields for Categories"	""
 "Add Link to Files"	""
 "Add Location Info"	""
 "Add Overlap"	""
@@ -343,8 +360,6 @@ TEXT	TRANSLATION
 "Add unique identifier attribute field to output, ID resembles processing order."	""
 "Added"	""
 "Addition"	""
-"Additional Grids"	""
-"Additional Parameters"	""
 "Additional Point Clouds"	""
 "Additional Values"	""
 "Additional point clouds to merge with main point cloud."	""
@@ -365,6 +380,7 @@ TEXT	TRANSLATION
 "Aggregation"	""
 "Aggregation Index"	""
 "Aggregation Size"	""
+"Air Flow"	""
 "Air Humidity (2pm) [%%]"	""
 "Air Pressure, Water and Dust Content"	""
 "Albedo"	""
@@ -381,12 +397,15 @@ TEXT	TRANSLATION
 "All Recognized Files"	""
 "All Times"	""
 "All Variables"	""
+"Allgemeine Parameter"	""
 "Allocation"	""
 "Allocation Grid"	""
+"Allochthone Input"	""
+"Allochthoner Eintrag"	""
 "Allow Edge Pixels to be Seeds"	""
 "Allow longitudes outside -180 to 180 Range"	""
 "Allow multiple observer positions."	""
-"Allows one to scale shade brightness [percent]"	""
+"Allows one to scale shade brightness [%]"	""
 "Allows to scale shade brightness, [percent]"	""
 "Allows to write cell values from additional grids to the output"	""
 "Alpha"	""
@@ -414,9 +433,11 @@ TEXT	TRANSLATION
 "Angle in degrees, counting clockwise from north"	""
 "Angular Distance Weighted"	""
 "Annual"	""
+"Annual Climate"	""
 "Annual Course of Daily Insolation"	""
+"Answer"	""
+"Append Fields from another Table"	""
 "Append Rows from ..."	""
-"Append Rows from Table"	""
 "Applies also to the binary format header file."	""
 "Apply"	""
 "Apply Filter?"	""
@@ -432,6 +453,8 @@ TEXT	TRANSLATION
 "Approximate Terrain Slope [%]"	""
 "April"	""
 "Arc Vertex Distance [Degree]"	""
+"ArcGIS Version"	""
+"ArcSAGA Toolboxes"	""
 "Arcs to polygons"	""
 "Area"	""
 "Area +"	""
@@ -439,6 +462,7 @@ TEXT	TRANSLATION
 "Area Conversion"	""
 "Area [km2]"	""
 "Area [km2] Subbasin("	""
+"Area of an active channel within a cell"	""
 "Area of the Watershed in [km2]"	""
 "Area of the Watershed in [km2] used for unit conversion"	""
 "Area to Length Conversion"	""
@@ -469,10 +493,15 @@ TEXT	TRANSLATION
 "Atmospheric Pressure [mbar]"	""
 "Attribute"	""
 "Attribute (Size)"	""
+"Attribute Field"	""
 "Attribute Field Properties"	""
+"Attribute Field to Grid"	""
 "Attribute Identification"	""
 "Attribute Table"	""
 "Attribute Values"	""
+"Attribute field number to copy is out of range!"	""
+"Attribute field number to grid is out of range!"	""
+"Attribute fields one to three (x;y;z) are mandatory!"	""
 "Attribute is Column ..."	""
 "Attribute to process."	""
 "Attribute used for naming the output file(s)"	""
@@ -480,11 +509,15 @@ TEXT	TRANSLATION
 "Attributes to add. Select none to add all"	""
 "Attributes to import besides x,y,z ..."	""
 "August"	""
+"Ausgabedaten"	""
+"Ausgangsgestein Layer"	""
+"Ausgangsrasterzelle Flusseinzugsgebiet [Default: Elbe5000]"	""
+"Auswahl der Art der anteiligen Flaechenwasserwasserentnahme."	""
+"Auswahl der Art der dynamischen Flaechenwasserwassernutzung (WUse). ACHTUNG: Funktioniert ggf. nur bei bereits initiierten Systemen bzw. nach Vorlauf"	""
 "Author"	""
 "Automated Cloud Cover Assessment"	""
 "Automatic"	""
 "Automatically adjust control points to grid's data range"	""
-"Automatically fits the grid to the shapes layers extent."	""
 "Automatically normalise attributes by standard deviation before clustering."	""
 "Automatically normalise grids by standard deviation before clustering."	""
 "Available Choices"	""
@@ -498,7 +531,7 @@ TEXT	TRANSLATION
 "Average"	""
 "Average 2 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 1)."	""
 "Average 3 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 2)."	""
-"Average Temperature"	""
+"Average Size"	""
 "Average With Mask 1"	""
 "Average With Mask 1 calculates average for cells specified by a mask grid. Cell excluded by the mask grid are NOT used in the average calculation."	""
 "Average With Mask 2"	""
@@ -507,6 +540,8 @@ TEXT	TRANSLATION
 "Average With Thereshold 2"	""
 "Average With Thereshold 3"	""
 "Average With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. It's useful to remove noise whit a known maximum reducing the loss of informations"	""
+"Average slope of watercourse: %.2f m/m"	""
+"Average velocity in watercourse: %.2f m/min"	""
 "Averages"	""
 "Avg. Curve Number"	""
 "Avg. Manning's N"	""
@@ -536,12 +571,14 @@ TEXT	TRANSLATION
 "BSL from File"	""
 "Back Slope"	""
 "Background Color"	""
+"Background Sample Density [Percent]"	""
 "Backpropagation algorithm"	""
 "Backpropagation parameters"	""
 "Backward"	""
 "Backward Diagonal"	""
 "Backward [Page Down]"	""
 "Backward diagonal hatch"	""
+"Bagnold"	""
 "Band"	""
 "Band 1"	""
 "Band 2"	""
@@ -553,7 +590,6 @@ TEXT	TRANSLATION
 "Band 7"	""
 "Band 8"	""
 "Bands"	""
-"Bandwidth"	""
 "Bandwidth (Cells)"	""
 "Bare Earth"	""
 "Bars"	""
@@ -564,9 +600,12 @@ TEXT	TRANSLATION
 "Basic measures for spatial point patterns."	""
 "Basin Type (Gravelius)"	""
 "Basins"	""
+"Bed_shear_stress"	""
 "Beep when finished"	""
 "Begin Transaction"	""
+"Begin with Year..."	""
 "Below this threshold precipitation will fall as snow"	""
+"Beruecksichtigung der Hauptgerinnerasterzellen?"	""
 "Beta"	""
 "Bicubic Spline"	""
 "Bicubic Spline Interpolation"	""
@@ -598,8 +637,10 @@ TEXT	TRANSLATION
 "Borders"	""
 "Bottom"	""
 "Bottom to Top"	""
+"Boundary"	""
 "Boundary Effect"	""
 "Boundary Effect Color"	""
+"Boundery"	""
 "Bounding Box"	""
 "Bounding Box [B]"	""
 "Branches"	""
@@ -636,6 +677,7 @@ TEXT	TRANSLATION
 "CENTER"	""
 "CFAC("	""
 "CFit\n(created by SAGA Wizard)."	""
+"CHELSA"	""
 "CLASS"	""
 "CLASS_ID"	""
 "CLASS_NR"	""
@@ -653,6 +695,7 @@ TEXT	TRANSLATION
 "Calculates the gradient based on the values of each triangle's points.\n\n"	""
 "Calculates weights for distance plus one, avoiding division by zero for zero distances"	""
 "Calculating Catchment Area..."	""
+"Calculating Contributing Area"	""
 "Calculating danger..."	""
 "Calculation"	""
 "Calculation Error"	""
@@ -675,13 +718,10 @@ TEXT	TRANSLATION
 "Case of contiguity"	""
 "Cassini"	""
 "Catchment Area"	""
-"Catchment Area (Flow Tracing)"	""
-"Catchment Area (Mass-Flux Method)"	""
-"Catchment Area (Recursive)"	""
-"Catchment Area (Top-Down)"	""
 "Catchment Area Calculation"	""
 "Catchment area"	""
 "Catchment slope"	""
+"Categorical Features"	""
 "Categorical Grids"	""
 "Categories"	""
 "Cell Balance"	""
@@ -713,6 +753,7 @@ TEXT	TRANSLATION
 "Centroid Y"	""
 "Centroids"	""
 "Centroids for each part"	""
+"Change"	""
 "Change Cell Values"	""
 "Change Color Format"	""
 "Change Data Storage"	""
@@ -725,13 +766,17 @@ TEXT	TRANSLATION
 "Change Time Format"	""
 "Change Vector"	""
 "Change Vector Analysis"	""
+"Change all values within radius."	""
 "Changed"	""
 "Changed Grid"	""
 "Changes"	""
 "Channel"	""
 "Channel Definition Threshold (ha)"	""
 "Channel Density"	""
+"Channel Depth"	""
 "Channel Direction"	""
+"Channel Initiation Threshold"	""
+"Channel Mask"	""
 "Channel Network"	""
 "Channel Network Base Level"	""
 "Channel Network Distance"	""
@@ -743,9 +788,16 @@ TEXT	TRANSLATION
 "Channel Network: Pass 5"	""
 "Channel Network: Pass 6"	""
 "Channel Skeleton"	""
+"Channel Type"	""
 "Channel definition threshold"	""
+"Channel depth constant"	""
+"Channel depth exponent (depth = KDP * AREA^MDP)"	""
 "Channel network, all other cells NoData"	""
 "Channel side slope(m/m)"	""
+"Channel width constant ((s/m)^1/2"	""
+"Channel width constant [(s/m)^0.5]"	""
+"Channel_depth"	""
+"Channel_type"	""
 "Channels"	""
 "Channels (Raster)"	""
 "Channels (Vector)"	""
@@ -761,6 +813,7 @@ TEXT	TRANSLATION
 "Check the fields to export"	""
 "Check this in order to include NoData cells in the calculation."	""
 "Check this in order to include NoData points in the calculation."	""
+"Check this parameter to constrain the query by an attribute range."	""
 "Check this to create a new attribute with the reclassification result. If unchecked, the existing attribute is updated."	""
 "Checked"	""
 "Chessboard"	""
@@ -771,9 +824,6 @@ TEXT	TRANSLATION
 "Choose 'slim' to trace grid node's shadow, 'fat' to trace the whole cell's shadow. The first is slightly faster but might show some artifacts."	""
 "Choose Cut from ..."	""
 "Choose Directory"	""
-"Choose Grid"	""
-"Choose Grid Project"	""
-"Choose Grid System"	""
 "Choose Time Range"	""
 "Choose a flow routing algorithm that shall be used for the overland flow distance calculation:\n- D8\n- MFD"	""
 "Choose a method"	""
@@ -790,6 +840,8 @@ TEXT	TRANSLATION
 "Choose the activation function used by the neronal network."	""
 "Choose the classification constant to use"	""
 "Choose the map type to generate."	""
+"Choose the method how to insert additional points."	""
+"Choose the method to apply."	""
 "Choose the mode of operation"	""
 "Choose the training method used for the neronal network."	""
 "Choose the type of data used in this model."	""
@@ -805,9 +857,8 @@ TEXT	TRANSLATION
 "Class 1"	""
 "Class 2"	""
 "Class Identifier"	""
-"Class Information"	""
+"Class Name"	""
 "Class Selection"	""
-"Class Statistics"	""
 "Classes"	""
 "Classification"	""
 "Classification Constant"	""
@@ -815,11 +866,10 @@ TEXT	TRANSLATION
 "Classification Quality"	""
 "Classification Type"	""
 "Classification tools for grids."	""
-"Classified"	""
 "Classify"	""
 "Claudy 3"	""
 "Clay"	""
-"Clay-Loam"	""
+"Clay Loam"	""
 "Clear"	""
 "Clear Fast Representativeness"	""
 "Clear Generalisation"	""
@@ -828,7 +878,10 @@ TEXT	TRANSLATION
 "Clear Selection"	""
 "Climate"	""
 "Climate Data"	""
+"Climate and Weather Data"	""
+"Climate data regionalisation."	""
 "Climate parameters"	""
+"Climate|Climate Data"	""
 "Climatic Precession"	""
 "Clip Features"	""
 "Clip Grid with Polygon"	""
@@ -856,12 +909,16 @@ TEXT	TRANSLATION
 "Cloud Settings"	""
 "Cluster"	""
 "Cluster Analysis"	""
+"Cluster Analysis (Shapes)"	""
 "Cluster Analysis PC"	""
 "Cluster Analysis for Grids"	""
 "Cluster Analysis for Point Clouds"	""
 "ClusterID"	""
 "Clusters"	""
 "Coefficient of Determination"	""
+"Cold Air Height"	""
+"Cold Air Surface"	""
+"Cold Air Temperature [�C]"	""
 "Cold Cloud"	""
 "Collect values"	""
 "Collpase Options"	""
@@ -887,7 +944,6 @@ TEXT	TRANSLATION
 "Colouring"	""
 "Colours"	""
 "Colours Palette"	""
-"Cols"	""
 "Columns"	""
 "Combination A"	""
 "Combination B"	""
@@ -895,7 +951,9 @@ TEXT	TRANSLATION
 "Combined Minimum Distance / Hillclimbing"	""
 "Combined Shading"	""
 "Comma Separated Values"	""
+"Command Line"	""
 "Command Line Arguments"	""
+"Command Line with Header"	""
 "Commands"	""
 "Comment"	""
 "Commit"	""
@@ -912,7 +970,10 @@ TEXT	TRANSLATION
 "CompuServe Graphics Interchange"	""
 "CompuServe Graphics Interchange (*.gif)"	""
 "Computed flow directions, 0=N, 1=NE, 2=E, ... 7=NW"	""
+"Concentration"	""
+"Concentration Approximation Threshold"	""
 "Concentration time (h)"	""
+"Conceptualization of Spatial Relationships"	""
 "Condition"	""
 "Cone (Down)"	""
 "Cone (Up)"	""
@@ -925,23 +986,29 @@ TEXT	TRANSLATION
 "Connected"	""
 "Connection to database failed"	""
 "Connections"	""
+"Connectivity"	""
 "Connectivity Analysis"	""
 "Connectivity Index (Pff)."	""
+"Connectivity Neighbourhood"	""
 "Connectivity Weighting"	""
 "Connectivity [Percent]"	""
+"Conrad"	""
 "Constant Grid"	""
 "Constant Value"	""
 "Constant Variation Range [Degree]"	""
 "Constant Wind Direction"	""
 "Constant variation range"	""
 "Constrain"	""
+"Constrain Query"	""
 "Constrain model through central window cell"	""
+"Constraining attribute field number is out of range!"	""
 "Constraints"	""
 "Contour"	""
 "Contour Lines"	""
 "Contour Lines from Grid"	""
 "Contour lines equidistance [map units]."	""
 "Contours"	""
+"Contributing Area"	""
 "Control Points"	""
 "Convergence"	""
 "Convergence (FD8)"	""
@@ -966,6 +1033,7 @@ TEXT	TRANSLATION
 "Convert track points"	""
 "Convert way points"	""
 "Converted Grid"	""
+"Converting ..."	""
 "Converts a TIN data set to shapes layers.\n\n"	""
 "Convex Hull"	""
 "Convexity"	""
@@ -987,6 +1055,7 @@ TEXT	TRANSLATION
 "Coordinates of target point outside of DEM!"	""
 "Copied Selection"	""
 "Copy"	""
+"Copy Attributes"	""
 "Copy Legend to Clipboard [Ctrl+L]"	""
 "Copy Legend to Clipboard..."	""
 "Copy Map to Clipboard [Ctrl+C]"	""
@@ -994,6 +1063,8 @@ TEXT	TRANSLATION
 "Copy Selection to New Shapes Layer"	""
 "Copy Settings from other Layer"	""
 "Copy Settings from..."	""
+"Copy attributes from input to output point cloud."	""
+"Copy existing Attributes"	""
 "Copy to Clipboard"	""
 "Copying original data..."	""
 "Copyright (c) 2007 by Thomas Schorr"	""
@@ -1031,6 +1102,7 @@ TEXT	TRANSLATION
 "Count Only Above Base Level"	""
 "Count Only Below Base Level"	""
 "Count Points in Polygons"	""
+"Counter for function calls greater 0"	""
 "Covariance"	""
 "Covariance Surface"	""
 "Covered Distance"	""
@@ -1047,13 +1119,14 @@ TEXT	TRANSLATION
 "Create PDF Docs"	""
 "Create PDF Documents"	""
 "Create Point Grid"	""
+"Create Propabilities"	""
+"Create Reference Data"	""
 "Create Reference Points"	""
 "Create Script Command File"	""
 "Create Single Multipart Polygon"	""
 "Create TIN from shapes"	""
 "Create Tileshape from Virtual Point Cloud"	""
 "Create Tool Description Files"	""
-"Create Variance Grid"	""
 "Create Virtual Point Cloud Dataset"	""
 "Create Web Content"	""
 "Create X/Y Grids"	""
@@ -1068,6 +1141,7 @@ TEXT	TRANSLATION
 "Croke et al. (2005)"	""
 "Croke et al. (2005) !!! not yet implemented !!!"	""
 "Crop Coefficients"	""
+"Crop Statistics"	""
 "Crop to Data"	""
 "Cropped Grids"	""
 "Cross"	""
@@ -1099,6 +1173,7 @@ TEXT	TRANSLATION
 "Cut"	""
 "Cut Shapes Layer"	""
 "Cuts"	""
+"Cutting %s resulted in an empty point cloud, skipping output!"	""
 "Cycles"	""
 "Cylindrical Equal Area"	""
 "D"	""
@@ -1116,6 +1191,7 @@ TEXT	TRANSLATION
 "DEFAULT_BRIGHT"	""
 "DELAY("	""
 "DEM"	""
+"DEM without Sinks"	""
 "DEMON"	""
 "DEMON - Min. DQV"	""
 "DEMON - Minium Drainage Quota Volume (DQV) for traced flow tubes"	""
@@ -1123,10 +1199,12 @@ TEXT	TRANSLATION
 "DIFF_MEAN"	""
 "DN"	""
 "DSN"	""
+"DT Time step size (yrs)"	""
 "DTM 1"	""
 "DTM 2"	""
 "DTM Filter (slope-based)"	""
 "DTM, digital terrain model [m]"	""
+"DTMIN Minimum sub-time"	""
 "DXF"	""
 "DXF Files (*.dxf)|*.dxf|All Files|*.*"	""
 "Daily Data"	""
@@ -1136,6 +1214,7 @@ TEXT	TRANSLATION
 "Dark Object Subtraction"	""
 "Darkness Digital Number (DN)"	""
 "Data"	""
+"Data Directory"	""
 "Data History"	""
 "Data Manager"	""
 "Data Object"	""
@@ -1154,7 +1233,7 @@ TEXT	TRANSLATION
 "Database Connection Error"	""
 "Database Name"	""
 "Database access through the libmysql.lib interface."	""
-"Database with Coordinate Reference System (CRS) definitions. You have to restart SAGA to make changes take affect!"	""
+"Database with Coordinate Reference System (CRS) definitions. A restart of SAGA is required to have the changes take effect!"	""
 "Database|ODBC"	""
 "Database|PostgreSQL"	""
 "Dataset creation failed"	""
@@ -1197,14 +1276,18 @@ TEXT	TRANSLATION
 "Deepen Drainage Routes"	""
 "Default"	""
 "Default Filter Matrix (3x3)"	""
+"Default Reference Height"	""
 "Default Rotation"	""
 "Default Size"	""
+"Default Weathering Formula"	""
 "Defaults"	""
 "Defaults for New Maps"	""
 "Define AOI by ..."	""
 "Define Georeference for Grids"	""
 "Definition"	""
 "Degree"	""
+"Dekang Lin"	""
+"Delay"	""
 "Delete"	""
 "Delete All Positions"	""
 "Delete All Positions [Ctrl + X]"	""
@@ -1223,6 +1306,8 @@ TEXT	TRANSLATION
 "Delete selected shape(s)."	""
 "Deleting table"	""
 "Delineated watershed basins"	""
+"Delivery Index"	""
+"Dem"	""
 "Denoised"	""
 "Denoised Grid"	""
 "Denormalisation"	""
@@ -1239,6 +1324,9 @@ TEXT	TRANSLATION
 "Depression-free digital elevation model"	""
 "Depth"	""
 "Depth to which data history is stored. Set -1 keeps all history entries (default), 0 switches history option off."	""
+"Depth_base_rock"	""
+"Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 1 manipuliert werden. "	""
+"Der Gerinne- bzw. Hauptgerinneabfluss kann mit dieser Methode fuer Rasterzelle 2 manipuliert werden. "	""
 "Derivation of slope lengths from catchment areas. These are rough approximations! Applies not to Desmet & Govers' method."	""
 "Derive contour lines."	""
 "Description"	""
@@ -1267,8 +1355,8 @@ TEXT	TRANSLATION
 "Diameter plant elements"	""
 "Dictionary Files (*.dic)"	""
 "Dictionary Files (*.lng)"	""
-"Dictionary for Proj.4/OGC WKT translations. You have to restart SAGA to make changes take affect!"	""
-"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply changes."	""
+"Dictionary for Proj.4/OGC WKT translations. A restart of SAGA is required to have the changes take effect!"	""
+"Dictionary for translations from built-in (English) to local language (editable text table). You need to restart SAGA to apply the changes."	""
 "Difference"	""
 "Difference (A - B)"	""
 "Difference Input - Reconstruction"	""
@@ -1280,6 +1368,15 @@ TEXT	TRANSLATION
 "Difference to left neighbour (using a while loop)"	""
 "Difference to local gradient."	""
 "Diffuse Insolation"	""
+"Diffuse Pollution Risk"	""
+"Diffusive Hillslope Evolution (ADI)"	""
+"Diffusive Hillslope Evolution (FTCS)"	""
+"Diffusivity [m2 / kyr]"	""
+"Diffusivity coefficient Kd (m^2/yr"	""
+"Diffusivity coefficient Kd (m^2/yr)"	""
+"Diffusivity coefficient Kd [m^2/a]"	""
+"Difuse Pollution Risk"	""
+"Digital Elevation Model"	""
 "Digital Elevation Model that has to be processed"	""
 "Digital Terrain Model"	""
 "Digital elevation model"	""
@@ -1308,7 +1405,10 @@ TEXT	TRANSLATION
 "Directional Statistics for Points"	""
 "Directional Statistics for Single Grid"	""
 "Directory"	""
+"Directory with NCAR Grib Files"	""
 "Directory, where temporary cache files shall be saved."	""
+"Discharge exponent Mb for bedrock channel erosion"	""
+"Discharge exponent Mf for fluvial sediment transport"	""
 "Disconnect All"	""
 "Disconnect from ODBC Source"	""
 "Disconnect from PostgreSQL"	""
@@ -1319,6 +1419,9 @@ TEXT	TRANSLATION
 "Displacement Vector"	""
 "Displacement vectors between correlated points"	""
 "Display"	""
+"Display Maximun"	""
+"Display Minimum"	""
+"Display Minimun"	""
 "Display Resolution"	""
 "Display Type"	""
 "Dissolve Buffers"	""
@@ -1338,11 +1441,16 @@ TEXT	TRANSLATION
 "Distance Weighting"	""
 "Distance Weighting Exponent"	""
 "Distance between points (grid units)."	""
+"Distance to the Channel"	""
+"Distance to the Crest"	""
 "Distances"	""
 "Distinct"	""
 "Diurnal Anisotropic Heating"	""
 "Divergence"	""
+"Divergent Flow Accumulation / Object Update"	""
+"Divergent Upslope Curvature"	""
 "Diversity"	""
+"Diversity of Categories"	""
 "Dividend"	""
 "Division"	""
 "Division Height"	""
@@ -1364,13 +1472,17 @@ TEXT	TRANSLATION
 "Down"	""
 "Down [+]"	""
 "Down [End]"	""
-"Down-Scaling"	""
 "Downhill flow is bound to preferred routing cells, where these are not no-data. Helps to model e.g. small ditches, that are not well represented in the elevation data."	""
+"Downscaling Method"	""
 "Downslope Area"	""
 "Downslope Basins"	""
+"Downslope Curvature"	""
 "Downslope Distance Gradient"	""
+"Downstream weighting factor (between zero and ~1/2)"	""
+"Drainage Area"	""
 "Drainage Basins"	""
 "Drainage Network"	""
+"Drainage_area"	""
 "Drape Map"	""
 "Draw Box"	""
 "Draw Faces"	""
@@ -1388,10 +1500,14 @@ TEXT	TRANSLATION
 "Duration of Insolation"	""
 "Dust [ppm]"	""
 "Dust factor: 100 ppm (standard)"	""
+"Dynamics"	""
+"Dynamische Flaechenwassernutzung und Abflussreduktion"	""
+"Dynamische Flaechenwassernutzung..."	""
 "EDGES"	""
 "EHD, Effective hydrological depth of the soil [m]"	""
 "ENUM_ID"	""
 "EPSG Code"	""
+"EPSG code error"	""
 "ERDAS files other than version 7.4 are not supported."	""
 "ESRI Arc/Info ASCII Grids (*.asc)"	""
 "ESRI Arc/Info Binary Grids (*.flt)"	""
@@ -1413,6 +1529,8 @@ TEXT	TRANSLATION
 "Edge"	""
 "Edge Contamination"	""
 "Edge Detection (ViGrA)"	""
+"Edge Points"	""
+"Edge Segments"	""
 "Edge threshold for nonlinear smoothing"	""
 "Edges"	""
 "Edit"	""
@@ -1422,18 +1540,25 @@ TEXT	TRANSLATION
 "Edit Selected Shape"	""
 "Edit Shapes"	""
 "Efective friction = stated friction ^f , where f = cos(DifAngle)^k."	""
+"Eff. Precipitation Rate"	""
 "Effective Air Flow Heights"	""
 "Effective Flow Length"	""
 "Effective Rainfall"	""
 "Effective hydrological depth"	""
+"Effective precipitation rate (m/yr, or m/s for MPM)"	""
+"Effective precipitation rate, [m/a] or [m/s] for MPM"	""
 "Eigen Vectors"	""
 "Eigen reduction failed"	""
 "Eigenvalue"	""
 "Eigenvectors"	""
+"Eingangsdaten"	""
+"Einheit in der die WUse Daten vorliegen"	""
+"Einlesen der NCache Textdatei"	""
 "Element Shape"	""
 "Elements"	""
 "Elevation"	""
 "Elevation Averaging"	""
+"Elevation Difference"	""
 "Elevation Grid"	""
 "Elevation Range"	""
 "Elevation Threshold"	""
@@ -1441,12 +1566,16 @@ TEXT	TRANSLATION
 "Elevation at Reference Station [m]"	""
 "Elevation grid"	""
 "Elevation range (zMax (%.2f) - zMin (%.2f)) is equal or lower than zero!"	""
+"Elevations"	""
 "Ellipsoid Definition"	""
 "Ellipsoid Height [m]"	""
 "Ellipsoids"	""
 "Encountered invalid path description in *.spcvf file!"	""
+"Encountered invalid path description in *.spcvf_tile_info file!"	""
 "End Latitude"	""
 "End Longitude"	""
+"End Time"	""
+"End with Year..."	""
 "Enforce True Color"	""
 "Enhanced Vegetation Index"	""
 "Entropy"	""
@@ -1469,7 +1598,9 @@ TEXT	TRANSLATION
 "Error in Trend Calculation"	""
 "Error in formula"	""
 "Error parsing attribute fields: can't convert to number"	""
+"Error parsing attribute fields: can't convert to number!"	""
 "Error parsing attribute fields: field index out of range"	""
+"Error parsing attribute fields: field index out of range!"	""
 "Error parsing field type: can't convert to number"	""
 "Error: Continue anyway ?"	""
 "Errors"	""
@@ -1480,12 +1611,20 @@ TEXT	TRANSLATION
 "Estimated noise relative to mean standard deviation"	""
 "Et/Eo, ratio of actual to potential evapotranspiration"	""
 "Euclidean"	""
+"Euclidian Distance"	""
+"EvP1 Name"	""
+"EvP2 Name"	""
+"EvP3 Name"	""
+"Evaluierungspunkt 1 [Default: Elbe5000]"	""
+"Evaluierungspunkt 2 [Default: Elbe5000]"	""
+"Evaluierungspunkt 3 [Default: Elbe5000]"	""
 "Evapotranspiration"	""
 "Evapotranspiration [m / dt]"	""
 "Exact"	""
 "Exaggeration"	""
 "Exaggeration Factor"	""
 "Exaggeration Z"	""
+"Excess shear stress exponent"	""
 "Exclude No-Data Area"	""
 "Exclude NoData Cells"	""
 "Execute"	""
@@ -1502,8 +1641,6 @@ TEXT	TRANSLATION
 "Expansion Degree"	""
 "Exponent"	""
 "Exponent for distance weighting (0.0-4.0)"	""
-"Exponential Model"	""
-"Exponential Regression"	""
 "Export Atlas Boundary File"	""
 "Export ESRI Arc/Info Grid"	""
 "Export GPX"	""
@@ -1568,20 +1705,24 @@ TEXT	TRANSLATION
 "Feigenbaum's Bifurcation"	""
 "Ferhat Bing�l (c) 2009"	""
 "Field"	""
+"Field %d: Name=\"%s\" "	""
 "Field (ID)"	""
 "Field (Name)"	""
 "Field Capacity [mm]"	""
 "Field Definition"	""
 "Field Description"	""
+"Field Identifier"	""
 "Field Name"	""
 "Field Names"	""
 "Field Naming"	""
 "Field Properties"	""
 "Field Separator"	""
+"Field Statistics"	""
 "Field Type"	""
 "Field Types"	""
 "Field data type"	""
 "Field for Summary"	""
+"Field numbers (starting from 1) of the attributes to copy, separated by semicolon; fields one to three (x;y;z) are mandatory."	""
 "Field with identifier."	""
 "Field with measure information."	""
 "Field with x-coordinate."	""
@@ -1620,7 +1761,9 @@ TEXT	TRANSLATION
 "Fill Color"	""
 "Fill Color 1"	""
 "Fill Color 2"	""
+"Fill Gaps (Mean Value Cellular Automat)"	""
 "Fill Gaps in Records"	""
+"Fill Increment"	""
 "Fill NoData"	""
 "Fill Sinks"	""
 "Fill Sinks (Planchon/Darboux, 2001)"	""
@@ -1658,12 +1801,12 @@ TEXT	TRANSLATION
 "Fire Spreading Analysis"	""
 "First Class"	""
 "First Day"	""
+"First Derivative is singular! Probably the shape containes consecutive identical points.\n\n"	""
 "First input grid"	""
 "Fit"	""
 "Fit Color Palette to Grid Values"	""
 "Fit Column Sizes"	""
 "Fit Diagram to Window"	""
-"Fit Extent"	""
 "Fit Map Scale"	""
 "Fit N Points to shape"	""
 "Fit Row Sizes"	""
@@ -1678,8 +1821,10 @@ TEXT	TRANSLATION
 "Fixed angle"	""
 "Fixed value to be replaced"	""
 "Fixed|Cell value|"	""
+"Flaechenverbrauch-Auswahl (FvA)"	""
 "Flame Length"	""
 "Flame Length (m)"	""
+"Flat Area Threshold"	""
 "Flat Area Values"	""
 "Flat Areas"	""
 "Flat Detection"	""
@@ -1691,10 +1836,22 @@ TEXT	TRANSLATION
 "Floating Point (4 byte)"	""
 "Floating Point (8 byte)"	""
 "Floating point"	""
+"Flood Depth"	""
+"Flood Height"	""
+"Flooded"	""
+"Flooded Surface"	""
 "Flooded digital elevation model"	""
+"Flooding Status"	""
+"Flooding_status"	""
+"Flow"	""
 "Flow Accumulation"	""
+"Flow Accumulation (Flow Tracing)"	""
+"Flow Accumulation (Mass-Flux Method)"	""
 "Flow Accumulation (Parallel)"	""
+"Flow Accumulation (Recursive)"	""
+"Flow Accumulation (Top-Down)"	""
 "Flow Accumulation (Trace)"	""
+"Flow Accumulation Unit"	""
 "Flow Algorithm"	""
 "Flow Connectivity"	""
 "Flow Correction"	""
@@ -1703,6 +1860,7 @@ TEXT	TRANSLATION
 "Flow Depth Grid (m)"	""
 "Flow Direction"	""
 "Flow Direction (up and down)"	""
+"Flow Direction Algorithm"	""
 "Flow Directions"	""
 "Flow Distance"	""
 "Flow Distances"	""
@@ -1719,6 +1877,8 @@ TEXT	TRANSLATION
 "Flow Width and Specific Catchment Area"	""
 "Flow at Gauges"	""
 "Flow threshold, given as amount of cells, above which flow transport is unlimited. Ignored if range equals zero."	""
+"Fluvial Transport"	""
+"Fluvial sediment transport coefficient Kf"	""
 "Flux"	""
 "Flux out of each cell, i.e. everything accumulated so far."	""
 "Flying Height"	""
@@ -1760,9 +1920,11 @@ TEXT	TRANSLATION
 "Frame Width"	""
 "Frame Width [Pixels]"	""
 "Frequency"	""
+"From"	""
 "Fuel Model"	""
 "Full path to the directory for the output grids of each model step"	""
 "Function"	""
+"Function Calls > 0"	""
 "Function Fit"	""
 "Function Fitting Range"	""
 "Function Parameters"	""
@@ -1792,6 +1954,7 @@ TEXT	TRANSLATION
 "GPX file"	""
 "GPX files (*.gpx)|*.gpx|All Files|*.*"	""
 "GPX to shapefile"	""
+"GRAD * MFD"	""
 "GREEN_BLUE"	""
 "GREEN_GREY_BLUE"	""
 "GREEN_RED_BLUE"	""
@@ -1817,6 +1980,7 @@ TEXT	TRANSLATION
 "Games"	""
 "Gamma"	""
 "Garden"	""
+"Garden|Dynamics"	""
 "Garden|Introducing Module Programming"	""
 "Garden|Recreations|Fractals"	""
 "Garden|Recreations|Games"	""
@@ -1824,11 +1988,12 @@ TEXT	TRANSLATION
 "Gauges"	""
 "Gaussian"	""
 "Gaussian Filter"	""
+"Gaussian Filtering"	""
 "Gaussian Landscape"	""
 "Gaussian Landscapes"	""
-"Gaussian Model"	""
 "Gaussian and Exponential Weighting Bandwidth"	""
 "Gc"	""
+"Geary's C"	""
 "General"	""
 "General Curvature"	""
 "General Settings"	""
@@ -1836,8 +2001,10 @@ TEXT	TRANSLATION
 "Generalized Surface"	""
 "Generate Shapes"	""
 "Generated Shapefile."	""
+"Generic"	""
 "Geo-Reference"	""
 "GeoTIFF (*.tif)"	""
+"GeoTIFF Files"	""
 "GeoTRANS"	""
 "GeoTRANS engine initializing error!\n\nPlease check your data path settings!"	""
 "GeoTrans (Grid)"	""
@@ -1849,13 +2016,15 @@ TEXT	TRANSLATION
 "Geographic Coordinate System"	""
 "Geographic Coordinate Systems"	""
 "Geographic Coordinates"	""
+"Geographic Distances"	""
+"Geographic Distances (Pair of Coordinates)"	""
 "Geoid"	""
 "Geometric Figures"	""
 "Geometry Type"	""
+"Geopotential Height"	""
 "Geoprocessing"	""
 "Georeferencing"	""
 "Get CRS Definition from..."	""
-"Get Class Statistics from..."	""
 "Get Extent for ..."	""
 "Get Grid from Virtual Point Cloud"	""
 "Get Heights from ..."	""
@@ -1863,12 +2032,15 @@ TEXT	TRANSLATION
 "Get Shapes Extents"	""
 "Get Subset from Virtual Point Cloud"	""
 "Get table from MySQL server.\n"	""
-"Gianluca Massei (c) 2007 (g_massa at libero.it)"	""
 "Global Irradiation"	""
 "Global Moran's I for Grids"	""
 "Globe Viewer for Grids"	""
 "Gnomonic"	""
 "Gpx2shp path"	""
+"GraD"	""
+"Grad"	""
+"Grad Norm"	""
+"Grad_Poss"	""
 "Gradient"	""
 "Gradient Calculation"	""
 "Gradient Difference"	""
@@ -1879,15 +2051,18 @@ TEXT	TRANSLATION
 "Gradient Vectors from Directional Components"	""
 "Gradient Vectors from Surface"	""
 "Gradient threshold"	""
+"Gradient_Tangs"	""
 "Graduated"	""
 "Graduated Colors"	""
 "Graduated Colours"	""
 "Graticule"	""
+"Great Elliptic"	""
 "Greater than"	""
 "Green"	""
 "Green (TM 3)"	""
 "Green-Ampt Infiltration"	""
 "Greenness"	""
+"Grib Files (*.grb)"	""
 "Grid"	""
 "Grid 1"	""
 "Grid 2"	""
@@ -1897,16 +2072,18 @@ TEXT	TRANSLATION
 "Grid Difference"	""
 "Grid Division"	""
 "Grid Interpolation"	""
+"Grid List"	""
 "Grid Manager"	""
 "Grid Masking"	""
 "Grid Normalisation"	""
 "Grid Orientation"	""
 "Grid Project"	""
 "Grid Proximity Buffer"	""
-"Grid Size"	""
 "Grid Skeletonization"	""
 "Grid Spacing (Map Units)"	""
 "Grid Standardisation"	""
+"Grid Statistics"	""
+"Grid Statistics for Points"	""
 "Grid Statistics for Polygons"	""
 "Grid System"	""
 "Grid System Extent"	""
@@ -1939,6 +2116,8 @@ TEXT	TRANSLATION
 "Grid to filter"	""
 "Grid to reclassify"	""
 "Grid value equals low value"	""
+"Grid with Gaps"	""
+"Grid with Gaps Filled"	""
 "Grid with category of nearest source cell [Category]"	""
 "Grid with euclidian distance to nearest source cell [grid units]"	""
 "Grid with features to be buffered [Category/NoData]"	""
@@ -1970,9 +2149,12 @@ TEXT	TRANSLATION
 "Gz"	""
 "HTML"	""
 "Hafer"	""
+"Half the size of the moving window [vertex count], controls smoothing sensitivity."	""
 "Halo Width"	""
 "Has Field Names"	""
+"Hauptgerinne-Parameter (erweitertes HD-Modell)"	""
 "Having"	""
+"Headline"	""
 "Heads"	""
 "Height"	""
 "Height (Cells)"	""
@@ -2001,6 +2183,7 @@ TEXT	TRANSLATION
 "Hill Radius"	""
 "Hill-Climbing (Rubin 1967)"	""
 "Hillslope Index"	""
+"Hillslope_reservoir"	""
 "Histogram"	""
 "Histogram Stretch"	""
 "Histogram Stretch Dialog"	""
@@ -2011,6 +2194,8 @@ TEXT	TRANSLATION
 "Histogram cloud signature:"	""
 "History"	""
 "History Depth"	""
+"Hodge-Podge"	""
+"Hodge-Podge Machine"	""
 "Hollow"	""
 "Homepage"	""
 "Homogenous"	""
@@ -2020,6 +2205,7 @@ TEXT	TRANSLATION
 "Horizontal Offset"	""
 "Horizontal Overland Flow Distance"	""
 "Horizontal Range"	""
+"Horizontal Tracer Density"	""
 "Horizontal hatch"	""
 "Horizontally mirrored"	""
 "Host"	""
@@ -2034,6 +2220,10 @@ TEXT	TRANSLATION
 "Humedad del combustible muerto en 100-horas"	""
 "Humification Factor"	""
 "Humus to Charcoal"	""
+"Hydro CA"	""
+"Hydro CA 2"	""
+"Hydro CA 3"	""
+"Hydro CA 4"	""
 "Hydrology"	""
 "Hydrology: IHACRES"	""
 "Hypsometric Curve"	""
@@ -2067,6 +2257,7 @@ TEXT	TRANSLATION
 "Ice"	""
 "Identifier"	""
 "Identity"	""
+"If Table exists..."	""
 "If checked the snow module is active"	""
 "If checked, it means there is no external inflow to the subbasin"	""
 "If checked, snow-melt module is used."	""
@@ -2094,6 +2285,8 @@ TEXT	TRANSLATION
 "Image Files"	""
 "Image Grid"	""
 "Image Import/Export."	""
+"Image Properties"	""
+"Image Resolution"	""
 "Image Rotation [Degree]"	""
 "Image acquisition date (yyyy-mm-dd)"	""
 "Image creation date (yyyy-mm-dd)"	""
@@ -2120,9 +2313,12 @@ TEXT	TRANSLATION
 "Import Filter"	""
 "Import GPX"	""
 "Import GRIB2 record"	""
+"Import GSOD Stations to Data Base"	""
+"Import GSOD to Data Base"	""
 "Import GStat Shapes"	""
 "Import Grid from Table"	""
 "Import Grid from XYZ"	""
+"Import Grids from KML"	""
 "Import Image (bmp, jpg, png, tif, gif, pnm, xpm)"	""
 "Import LAS Files"	""
 "Import MOLA Grid (MEGDR)"	""
@@ -2152,6 +2348,7 @@ TEXT	TRANSLATION
 "Import and export filter for ESRI's E00 file exchange format."	""
 "Import from File"	""
 "Import from Open Street Map"	""
+"Import, Clip and Resample Grids"	""
 "Import/Export"	""
 "Importing"	""
 "Importing data ..."	""
@@ -2174,10 +2371,10 @@ TEXT	TRANSLATION
 "Increase factor n_plus. Must be > 1."	""
 "Independent Variable (per Grid and Cell)"	""
 "Independent Variable (per Grid)"	""
-"Independent Variables"	""
 "Index"	""
 "Indicatrix"	""
 "Indices"	""
+"Infection Speed"	""
 "Infiltration excess runoff [m/dt]"	""
 "Infiltration rate [m/dt]"	""
 "Informe"	""
@@ -2189,23 +2386,29 @@ TEXT	TRANSLATION
 "Initial Number of Fishes [%]"	""
 "Initial Number of Sharks [%]"	""
 "Initial State"	""
+"Initial Surface"	""
 "Initial Threshold for Slope"	""
 "Initial root zone storage deficit [m]"	""
+"Initial sediment cover (m)"	""
+"Initial sediment cover thickness (m)"	""
 "Initial subsurface flow per unit area [m/h]"	""
 "Initial update value"	""
 "Initial value delta_0 of update-values delta_ij."	""
 "Initialisation"	""
 "Initialization Value"	""
+"Initialize"	""
 "Initializing ..."	""
 "Initializing Fields"	""
 "Initializing direction matrix..."	""
 "Initiation Grid"	""
 "Initiation Threshold"	""
 "Initiation Type"	""
+"Inlet Concentration"	""
 "Inner Buffer"	""
 "Input"	""
 "Input Binary Grid"	""
 "Input Features"	""
+"Input File List"	""
 "Input File's NoData Value"	""
 "Input Files"	""
 "Input Format"	""
@@ -2217,6 +2420,7 @@ TEXT	TRANSLATION
 "Input data for the trained network."	""
 "Input data to train the network."	""
 "Input file"	""
+"Input file list could not be opened!"	""
 "Input for Mean over Catchment Calculation"	""
 "Input for module calculations."	""
 "Input for the morphological reconstruction"	""
@@ -2230,10 +2434,11 @@ TEXT	TRANSLATION
 "Input table or shapefile"	""
 "Insert"	""
 "Insert Additional Points"	""
-"Insert Distance"	""
 "Insert Method"	""
 "Insert Position"	""
 "Insert Record"	""
+"Insertion"	""
+"Insertion Distance"	""
 "Integer"	""
 "Integer (1 byte)"	""
 "Integer (2 byte)"	""
@@ -2257,6 +2462,7 @@ TEXT	TRANSLATION
 "Interpolated Colors"	""
 "Interpolation"	""
 "Interpolation Method"	""
+"Interpolation Scale"	""
 "Interpolation Steps"	""
 "Intersect"	""
 "Intersection"	""
@@ -2296,6 +2502,10 @@ TEXT	TRANSLATION
 "JPEG - JFIF Compliant"	""
 "JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)"	""
 "JPG Files"	""
+"Ja, Abfluss manuell vorgeben: res. Abfluss = Speicherinhalt * q + a"	""
+"Ja, TestRoutine1 fuer Flusseinzugsgebiet bis zu der HG-Rasterzelle"	""
+"Ja, TestRoutine1 nur fuer Teileinzugsgbiet der HG-Rasterzelle"	""
+"Ja, berechneten Abfluss veraendern: res. Abfluss = berechn. Abfluss * q + a"	""
 "Jakeman & Hornberger (1993)"	""
 "January"	""
 "Johan Van de Wauw (c) 2009"	""
@@ -2317,7 +2527,10 @@ TEXT	TRANSLATION
 "K2"	""
 "K3"	""
 "KE"	""
+"KF Fluvial sediment transport coefficien"	""
 "KML files (*.kml)"	""
+"KML/KMZ File"	""
+"KML/KMZ Files"	""
 "Kappa"	""
 "Kappa Offset [degree]"	""
 "Kappa [degree]"	""
@@ -2331,9 +2544,11 @@ TEXT	TRANSLATION
 "Kernel"	""
 "Kernel Density"	""
 "Kernel Density Estimation"	""
+"Kernel Size"	""
 "Kernel Type"	""
 "Kind of initializing Precipitation Event"	""
 "Kinematic Routing Algorithm"	""
+"Known Crops"	""
 "Known X"	""
 "Known Y"	""
 "Kriging"	""
@@ -2345,6 +2560,7 @@ TEXT	TRANSLATION
 "LAS Info"	""
 "LAS header exception: %s"	""
 "LAS reader exception: %s"	""
+"LEM 2013-02-21"	""
 "LFAC("	""
 "LP, Saturated lateral permeability of the soil [m/day]"	""
 "LS"	""
@@ -2363,10 +2579,13 @@ TEXT	TRANSLATION
 "Lake Flood"	""
 "Lambert Conformal Conic (1 parallel)"	""
 "Lambert Conformal Conic (2 parallel)"	""
+"Land Cover Weights"	""
 "Land Surface Temperature"	""
 "Land Surface Temperature [Deg.Celsius]"	""
 "Land Use"	""
 "Land Use ID"	""
+"Land Use Scenario"	""
+"Land Use Scenario Generator"	""
 "Landform"	""
 "Landforms"	""
 "Landsat"	""
@@ -2386,10 +2605,15 @@ TEXT	TRANSLATION
 "Landsat-5 TM"	""
 "Landsat-7 ETM+"	""
 "Landsat-8 OLI/TIRS"	""
+"Landscape Evolution"	""
+"Landscape Evolution Model"	""
+"Landscape Evolution Modelling"	""
 "Language Translations"	""
 "Laplace Filter"	""
 "Laplacian Filter"	""
+"Laplacian Filter Kernel"	""
 "Last Day"	""
+"Last RingeLEM"	""
 "Lat"	""
 "Lat. of True Scale"	""
 "Latitude"	""
@@ -2436,16 +2660,17 @@ TEXT	TRANSLATION
 "Legend: Save"	""
 "Legend: Zoom"	""
 "Length"	""
+"Length of the Gaussian window:\t %d"	""
 "Less than"	""
-"Let pixel stay unclassified, if maximum likelihood probability is less than threshold."	""
-"Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."	""
+"Let pixel stay unclassified, if maximum likelihood probability value is less than threshold."	""
+"Let pixel stay unclassified, if minimum euclidian or mahalanobis distance is greater than threshold."	""
 "Let pixel stay unclassified, if spectral angle distance is greater than threshold."	""
 "Level"	""
 "Level Aggregation"	""
 "Level Heights"	""
 "Level of Detail"	""
 "Level of Generalisation"	""
-"Level of significance for automated predictor selection, given as percentage"	""
+"Levels"	""
 "Library"	""
 "Life"	""
 "Life Cycle"	""
@@ -2466,6 +2691,7 @@ TEXT	TRANSLATION
 "Line Properties"	""
 "Line Simplification"	""
 "Line Size"	""
+"Line Smoothing"	""
 "Line Style"	""
 "Line Transect(s)"	""
 "Line or polygon shapefile to simplify."	""
@@ -2477,7 +2703,6 @@ TEXT	TRANSLATION
 "Linear Flow Threshold"	""
 "Linear Flow Threshold Grid"	""
 "Linear Module"	""
-"Linear Regression"	""
 "Linear: a + b * x"	""
 "Lines"	""
 "Lines (extended)"	""
@@ -2492,6 +2717,8 @@ TEXT	TRANSLATION
 "List of Measured Points as PC"	""
 "List of Shapes Layers"	""
 "Listing"	""
+"Lithology"	""
+"Lithology_of_uppermost_rock_layer"	""
 "Litter to Humus"	""
 "Litterfall Rate [g/m\xb2/a]"	""
 "Little Endian (Intel)"	""
@@ -2503,11 +2730,13 @@ TEXT	TRANSLATION
 "Load Project"	""
 "Load Settings"	""
 "Load Shapes"	""
+"Load Statistics from File..."	""
 "Load TIN"	""
 "Load Table"	""
 "Load Text"	""
 "Load Tool Library"	""
 "Load all bands"	""
+"Load from File..."	""
 "Load grid"	""
 "Load library"	""
 "Load point cloud"	""
@@ -2516,6 +2745,7 @@ TEXT	TRANSLATION
 "Load shapefile after conversion"	""
 "Load shapes"	""
 "Load table"	""
+"Load to Memory"	""
 "Load tool chain"	""
 "Loaded Grid"	""
 "Loaded Shapes"	""
@@ -2523,19 +2753,27 @@ TEXT	TRANSLATION
 "Loam"	""
 "Loamy Sand"	""
 "Local Cartesian"	""
+"Local Correlation"	""
+"Local Curvature"	""
+"Local Downslope Curvature"	""
+"Local Geary's C"	""
 "Local Maxima"	""
 "Local Minima"	""
 "Local Minima and Maxima"	""
+"Local Moran's I"	""
 "Local Ridges"	""
 "Local Ridges, Hills in Valleys"	""
 "Local Rotation Base Level"	""
 "Local Rotation [Degree]"	""
 "Local Sky View Factor"	""
+"Local Spatial Autocorrelation"	""
 "Local Time (user defined reference)"	""
+"Local Upslope Curvature"	""
 "Local time relates to grid's..."	""
 "Locate STRM30 Data File"	""
 "Locate..."	""
 "Location"	""
+"Locational Risk"	""
 "Locations"	""
 "Logarithmic (down)"	""
 "Logarithmic (up)"	""
@@ -2548,6 +2786,7 @@ TEXT	TRANSLATION
 "Long Dashed"	""
 "Long dashed style"	""
 "Long text"	""
+"Longest watercourse length: %.2f m"	""
 "Longitude"	""
 "Longitude 1"	""
 "Longitude 2"	""
@@ -2581,6 +2820,8 @@ TEXT	TRANSLATION
 "Lower Border (Y)"	""
 "Lower Tolerance"	""
 "Lower left corner"	""
+"Loxodrome"	""
+"Loxodromes"	""
 "Lumped Atmospheric Transmittance"	""
 "Lumped Atmospheric Transmittance [Percent]"	""
 "Luv Factor"	""
@@ -2590,6 +2831,7 @@ TEXT	TRANSLATION
 "MDE"	""
 "MEAN"	""
 "MFD"	""
+"MFD * Gradient"	""
 "MIN"	""
 "MINIMUM"	""
 "MLRA Coefficients"	""
@@ -2598,6 +2840,7 @@ TEXT	TRANSLATION
 "MMF-SAGA Soil Erosion Model"	""
 "MOLA Grids (*.img)|*.img|All Files|*.*"	""
 "MORAN_I"	""
+"MPM"	""
 "MRRTF"	""
 "MRVBF"	""
 "MS Windows Bitmap (*.bmp)|*.bmp|All Files|*.*"	""
@@ -2618,6 +2861,8 @@ TEXT	TRANSLATION
 "Mandelbrot"	""
 "Mandelbrot Set"	""
 "Manhattan"	""
+"Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 1"	""
+"Manipulation des Gerinne- bzw. Hauptgerinneabflusses: Rasterzelle 2"	""
 "Manning's N"	""
 "Manning's Roughness"	""
 "Manning-Strickler Coefficient"	""
@@ -2634,6 +2879,7 @@ TEXT	TRANSLATION
 "Map Selection"	""
 "Map Units"	""
 "Map Width [Pixels]"	""
+"Map Window Arrangement"	""
 "Map/Table Size Ratio [%]"	""
 "Maps"	""
 "March"	""
@@ -2662,7 +2908,9 @@ TEXT	TRANSLATION
 "Maximal Number of Points"	""
 "Maximimum Number of Samples"	""
 "Maximum"	""
+"Maximum Angle"	""
 "Maximum Cells (C Correction Analysis)"	""
+"Maximum Change"	""
 "Maximum Contour Value"	""
 "Maximum Curvature"	""
 "Maximum Deviation between estimated excess rainfall and observed streamflow volumes"	""
@@ -2670,6 +2918,9 @@ TEXT	TRANSLATION
 "Maximum Disparity"	""
 "Maximum Distance"	""
 "Maximum Distance [Cells]"	""
+"Maximum Entropy"	""
+"Maximum Entropy Classifcation"	""
+"Maximum Entropy Presence Prediction"	""
 "Maximum Flow Distance"	""
 "Maximum Height"	""
 "Maximum Iterations"	""
@@ -2683,17 +2934,19 @@ TEXT	TRANSLATION
 "Maximum Search Distance"	""
 "Maximum Search Radius"	""
 "Maximum Search Radius (cells)"	""
-"Maximum Search Radius (map units)"	""
 "Maximum Selection"	""
 "Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"	""
 "Maximum Temperature"	""
+"Maximum Thickness"	""
 "Maximum Time Span (Seconds)"	""
 "Maximum Total Order"	""
 "Maximum Value"	""
 "Maximum X Order"	""
 "Maximum Y Order"	""
+"Maximum angular difference as degree between adjacent segment points."	""
 "Maximum deviation allowed between original and simplified curve [map units]."	""
 "Maximum distance parameter is ignored if set to zero (default)."	""
+"Maximum entropy based classification and prediction."	""
 "Maximum number of classes in entire grid."	""
 "Maximum number of classes in the entire grid."	""
 "Maximum number of grid cells used for trend analysis as required by C correction."	""
@@ -2715,8 +2968,10 @@ TEXT	TRANSLATION
 "Mean Flow Distance"	""
 "Mean Solar Irradiance"	""
 "Mean Squared Error"	""
+"Mean Temperature"	""
 "Mean Value"	""
 "Mean Value (cell area weighted)"	""
+"Mean annual flow per unit area (m/s for MPM)"	""
 "Mean less Standard Deviation"	""
 "Mean over Catchment"	""
 "Mean plus Standard Deviation"	""
@@ -2724,6 +2979,7 @@ TEXT	TRANSLATION
 "Mean saturation deficit (in watershed) [m]"	""
 "Mean soil loss"	""
 "Mean temperature"	""
+"Mean_elevation"	""
 "Measure Distance"	""
 "Measured Points (PC)"	""
 "Median"	""
@@ -2751,6 +3007,7 @@ TEXT	TRANSLATION
 "Metadata"	""
 "Metadata File"	""
 "Metadata Files (*.met, *.txt)"	""
+"Metadata from Header:"	""
 "Meteorological data"	""
 "Meteorological data for multiple timestep modelling [model step (day); temperature (Celsius); rainfall (mm), rainfall intensity (mm/h); rainfall duration (day); timespan (days)]"	""
 "Method"	""
@@ -2771,7 +3028,6 @@ TEXT	TRANSLATION
 "Min. Segment Length"	""
 "Min. Size"	""
 "Min. Size (Cells)"	""
-"Min./Max. Number of m_Points"	""
 "Mine Sweeper"	""
 "Minima"	""
 "Minimal Curvature"	""
@@ -2785,12 +3041,16 @@ TEXT	TRANSLATION
 "Minimum Distance"	""
 "Minimum Distance Analysis"	""
 "Minimum Exaggeration [%]"	""
+"Minimum Gradient"	""
 "Minimum Height"	""
+"Minimum Magnitude"	""
 "Minimum Nash-Sutcliffe Efficiency"	""
 "Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"	""
 "Minimum Node Split Size"	""
 "Minimum Number of Dark Object Cells"	""
 "Minimum Number of Points"	""
+"Minimum Pressure Level [mb]"	""
+"Minimum Probability"	""
 "Minimum Redundancy Feature Selection"	""
 "Minimum Resolution (Degree)"	""
 "Minimum Segment Length (Cells)"	""
@@ -2798,18 +3058,26 @@ TEXT	TRANSLATION
 "Minimum Slope"	""
 "Minimum Slope [Degree]"	""
 "Minimum Standard Deviation"	""
+"Minimum Step Size"	""
 "Minimum Temperature"	""
+"Minimum Thickness"	""
 "Minimum Threshold"	""
+"Minimum Time Step [a]"	""
+"Minimum Time Step [years]"	""
 "Minimum Value"	""
+"Minimum and maximum of attribute range []."	""
 "Minimum and maximum x-coordinate of AOI."	""
 "Minimum and maximum y-coordinate of AOI."	""
+"Minimum magnitude as percentile."	""
 "Minimum number of cells in a group of adjacent cells."	""
 "Minimum of Darkness DN Cells"	""
 "Minimum pixels to consider digital number as dark object"	""
+"Minimum probability to accept a classification result for a cell."	""
 "Minimum shade brightness must be lower than maximum shade brightness!"	""
 "Minimum size"	""
 "Minimum size of basin (cells)"	""
 "Minimum slope gradient to preserve from cell to cell; with a value of zero sinks are filled up to the spill elevation (which results in flat areas). Unit [Degree]"	""
+"Minimum sub-time step size (yrs)"	""
 "Minimum value of the range to be reclassified."	""
 "Minimum/Maximum"	""
 "Minimun"	""
@@ -2834,6 +3102,8 @@ TEXT	TRANSLATION
 "Model parameter [m]"	""
 "Model parameters"	""
 "Model step %d/%d ..."	""
+"Modelled DEM"	""
+"Modelled Elevation"	""
 "Modelling erosion processes."	""
 "Modelling hydrological processes."	""
 "Modelling the Human Impact on Nature"	""
@@ -2852,6 +3122,8 @@ TEXT	TRANSLATION
 "Monthly Global by Latitude"	""
 "Moore"	""
 "Moore & Nieber 1989"	""
+"Moore (8)"	""
+"Moore Contiguity"	""
 "Moore et al. 1991"	""
 "Moran's I"	""
 "Morphological Filter"	""
@@ -2881,6 +3153,7 @@ TEXT	TRANSLATION
 "Multi-Band Variation"	""
 "Multilevel B-Spline Interpolation"	""
 "Multilevel B-Spline Interpolation (from Grid)"	""
+"Multilevel B-Spline Interpolation for Categories"	""
 "Multiple Flow Direction"	""
 "Multiple Flow Direction (FD8)"	""
 "Multiple Flow Direction (Quinn et al. 1991)"	""
@@ -2891,8 +3164,9 @@ TEXT	TRANSLATION
 "Multiple Maximum Downslope Gradient Based Flow Directon"	""
 "Multiple Observer"	""
 "Multiple R-squared"	""
-"Multiple Regression Analysis (Grid/Grids)"	""
-"Multiple Regression Analysis (Points/Grids)"	""
+"Multiple Regression Analysis"	""
+"Multiple Regression Analysis (Grid and Predictor Grids)"	""
+"Multiple Regression Analysis (Points and Predictor Grids)"	""
 "Multiple Triangular Flow Directon"	""
 "Multiple m_Flow Direction"	""
 "Multiple of Standard Deviation used as default for histogram stretch."	""
@@ -2900,12 +3174,17 @@ TEXT	TRANSLATION
 "Multipoint"	""
 "Multipoints"	""
 "Multiresolution Index of Valley Bottom Flatness (MRVBF)"	""
+"Multleve B-Spline Interpolation"	""
 "Mutual Information Difference (MID)"	""
 "Mutual Information Quotient (MIQ)"	""
 "MySQL Data"	""
 "My_Module Module Sub Menu"	""
 "NAME"	""
+"NBR_X"	""
+"NBR_Y"	""
+"NCAR Climate Import"	""
 "NCELLS"	""
+"NCache einlesen"	""
 "NEIGHBORS"	""
 "NEON"	""
 "NO DATA"	""
@@ -2923,6 +3202,9 @@ TEXT	TRANSLATION
 "Name"	""
 "Name Field"	""
 "Name by..."	""
+"Name des Evaluierungspunktes 1"	""
+"Name des Evaluierungspunktes 2"	""
+"Name des Evaluierungspunktes 3"	""
 "Name of Landsat metadata file (.met or MTL.txt)"	""
 "Natural Neighbour"	""
 "Navaladi, Schoeller, Conrad (c) 2009"	""
@@ -2938,17 +3220,18 @@ TEXT	TRANSLATION
 "Neighborhood"	""
 "Neighborhood Type"	""
 "Neighbourhood"	""
+"Neighbourhood (Radius)"	""
 "Net Primary Production [Gt Carbon / a]"	""
 "NetCDF Files (*.nc)"	""
 "Network topology"	""
 "Neumann"	""
+"Neumann Contiguity"	""
 "Neumann: the four horizontally and vertically neighboured cells; Moore: all eight adjacent cells"	""
 "Neural Networks (OpenCV)"	""
 "New"	""
 "New Grid Dimensions"	""
 "New Shapes Layer"	""
 "New Table"	""
-"New Value"	""
 "New grid filtered with the A1WiTh module"	""
 "New grid filtered with the A2WiTh module"	""
 "New grid filtered with the A3WiTh module"	""
@@ -2976,20 +3259,25 @@ TEXT	TRANSLATION
 "No OUTPUT vector normalization"	""
 "No Options"	""
 "No PostgreSQL connection available!"	""
+"No Sinks"	""
+"No attribute fields selected!"	""
 "No attribute fields specified!"	""
 "No data"	""
 "No data loaded."	""
 "No description available"	""
 "No duplicates found."	""
+"No grid in list"	""
 "No objects"	""
 "No parameters available."	""
 "No path for output files specified!"	""
 "No pen is used"	""
+"No projects in directory"	""
 "No shapes in selection"	""
 "No sinks have been detected."	""
 "No translation set by user"	""
 "NoData Output Grid"	""
 "NoData Value"	""
+"NoData Value: %.6f"	""
 "NoData encountered in input grid %s: x %d (%.2f), y %d (%.2f)"	""
 "NoData value of input grid"	""
 "NoData value(s) in statistic grid(s)!"	""
@@ -3023,13 +3311,13 @@ TEXT	TRANSLATION
 "Nothing to do: there is no intersection with additonal grid."	""
 "November"	""
 "No|Yes|"	""
-"Nugget"	""
 "Number Of Shapes"	""
 "Number in Latitudinal Direction"	""
 "Number in Meridional Direction"	""
 "Number of Attributes"	""
 "Number of Buffer Zones"	""
 "Number of CPU Cores [# physical processors]"	""
+"Number of Categories"	""
 "Number of Cells"	""
 "Number of Classes"	""
 "Number of Clusters"	""
@@ -3048,11 +3336,13 @@ TEXT	TRANSLATION
 "Number of Fields"	""
 "Number of Grid Cells"	""
 "Number of Grids"	""
+"Number of Infection States"	""
 "Number of Intervals"	""
 "Number of Iterations"	""
 "Number of Iterations for Normal Updating"	""
 "Number of Iterations for Vertex Updating"	""
 "Number of No-Data Cells"	""
+"Number of Numeric Value Classes"	""
 "Number of Pairs"	""
 "Number of Parts"	""
 "Number of Points"	""
@@ -3068,8 +3358,10 @@ TEXT	TRANSLATION
 "Number of Values"	""
 "Number of Variables"	""
 "Number of Vertices"	""
+"Number of added tools"	""
 "Number of additional attributes to import."	""
 "Number of arguments for attribute fields (%d), names (%d) and types (%d) do not match!"	""
+"Number of attribute fields: %d"	""
 "Number of atttribute table columns."	""
 "Number of cells"	""
 "Number of classes in the cloud temperature histogram"	""
@@ -3096,9 +3388,11 @@ TEXT	TRANSLATION
 "Numbering of Data Sets"	""
 "Numeric"	""
 "Numeric Attribute Values"	""
+"Numerical Features"	""
 "Numerical Precision"	""
 "O. Conrad (c) 2009"	""
 "O. Conrad (c) 2011"	""
+"O.C.'s Tests"	""
 "O.Conrad (c) 2010"	""
 "O.Conrad (c) 2011"	""
 "O.Conrad (c) 2013"	""
@@ -3121,6 +3415,7 @@ TEXT	TRANSLATION
 "OUTPUT certainty"	""
 "OUTPUT classes"	""
 "Object Grid"	""
+"Object Update"	""
 "Objective Function"	""
 "Objects removed from input grid"	""
 "Oblique Mercator"	""
@@ -3144,6 +3439,7 @@ TEXT	TRANSLATION
 "Omega"	""
 "Omega [degree]"	""
 "One Point Cloud per Polygon"	""
+"One or several input point cloud datasets to cut."	""
 "One per x"	""
 "Online Help"	""
 "Only Header Info"	""
@@ -3154,8 +3450,10 @@ TEXT	TRANSLATION
 "Opaque"	""
 "Open"	""
 "Open Database Connection"	""
+"Open Project"	""
 "Open Slopes"	""
 "OpenCV"	""
+"OpenMP: Slope, Aspect"	""
 "Opening"	""
 "Openness"	""
 "Operation"	""
@@ -3163,8 +3461,10 @@ TEXT	TRANSLATION
 "Operator Type"	""
 "Operator scale"	""
 "Opposite Neighbours"	""
+"Optimised"	""
 "Optional Output Filepath"	""
 "Optional Target Grids"	""
+"Optional Tile Info Filename"	""
 "Optional floating-point vector of weights for each sample. Some samples may be more important than others for training."	""
 "Optional integer vector indicating the samples (rows of inputs and outputs) that are taken into account."	""
 "Optional output polygon shapefile"	""
@@ -3173,20 +3473,30 @@ TEXT	TRANSLATION
 "Order"	""
 "Order by"	""
 "Order by..."	""
+"Order of Polynomial Function"	""
 "Ordered Weighted Averaging (OWA)"	""
+"Ordern in den alle Ausgabedaten gespeichert werden sollen"	""
 "Ordinary Kriging"	""
-"Ordinary Kriging (Global)"	""
+"Ordnerpfad der Surface Runoff- und Drainagerasterdaten des Landoberflaechenschemas"	""
+"Ordnerpfad der WUse Daten"	""
+"Ordnerpfad in dem alle zu bearbeitenden WaterGap Raster abgelegt sind"	""
 "Orientation"	""
 "Origin Height"	""
 "Origin Latitude"	""
 "Original"	""
 "Original Channels"	""
+"Original DEM"	""
+"Original Grid"	""
 "Original Image"	""
+"Original River Elevations"	""
 "Orographic Coefficient"	""
 "Orthoclinal slope"	""
+"Orthodromes"	""
 "Orthographic"	""
 "Ouput"	""
+"Outflow"	""
 "Outlet"	""
+"Outlet Concentration"	""
 "Outlet Hydrographs"	""
 "Outlet X"	""
 "Outlet Y"	""
@@ -3197,8 +3507,11 @@ TEXT	TRANSLATION
 "Output Features"	""
 "Output Field Name"	""
 "Output File"	""
+"Output Filepath"	""
 "Output Format"	""
 "Output Grid"	""
+"Output Grid Down"	""
+"Output Grid Up"	""
 "Output Lod"	""
 "Output Seeds"	""
 "Output Text File"	""
@@ -3211,14 +3524,21 @@ TEXT	TRANSLATION
 "Output file path"	""
 "Output format"	""
 "Output grid"	""
+"Output interval"	""
+"Output interval (time steps)"	""
 "Output of Change Vector"	""
+"Output of Grids"	""
+"Output of Level Data"	""
 "Output of Model Parameters"	""
 "Output of Regression Parameters"	""
+"Output of Trend Data"	""
 "Output of module calculations."	""
+"Output of..."	""
 "Output parameters"	""
 "Output shapes with field(s) deleted"	""
 "Output table with field(s) deleted"	""
 "Output will inherit shape type and table structure from the first layer in this list."	""
+"Overall Bounding Box:"	""
 "Overdip slope"	""
 "Overland"	""
 "Overland Flow - Kinematic Wave D8"	""
@@ -3228,13 +3548,11 @@ TEXT	TRANSLATION
 "Overlap [map units]"	""
 "Overlapping Areas"	""
 "Overlapping Cells"	""
-"Overlay 1"	""
-"Overlay 2"	""
 "Overlay Image"	""
 "Override"	""
 "Overview"	""
-"P in"	""
-"P out"	""
+"Overwrite"	""
+"P"	""
 "P/A"	""
 "P/sqrt(A)"	""
 "PATB"	""
@@ -3249,7 +3567,8 @@ TEXT	TRANSLATION
 "PDF Files (*.pdf)|*.pdf|All Files|*.*"	""
 "PERCENTILE"	""
 "PERIMETER"	""
-"PET (after Hargreave)"	""
+"PET (after Hargreaves, Grid)"	""
+"PET (after Hargreaves, Table)"	""
 "PFAC("	""
 "PH, plant height [m], representing the effective height from which raindrops fall from the crop or vegetation"	""
 "PI, permanent interception expressed as the proportion [between 0-1] of rainfall"	""
@@ -3265,6 +3584,7 @@ TEXT	TRANSLATION
 "Panchromatic Channel Matching"	""
 "Panorama"	""
 "Panorama Break [%]"	""
+"Paolo"	""
 "Paper Format"	""
 "Parallelepiped"	""
 "Parameter"	""
@@ -3278,15 +3598,12 @@ TEXT	TRANSLATION
 "Parameter (p)"	""
 "Parameter (p) [lower bound]"	""
 "Parameter (p) [upper bound]"	""
-"Parameter A for Power Function Regression:\n   y = A * x ^ B"	""
-"Parameter B for Exponential Regression:\n   y = Nugget * e ^ (B * x)"	""
-"Parameter B for Linear Regression:\n   y = Nugget + B * x"	""
-"Parameter B for Power Function Regression:\n   y = A * x ^ B"	""
 "Parameter settings for No-Data and all other values."	""
 "Parameter settings for the NoData value of the output grid (header)."	""
 "Parameters"	""
 "Parameters file could not be exported."	""
 "Parameters file could not be imported."	""
+"Parameterwerte HD Modell"	""
 "Parsing %s ... "	""
 "Partial D."	""
 "Partially wet (WI = 0.1 - 1)"	""
@@ -3332,6 +3649,8 @@ TEXT	TRANSLATION
 "Perpendicular Vegetation Index (Walther and Shabaani)"	""
 "Perspectivic Distance"	""
 "Peucker & Douglas"	""
+"Pfad LS-Daten"	""
+"Pfad WaterGap Raster"	""
 "Phi [degree]"	""
 "Photogrammetry"	""
 "Photogrammetry tools."	""
@@ -3362,11 +3681,13 @@ TEXT	TRANSLATION
 "Please provide a shapefile with the 'Polygons' parameter!"	""
 "Please provide a shapefile with the 'Shapes Extent' parameter!"	""
 "Please provide a valid *.scpvf file!"	""
+"Please provide a valid *.scpvf_tile_info file!"	""
 "Please provide a valid AOI!"	""
 "Please provide a valid R,G,B fields for this kind of operation!"	""
 "Please provide a valid SAGA RGB field for this kind of operation!"	""
 "Please provide a valid base name for the output files!"	""
 "Please provide a valid output directory for the output files!"	""
+"Please provide a valid output file path!"	""
 "Please provide an attribute field with z-information!"	""
 "Please provide an output file name!"	""
 "Please provide at least one column to export!"	""
@@ -3375,6 +3696,7 @@ TEXT	TRANSLATION
 "Plot Holes"	""
 "Point"	""
 "Point Cloud"	""
+"Point Cloud %s is empty after removing overlap, skipping dataset!"	""
 "Point Cloud Attribute Calculator"	""
 "Point Cloud Cutter"	""
 "Point Cloud Manager"	""
@@ -3384,6 +3706,7 @@ TEXT	TRANSLATION
 "Point Cloud Viewer Settings"	""
 "Point Cloud from Grid Points"	""
 "Point Cloud from Shapes"	""
+"Point Cloud from Table"	""
 "Point Cloud list"	""
 "Point Cloud to Grid"	""
 "Point Cloud to Shapes"	""
@@ -3402,6 +3725,7 @@ TEXT	TRANSLATION
 "Point Statistics for Polygons"	""
 "Point View Settings"	""
 "Point clouds viewer."	""
+"Point insertion distance [map units]."	""
 "Point shapefile with source point(s)"	""
 "Point summary contains no points!"	""
 "Point to Keep"	""
@@ -3450,6 +3774,7 @@ TEXT	TRANSLATION
 "Portable Network Graphics"	""
 "Portable Network Graphics (*.png)"	""
 "Position"	""
+"Position as Geographic Coordinates"	""
 "Positive Openness"	""
 "Positive values result in a shift in E direction."	""
 "Positive values result in a shift in N direction."	""
@@ -3462,11 +3787,10 @@ TEXT	TRANSLATION
 "PostgreSQL source connected"	""
 "PostgreSQL source disconnected"	""
 "PostgreSQL source is already connected"	""
+"Potential Evapotranspiration"	""
 "Potential Incoming Solar Radiation"	""
 "Power"	""
-"Power Function - A"	""
-"Power Function - B"	""
-"Power Function Regression"	""
+"Power (Distance Weighting)"	""
 "Power on soil (p)"	""
 "Power on soil (p) [lower bound]"	""
 "Power on soil (p) [upper bound]"	""
@@ -3481,6 +3805,7 @@ TEXT	TRANSLATION
 "Precipitation Column"	""
 "Precipitation [m / dt]"	""
 "Precipitation [mm]"	""
+"Precipition Quantitiy [mm]"	""
 "Precise Datum Conversion"	""
 "Precise Tracing"	""
 "Precisions"	""
@@ -3501,6 +3826,10 @@ TEXT	TRANSLATION
 "Preprocessed DEM"	""
 "Preprocessed DEM. If this is not set changes will be stored in the original DEM grid."	""
 "Preprocessing"	""
+"Presence Data"	""
+"Presence Prediction"	""
+"Presence Probability"	""
+"Preservation"	""
 "Preserve 1px border Yes/No"	""
 "Preserve Data Type"	""
 "Preset Selection"	""
@@ -3524,19 +3853,23 @@ TEXT	TRANSLATION
 "Print Setup"	""
 "Print only information available in LAS header."	""
 "Priority Index"	""
+"Probabilities"	""
 "Probability"	""
 "Probability Estimates"	""
 "Probability Reference"	""
-"Probability Threshold (Percent)"	""
+"Probability Threshold"	""
 "Process Update Frequency [milliseconds]"	""
 "Processed DEM"	""
 "Processing"	""
 "Processing AOI %d ..."	""
 "Processing AOI ..."	""
+"Processing Sinks and Flats"	""
+"Processing dataset %d"	""
 "Processing first pass..."	""
 "Processing observer %d ..."	""
 "Product"	""
 "Production"	""
+"Production Rates [m/h]"	""
 "Profile"	""
 "Profile (lines)"	""
 "Profile (points)"	""
@@ -3555,6 +3888,7 @@ TEXT	TRANSLATION
 "Proj.4"	""
 "Proj.4 Version is "	""
 "Proj4 Parameters"	""
+"Proj4 definition string error"	""
 "Project"	""
 "Project File"	""
 "Project \'%s\'"	""
@@ -3578,14 +3912,19 @@ TEXT	TRANSLATION
 "Projection_GeoTRANS_Geoid_EGM96.dat,\n"	""
 "Projections"	""
 "Projection|Georeferencing"	""
+"Propability"	""
 "Properties"	""
 "Protection Index"	""
 "Provide Radial Distortion Parameters?"	""
 "Provide Time stamp of Image?"	""
 "Proximity"	""
 "Proximity Grid"	""
+"Punktuelle Rasterzellenmanipulation"	""
 "Pythagoras' Tree"	""
+"Python"	""
+"Python with Header"	""
 "Q, estimation of mean runoff [mm]"	""
+"QM of ESP"	""
 "QUALITY"	""
 "QuadTree"	""
 "QuadTree Structure to Shapes"	""
@@ -3608,7 +3947,6 @@ TEXT	TRANSLATION
 "R,G,B value range"	""
 "R2"	""
 "R:Alternatives"	""
-"R:Catchment Area"	""
 "R:Classification"	""
 "R:Conversion"	""
 "R:Conversions"	""
@@ -3616,7 +3954,6 @@ TEXT	TRANSLATION
 "R:Dynamics"	""
 "R:Export"	""
 "R:Fragmentation Analysis"	""
-"R:GWR"	""
 "R:Grid Generation"	""
 "R:Grid Values"	""
 "R:Image Sharpening"	""
@@ -3637,7 +3974,6 @@ TEXT	TRANSLATION
 "R:Tools"	""
 "R:Topographic Indices"	""
 "R:Vectorization"	""
-"R:Without Variogram Fit"	""
 "RAINBOW"	""
 "RANGE"	""
 "RED_BLUE"	""
@@ -3646,9 +3982,10 @@ TEXT	TRANSLATION
 "RED_GREEN_BLUE"	""
 "RED_GREY_BLUE"	""
 "RED_GREY_GREEN"	""
+"REMO Level Interpolation"	""
 "RESIDUAL"	""
-"RFR, Surface roughness [cm/m]"	""
 "RGB"	""
+"RGB Coded Values"	""
 "RGB Composite"	""
 "RGB Image"	""
 "RGB Overlay"	""
@@ -3656,7 +3993,6 @@ TEXT	TRANSLATION
 "RGB coded data"	""
 "RGB to IHS"	""
 "RMSE"	""
-"ROI_N"	""
 "RPROP parameters"	""
 "RTL Compression"	""
 "Radial Limit"	""
@@ -3680,9 +4016,11 @@ TEXT	TRANSLATION
 "Rainfall intensity"	""
 "Random"	""
 "Random Field"	""
-"Random Forest (ViGrA)"	""
 "Random Forest Classification"	""
-"Random Terrain Generation"	""
+"Random Forest Classification (ViGrA)"	""
+"Random Forest Options"	""
+"Random Forest Presence Prediction (ViGrA)"	""
+"Random Terrain"	""
 "Range"	""
 "Range of R,G,B values in LAS file."	""
 "Rank"	""
@@ -3692,6 +4030,8 @@ TEXT	TRANSLATION
 "Raster Resolution (Pixel Size)"	""
 "Raster Resolution (Pixels Size)"	""
 "Raster Resolution (Pixels X)"	""
+"Rasterzelle 1"	""
+"Rasterzelle 2"	""
 "Rate Constant for Litter Loss [1/a]"	""
 "Ratio Evapotranspiration"	""
 "Ratio Vegetation Index"	""
@@ -3702,6 +4042,8 @@ TEXT	TRANSLATION
 "Rc"	""
 "Real"	""
 "Real Surface Area"	""
+"Real-valued Numerical Features"	""
+"Recalculate"	""
 "Reciprocal Flattening (rf)"	""
 "Reclassification of distance grid to buffer zones with a width equal to the equidistance value."	""
 "Reclassified Grid"	""
@@ -3720,7 +4062,6 @@ TEXT	TRANSLATION
 "Red Reflectance"	""
 "Reduction"	""
 "Reference Chip Size (Cells)"	""
-"Reference Height"	""
 "Reference Points"	""
 "Reference Points (Origin)"	""
 "Reference Points (Projection)"	""
@@ -3729,31 +4070,44 @@ TEXT	TRANSLATION
 "Referencing"	""
 "Reflectance"	""
 "Refresh"	""
+"Region of Interest"	""
+"Regolith Smoothing"	""
+"Regolith Thickness"	""
+"Regolith_cover_thickness"	""
 "Regression"	""
 "Regression Analysis"	""
-"Regression Analysis (Points/Grid)"	""
+"Regression Analysis (Points and Predictor Grid)"	""
 "Regression Details"	""
 "Regression Formula"	""
 "Regression Function"	""
+"Regression Kriging"	""
 "Regression Model"	""
 "Regression Parameters"	""
 "Regression with Residual Correction"	""
+"Regression: Coefficients"	""
+"Regression: Model"	""
+"Regression: Steps"	""
 "Regularisation"	""
+"Regularization"	""
+"Regularization Factor"	""
 "Relation B / A"	""
 "Relationship KE - I"	""
 "Relationship between kinetic energy (KE) and rainfall intensity (I)"	""
 "Relative Area"	""
 "Relative Height"	""
 "Relative Heights and Slope Positions"	""
+"Relative Relief Position"	""
 "Relative Richness"	""
 "Relative Slope Position"	""
 "Relative from cell value"	""
 "Relative heights calculation..."	""
+"Relative position"	""
 "Relaxation"	""
 "Reload"	""
 "Reload tool chain"	""
 "Remove Border Regions?"	""
 "Remove Duplicate Points"	""
+"Remove Overlap from Virtual Point Cloud Tiles"	""
 "Remove every i-th point."	""
 "Remove regions which have contact with (are adjacent to) the image borders?"	""
 "Removed Objects"	""
@@ -3763,6 +4117,7 @@ TEXT	TRANSLATION
 "Rename Table"	""
 "Replace Condition"	""
 "Replace Text"	""
+"Replace first PC with PAN"	""
 "Replace with"	""
 "Replacement"	""
 "Replacements"	""
@@ -3777,8 +4132,11 @@ TEXT	TRANSLATION
 "Rescale to 0 - 1"	""
 "Rescale to 0 - 1.0"	""
 "Resection (Terrestrial)"	""
+"Reset Regolith"	""
 "Residual Analysis (Grid)"	""
+"Residual Corrected Regression"	""
 "Residual Correction"	""
+"Residual Interpolation"	""
 "Residual standard error"	""
 "Residuals"	""
 "Resilent propagation (RPROP)"	""
@@ -3790,6 +4148,8 @@ TEXT	TRANSLATION
 "Result table"	""
 "Result: Scene cloud free"	""
 "Result: Scene with clouds"	""
+"Resultierendes Raster ueber WasserENTNAHME erstellen"	""
+"Resultierendes Raster ueber WasserNUTZUNG erstellen"	""
 "Resulting Point Cloud."	""
 "Resulting Value"	""
 "Results"	""
@@ -3805,14 +4165,22 @@ TEXT	TRANSLATION
 "Right [Del]"	""
 "Right [F4]"	""
 "Rill/Interrill Erosivity"	""
+"RivFlow"	""
+"RivFlow."	""
+"River Flooding (Mean Value Cellular Automat)"	""
+"River Flow Terraces"	""
+"River Flow Terraces Elevations"	""
 "River Heads"	""
 "River Mouths"	""
+"River Pixels"	""
 "Rn, number of rain days in timespan [-]"	""
 "Road Width"	""
+"Rock Layers"	""
 "Roll Left [F4]"	""
 "Roll Right[F3]"	""
 "Rook"	""
 "Rook's case"	""
+"Rooke"	""
 "Roots"	""
 "Roots to Humus"	""
 "Rotate"	""
@@ -3831,17 +4199,24 @@ TEXT	TRANSLATION
 "Route soil loss along channel network to outlet"	""
 "Routing"	""
 "Routing Error"	""
+"Row Order"	""
 "Rows"	""
 "Run Tool"	""
+"Run duration"	""
 "Running Average"	""
 "Running Script"	""
 "Runoff"	""
+"S Model"	""
+"S u m"	""
 "S, slope [rad]"	""
 "SAFETYFACTOR"	""
 "SAGA Colors"	""
+"SAGA GUI Tool Menus"	""
+"SAGA Grid Files (*.sgrd)|*.sgrd|All Files|*.*"	""
 "SAGA Help"	""
 "SAGA Parameter Files"	""
 "SAGA Point Cloud Virtual Format (*.spcvf)"	""
+"SAGA Point Cloud Virtual Format Tile Info (*.spcvf_tile_info)"	""
 "SAGA Point Clouds"	""
 "SAGA Projects"	""
 "SAGA RGB"	""
@@ -3850,14 +4225,17 @@ TEXT	TRANSLATION
 "SAGA Tool Libraries"	""
 "SAGA User Group Associaton (c) 2002"	""
 "SAGA User Group Associaton (c) 2002-2013"	""
+"SAGA User Group Associaton (c) 2002-2014"	""
 "SAGA User Group Associaton (c) 2008"	""
 "SAGA Wetness Index"	""
 "SAGA: Print Map"	""
 "SAGA\nSystem for Automated Geoscientific Analyses\nVersion 2.0"	""
+"SALEM"	""
 "SECTIONS"	""
 "SHALSTAB"	""
 "SIZE"	""
 "SL, estimation of mean soil loss [kg]"	""
+"SLOPE"	""
 "SLc"	""
 "SLs"	""
 "SLz"	""
@@ -3882,6 +4260,8 @@ TEXT	TRANSLATION
 "SVM Classification"	""
 "SVM Type"	""
 "SVR Epsilon"	""
+"S_Model"	""
+"S_Z_Model"	""
 "Saddle"	""
 "Sample Variogram"	""
 "Sample from training population with or without replacement?"	""
@@ -3892,7 +4272,7 @@ TEXT	TRANSLATION
 "Samples per Tree"	""
 "Sand"	""
 "Sandy Clay"	""
-"Sandy Clay-Loam"	""
+"Sandy Clay Loam"	""
 "Sandy Loam"	""
 "Sat. lateral permeability"	""
 "Satellite Height [m]"	""
@@ -3924,6 +4304,7 @@ TEXT	TRANSLATION
 "Save Project As..."	""
 "Save Settings"	""
 "Save Shapes"	""
+"Save Statistics to File..."	""
 "Save TIN"	""
 "Save Table"	""
 "Save Table Header"	""
@@ -3940,9 +4321,12 @@ TEXT	TRANSLATION
 "Save tiles to disk individually"	""
 "Save to Clipboard"	""
 "Save to File"	""
+"Save to File..."	""
 "Save to Path"	""
+"Save to Script File"	""
 "Scalable Vector Graphics Files (*.svg)"	""
 "Scale"	""
+"Scale (Cells)"	""
 "Scale 1 : "	""
 "Scale Bar"	""
 "Scale Factor"	""
@@ -3962,7 +4346,6 @@ TEXT	TRANSLATION
 "Score"	""
 "Screen"	""
 "Search Chip Size (Cells)"	""
-"Search Direction"	""
 "Search Distance"	""
 "Search Distance (Map Units)"	""
 "Search Distance Increment"	""
@@ -3971,10 +4354,14 @@ TEXT	TRANSLATION
 "Search Mode"	""
 "Search Options"	""
 "Search Radius"	""
+"Search Radius (Cells)"	""
 "Search Range"	""
 "Search Result"	""
 "Search Shape"	""
 "Search chip size set to %d"	""
+"Search distance given as number cells."	""
+"Search for Projects"	""
+"Search for Projects..."	""
 "Search for..."	""
 "Search radius of kernel in cells."	""
 "Search text not found"	""
@@ -3983,27 +4370,38 @@ TEXT	TRANSLATION
 "Secondary Name"	""
 "Section"	""
 "Sections"	""
+"Sed_thickness_a"	""
+"Sed_thickness_b"	""
 "Sediment Balance"	""
 "Sediment Balance Clay"	""
 "Sediment Balance Sand"	""
 "Sediment Balance Silt"	""
+"Sediment Influx from Upstream"	""
 "Sediment Limited [%d], Transport Limited (SL = TC) [%d], Transport Limited (SL = G) [%d]"	""
 "Sediment Yield Delivery Ratio"	""
+"Sediment_infux_from_upstream"	""
 "Seed Generation"	""
 "Seed Points"	""
 "Seed Type"	""
 "Seed Value"	""
 "Seeded Region Growing"	""
 "Seeds"	""
+"Seeds (Mask)"	""
 "Seeds Grid"	""
 "Seeds Only"	""
+"Segment Connection"	""
 "Segment ID"	""
 "Segmentation"	""
 "Segments"	""
 "Select * FROM test"	""
+"Select All"	""
 "Select File"	""
+"Select Format"	""
+"Select Grid from List"	""
+"Select Look-up Table for Grid Visualization"	""
 "Select Points"	""
 "Select Precipitation Column"	""
+"Select Startup Project"	""
 "Select Temperature Column"	""
 "Select a layer to copy settings from it."	""
 "Select a mode of operation"	""
@@ -4046,12 +4444,14 @@ TEXT	TRANSLATION
 "Semiminor Axis (b)"	""
 "Semiminor axis or polar radius."	""
 "Semivariance"	""
+"Sensitivity"	""
 "Sensor"	""
 "Separate Line/Polygon Points"	""
 "Separate by..."	""
 "Separate points by direction"	""
 "Separator"	""
 "Separator (other)"	""
+"Seperate Beruecksichtigung und Berechnung ueber Hauptgerinnerasterzellen - neben den normalen Gerinnerasterzellen."	""
 "September"	""
 "Sequencer"	""
 "Sequencer Positions"	""
@@ -4070,6 +4470,8 @@ TEXT	TRANSLATION
 "Settings"	""
 "Shade"	""
 "Shade Brightness"	""
+"Shade Brightness [%]"	""
+"Shade Transparency [%]"	""
 "Shading"	""
 "Shading Method"	""
 "Shadow"	""
@@ -4109,7 +4511,7 @@ TEXT	TRANSLATION
 "Shapes|Tools"	""
 "Shared Polygon Edges"	""
 "Sharpen"	""
-"Sharpend Channels"	""
+"Sharpened Channels"	""
 "Sharpening"	""
 "Shear factors"	""
 "Shearing"	""
@@ -4163,16 +4565,19 @@ TEXT	TRANSLATION
 "Side Slope"	""
 "Sieved Classes"	""
 "Sieving Classes"	""
+"Sigma"	""
 "Sigmoid"	""
-"Sill"	""
+"Significance Level"	""
+"Significance level (aka p-value) as threshold for automated predictor selection, given as percentage"	""
 "Silt"	""
-"Silt-Loam"	""
+"Silt Loam"	""
 "Silty Clay"	""
-"Silty Clay-Loam"	""
+"Silty Clay Loam"	""
 "Similarity"	""
 "Similarity Threshold"	""
 "Simple"	""
 "Simple Filter"	""
+"Simple Kriging"	""
 "Simple, flow path and swath profiles."	""
 "Simplified Lines"	""
 "Simplify Lines"	""
@@ -4186,12 +4591,15 @@ TEXT	TRANSLATION
 "Simulation Time"	""
 "Simulation Time Step [h]"	""
 "Simulation Time [h]"	""
+"Simulation Time [kyr]"	""
 "Simulation|Cellular Automata"	""
 "Simulation|Ecology|Modelling the Human Impact on Nature"	""
 "Simulation|Erosion"	""
 "Simulation|Fire Spreading"	""
 "Simulation|Hydrology"	""
 "Simulation|Hydrology|IHACRES"	""
+"Simulation|Hydrology|RivFlow"	""
+"Simulation|Quantitative Modeling of Earth Surface Processes"	""
 "Single Cell"	""
 "Single Colour"	""
 "Single Flow Direction"	""
@@ -4200,9 +4608,11 @@ TEXT	TRANSLATION
 "Single Value Decomposition (OpenCV)"	""
 "Single value"	""
 "Sink Drainage Route Detection"	""
+"Sink Fill Algorithm"	""
 "Sink Removal"	""
 "Sink Route"	""
 "Sink Routes"	""
+"Sinks"	""
 "Sinuosity"	""
 "Sinusoidal"	""
 "Size"	""
@@ -4216,7 +4626,9 @@ TEXT	TRANSLATION
 "Size of smoothing filter"	""
 "Size relates to..."	""
 "Skeleton"	""
+"Skewness"	""
 "Skip"	""
+"Skip Lines"	""
 "Skip Number"	""
 "Skip cells (step value)."	""
 "Skip first line"	""
@@ -4237,6 +4649,8 @@ TEXT	TRANSLATION
 "Slope Tolerance"	""
 "Slope Units"	""
 "Slope Weighting"	""
+"Slope exponent Nb for bedrock channel erosion"	""
+"Slope exponent Nf for fluvial sediment transport"	""
 "Slope gradient to left neighbour [%%]"	""
 "Slope gradient to left neighbour [Degree]"	""
 "Slope grid, in radians."	""
@@ -4244,10 +4658,16 @@ TEXT	TRANSLATION
 "Slope threshold, given as degree, above which flow transport is unlimited."	""
 "Slope tolerance that defines a 'flat' surface (degrees)"	""
 "Slope, Aspect, Curvature"	""
+"Slope_failure_locations"	""
 "Slopes"	""
 "Smith"	""
 "Smooth"	""
+"Smooth River Flow Terraces"	""
+"Smoothed Lines"	""
+"Smoothed River Elevations"	""
+"Smoothing"	""
 "Smoothing (ViGrA)"	""
+"Smoothing Threshold"	""
 "Snap Distance"	""
 "Snap Features"	""
 "Snap Points to Grid"	""
@@ -4259,13 +4679,20 @@ TEXT	TRANSLATION
 "Soil"	""
 "Soil Adjusted Vegetation Index"	""
 "Soil Adjustment Factor"	""
+"Soil Depth"	""
+"Soil Depth Right"	""
+"Soil Friction Coefficient"	""
 "Soil Moisture"	""
 "Soil Moisture Content"	""
 "Soil Moisture Deficit"	""
 "Soil Moisture Power Eq."	""
 "Soil Nitrogen"	""
+"Soil Parameter"	""
 "Soil Texture"	""
 "Soil Texture Classification"	""
+"Soil Texture Classification for Tables"	""
+"Soil Thickness"	""
+"Soil Things"	""
 "Soil Water"	""
 "Soil moisture (at FC)"	""
 "Soil moisture index (l)"	""
@@ -4314,6 +4741,7 @@ TEXT	TRANSLATION
 "Spatial Point Pattern Analysis"	""
 "Spatial Reference"	""
 "Spatial Reference System Files (*.srs)"	""
+"Spatial Reference System: %s"	""
 "Spatial and Geostatistics"	""
 "Spatial and Geostatistics|Grids"	""
 "Spatial and Geostatistics|Kriging"	""
@@ -4333,15 +4761,18 @@ TEXT	TRANSLATION
 "Spectral Angle Threshold (Degree)"	""
 "Spectral Information Divergence"	""
 "Speed (m/s)"	""
+"Speicherordner"	""
+"Speicherpfad der dynamischen Wassernutzungsdaten"	""
 "Spherical Harmonic Synthesis"	""
-"Spherical Model"	""
 "Spline"	""
 "Spline Interpolation"	""
 "Spline sensitivity, reduce to get smoother results, recommended: 80 < Tolerance < 200"	""
 "Split Channels"	""
 "Split Features"	""
+"Split Lines at Points"	""
 "Split Lines with Lines"	""
 "Split Parts"	""
+"Split Polygon Parts"	""
 "Split RGB Composite"	""
 "Split Shapes Layer"	""
 "Split Shapes Layer Completely"	""
@@ -4365,20 +4796,25 @@ TEXT	TRANSLATION
 "Standard Parallel"	""
 "Standard Score"	""
 "Standard deviation"	""
+"Standard deviation of the Gaussian filter [-]."	""
 "Standard kernel 3"	""
 "Standardisation"	""
 "Standardised Grid"	""
 "Standardize"	""
 "Standardized Height"	""
+"Start"	""
 "Start Degree"	""
 "Start Latitude"	""
 "Start Longitude"	""
-"Start Project"	""
 "Start Size"	""
+"Start Time"	""
 "Start Value"	""
 "Start Values"	""
+"Start [a BP]"	""
 "Start [ka]"	""
+"Start [years BP]"	""
 "Starting flood fill..."	""
+"Startup Project"	""
 "State t"	""
 "State t + 1"	""
 "Static table"	""
@@ -4389,20 +4825,30 @@ TEXT	TRANSLATION
 "Steepened escarpment"	""
 "Steepest gradient (first version)"	""
 "Steepest gradient (second version)"	""
+"Steepest_slope"	""
 "Stems"	""
 "Stems to Litter"	""
 "Step"	""
+"Step 1: Surface Gradient"	""
 "Step 1: low-pass of stripe"	""
+"Step 2: Concentration"	""
 "Step 2: low-pass between stripe and its surruondings"	""
+"Step [a]"	""
 "Step [ka]"	""
+"Step [years]"	""
 "Steps"	""
+"Steps 1+2: Surface, Gradient, Concentration"	""
 "Steps to Next"	""
 "Stepwidth"	""
 "Stereo Anaglyph"	""
 "Stereo Eye Distance [Degree]"	""
 "Stereo Match (OpenCV)"	""
 "Stereographic"	""
+"Stop"	""
+"Stop [a BP]"	""
+"Stop [h]"	""
 "Stop [ka]"	""
+"Stop [years BP]"	""
 "Stop at Edge"	""
 "Stop on Error"	""
 "Storage"	""
@@ -4413,6 +4859,7 @@ TEXT	TRANSLATION
 "Stratification"	""
 "Stream Order"	""
 "Stream Power Index"	""
+"Stream_channel_length_between_cells"	""
 "Streamflow (obs.) Column"	""
 "Streamflow Column"	""
 "Streams"	""
@@ -4433,6 +4880,7 @@ TEXT	TRANSLATION
 "Subtract Volumes Below Base Level"	""
 "Subtraction"	""
 "Successfully trained the network and predicted the values. Here comes the output."	""
+"Successive Flow Routing"	""
 "Suction"	""
 "Sudoku"	""
 "Sum"	""
@@ -4446,12 +4894,17 @@ TEXT	TRANSLATION
 "Sunrise"	""
 "Suns's Height"	""
 "Sunset"	""
-"Supervised Classification"	""
-"Supervised Classification for Polygons"	""
+"Supervised Classification for Grids"	""
+"Supervised Classification for Shapes"	""
+"Supervised Classification for Tables"	""
 "Support Vector Machine"	""
+"Suppress Negative Flow Accumulation Values"	""
 "Surface"	""
+"Surface Approximation Threshold"	""
 "Surface Area"	""
+"Surface Elevation"	""
 "Surface Specific Points"	""
+"Surface Water [m]"	""
 "Surface hydraulic conductivity [m/h]"	""
 "Surface roughness"	""
 "Surface used to derive the LDD network, e.g. a DTM."	""
@@ -4459,6 +4912,7 @@ TEXT	TRANSLATION
 "Surfer Blanking Files (*.bln)|*.bln|All Files|*.*"	""
 "Surfer Grid (*.grd)|*.grd|All Files|*.*"	""
 "Surfer's No Data Value"	""
+"Surrounding Air Temperature [�C]"	""
 "Swath Profile"	""
 "Swath Width"	""
 "Swath width measured in map units."	""
@@ -4473,10 +4927,15 @@ TEXT	TRANSLATION
 "Synchronize Map Extents"	""
 "Syntax error at position #%d: \n%s\n"	""
 "Synthesized Grid"	""
-"System"	""
+"T"	""
 "T Curvature"	""
+"T Height Correction"	""
+"T Offset"	""
 "T Slope"	""
 "T Vertical Distance to Channel Network"	""
+"T [ka BP]"	""
+"T max"	""
+"T min"	""
 "T, mean temperature [degree C]"	""
 "TCI Low"	""
 "TCc"	""
@@ -4503,7 +4962,6 @@ TEXT	TRANSLATION
 "TOPMODEL"	""
 "TOPMODEL - Simulation Output"	""
 "TOPOGRAPHY"	""
-"TOT_N"	""
 "TPI Based Landform Classification"	""
 "TYPE"	""
 "T_MELT("	""
@@ -4536,12 +4994,12 @@ TEXT	TRANSLATION
 "Target"	""
 "Target Area"	""
 "Target Areas"	""
+"Target Cell Size"	""
 "Target Cellsize"	""
 "Target Coordinate System Error"	""
 "Target Coordinate System Type Error"	""
 "Target Datum"	""
 "Target Datum Error"	""
-"Target Dimensions"	""
 "Target Grid"	""
 "Target Grid System"	""
 "Target Grid Type"	""
@@ -4555,6 +5013,7 @@ TEXT	TRANSLATION
 "Target X coordinate"	""
 "Target Y coordinate"	""
 "Tasseled Cap Transformation"	""
+"Temperatur offset"	""
 "Temperature"	""
 "Temperature (2pm) [DegreeC]"	""
 "Temperature Column"	""
@@ -4570,8 +5029,12 @@ TEXT	TRANSLATION
 "Temperature Threshold for Rainfall (lower bound)"	""
 "Temperature Threshold for Rainfall (upper bound)"	""
 "Temperature at Reference Station [Deg.Celsius]"	""
+"Temperature from Pressure Levels to Surface"	""
+"Template"	""
 "Template Menu|Template Sub Menu"	""
+"Template."	""
 "Templates"	""
+"Template|Template"	""
 "Temporary files"	""
 "Tension Threshold"	""
 "Tension Threshold [Percentage of Cell Size]"	""
@@ -4590,11 +5053,14 @@ TEXT	TRANSLATION
 "Terrain Map View"	""
 "Terrain Path Cross Sections"	""
 "Terrain Ruggedness Index (TRI)"	""
-"Terrain Surface Classification"	""
+"Terrain Surface Classification (Iwahashi and Pike)"	""
 "Terrain Surface Convexity"	""
 "Terrain Surface Texture"	""
 "Terrain View Factor"	""
 "Terrain parameters"	""
+"Test- und Monitoring-Routinen"	""
+"TestRoutine 1"	""
+"Testroutine1 durchfuehren... "	""
 "Text"	""
 "Text File"	""
 "Text Files"	""
@@ -4602,7 +5068,10 @@ TEXT	TRANSLATION
 "Text Replacements"	""
 "Text Table (*.txt)"	""
 "Text files (*.txt)"	""
+"Textdatei (*.txt)|*.txt|All Files|*.*"	""
+"Textdatei|*.txt|All Files|*.*"	""
 "Texture"	""
+"The (numeric) fields to calculate the statistics for."	""
 "The GDAL dataset to be created."	""
 "The GDAL datatype of the created dataset."	""
 "The GDAL raster format (driver) to be used."	""
@@ -4612,10 +5081,17 @@ TEXT	TRANSLATION
 "The SAGA grids to be exported."	""
 "The angle between the surface and the incoming light beams, measured in radians."	""
 "The areas used to train the neural network."	""
+"The attribute field to grid. Field numbers start with 1, so elevation is attribute field 3."	""
+"The attribute field to use as constraint. Field numbers start with 1."	""
+"The attribute field with the x-coordinate."	""
+"The attribute field with the y-coordinate."	""
+"The attribute field with the z-coordinate."	""
 "The attribute fields to cluster"	""
+"The attribute fields to convert, optional."	""
 "The attribute with the class IDs, used to link the table and the grid."	""
 "The base name of the tiles"	""
 "The buffer distance must be greater than or equal to the cell size!"	""
+"The calculated statistics."	""
 "The calculated terrain slope [radians]."	""
 "The class field used to classify the shape. All classes will be vectorized."	""
 "The clipped grid."	""
@@ -4623,6 +5099,7 @@ TEXT	TRANSLATION
 "The column holding the Y-coordinate."	""
 "The column holding the Z-coordinate."	""
 "The converted shapefile."	""
+"The cutted output point cloud dataset(s)."	""
 "The datatype to use for each field, separated by semicolon, e.g. \"2;2;3;\". The number equals the choice selection, see GUI version."	""
 "The decimal precision to use for each field, separated by semicolon, e.g. \"2;2;2;0\""	""
 "The delay after the start of rainfall, before the discharge starts to rise."	""
@@ -4638,21 +5115,30 @@ TEXT	TRANSLATION
 "The first grid to correlate"	""
 "The flow depth used to calculate the actual flow velocity [m] (e.g. 0.005 unchannelled flow, 0.01 shallow rills, 0.25 deeper rills."	""
 "The full path and name of the .spcvf file"	""
+"The full path and name of the spcvf tile info file describing the point cloud tiles without overlap"	""
 "The full path to which the output(s) should be written. Leave empty to output the datasets as grid list."	""
 "The full path to which the output(s) should be written. Leave empty to output the datasets as point cloud list."	""
+"The full path to which the point cloud tiles without overlap should be written."	""
 "The generated contour lines."	""
 "The grid coded with the class IDs."	""
 "The grid to clip."	""
 "The grid to filter."	""
 "The grid to modify."	""
 "The grids geo-reference must be related either to the center or the corner of its lower left grid cell."	""
+"The improved SIA model requires more than one smoothing iteration!"	""
+"The input line shapefile to smooth."	""
 "The input point cloud files to use"	""
 "The input table"	""
+"The input table."	""
 "The inverse selection is not implemented for input shapefiles with more than one polygon!"	""
+"The length of the Gaussian window is too small, please provide a larger sigma."	""
 "The merged point cloud."	""
 "The method used to identify surface specific points."	""
 "The name to use for each field, separated by semicolon, e.g. \"intensity;class;range\""	""
 "The number of days to model."	""
+"The number of smoothing iterations [-]."	""
+"The number of supplied grids exceeds the number of variables in formula."	""
+"The number of supplied grids is less than the number of variables in formula."	""
 "The numbers (starting from 1) of the fields to drop, separated by semicolon, e.g. \"5;8;9\""	""
 "The numbers (starting from 1) of the fields to export, separated by semicolon, e.g. \"1;2;3;5\""	""
 "The numbers (starting from 1) of the fields to import, separated by semicolon, e.g. \"5;6;8\""	""
@@ -4660,8 +5146,11 @@ TEXT	TRANSLATION
 "The output grids, one grid for each table column."	""
 "The output point cloud"	""
 "The output point cloud(s)"	""
+"The output point cloud."	""
 "The output table"	""
+"The parameter controls the position of relative height maxima as a function of slope."	""
 "The point cloud to export."	""
+"The radius in map units"	""
 "The resulting grid gives the altitude above the channel network in the same units as the elevation data."	""
 "The resulting table inherits its field structure from the first table in this list."	""
 "The second DTM used to assign height information to grid 2"	""
@@ -4669,9 +5158,12 @@ TEXT	TRANSLATION
 "The shaded DTM."	""
 "The shapefile to convert."	""
 "The shapefile to use for clipping."	""
+"The smoothed output line shapefile."	""
+"The smoothing preservation factor [-]."	""
 "The table with the (numeric) data values for each class. The module creates a grid for each table column (besides the ID)."	""
 "The terrain exaggeration factor allows to increase the shading contrasts in flat areas."	""
 "The transmittance of the atmosphere, usually between 60 and 80 percent."	""
+"The transparency of the shade [%]"	""
 "The unobstructed hemisphere given as percentage."	""
 "The value to apply."	""
 "The values in the specified radius is used in the average calculation only if its difference with the central value is lesser or equal to this threshold."	""
@@ -4688,12 +5180,13 @@ TEXT	TRANSLATION
 "These are the probabilities for the winner classes given by the neural network."	""
 "These are the winner class vectors."	""
 "Thiam's Transformed Vegetation Index"	""
+"Thickness_of_uppermost_rock_layer"	""
 "Thiessen Polygons"	""
-"Thin Plate Spline (Global)"	""
-"Thin Plate Spline (Local)"	""
+"Thin Plate Spline"	""
 "Thin Plate Spline (TIN)"	""
 "Thin Plate Spline: solving matrix"	""
 "Thinned Points"	""
+"This Color"	""
 "This Is Not A Caption!"	""
 "This grid indicates the cells you want calculate the average."	""
 "This grid is used to select cells."	""
@@ -4716,6 +5209,7 @@ TEXT	TRANSLATION
 "This will contain your output data of type grid."	""
 "This will contain your output data of type shapes."	""
 "Thomas Schorr (c) 2007"	""
+"Thread"	""
 "Threshold"	""
 "Threshold (Grid Units)"	""
 "Threshold (Init.)"	""
@@ -4724,7 +5218,9 @@ TEXT	TRANSLATION
 "Threshold Error"	""
 "Threshold Grid"	""
 "Threshold Height"	""
+"Threshold Infected"	""
 "Threshold Linear Flow"	""
+"Threshold Sickness"	""
 "Threshold Type"	""
 "Threshold [Percent]"	""
 "Threshold for Elevation Percentile (Lowness)"	""
@@ -4734,6 +5230,7 @@ TEXT	TRANSLATION
 "Threshold for different route"	""
 "Threshold for linear flow, if exceeded D8 is used."	""
 "Threshold for plane"	""
+"Threshold for sediment motion"	""
 "Thresholded Linear Flow"	""
 "Thresholds"	""
 "Thumbnail Size"	""
@@ -4742,6 +5239,7 @@ TEXT	TRANSLATION
 "Tiempo de inicio (min)"	""
 "Tiempo de simulacion (min)"	""
 "Tile Horizontally"	""
+"Tile Info File"	""
 "Tile Size (X)"	""
 "Tile Size (Y)"	""
 "Tile Size Definition"	""
@@ -4758,7 +5256,7 @@ TEXT	TRANSLATION
 "Time Difference between Image & Points"	""
 "Time Field"	""
 "Time Interval [a]"	""
-"Time Out (h)"	""
+"Time Out [min]"	""
 "Time Out(h)"	""
 "Time Period"	""
 "Time Range"	""
@@ -4769,20 +5267,30 @@ TEXT	TRANSLATION
 "Time Span [a]"	""
 "Time Span [h]"	""
 "Time Stamp without date"	""
+"Time Step"	""
 "Time Step [h]"	""
+"Time Step [kyr]"	""
 "Time [a]"	""
 "Time interval is to large for a stable solution."	""
+"Time of Concentration [min]"	""
+"Time of Concentration [min] used to estimate flow speed."	""
 "Time span used for the calculation of daily radiation sums."	""
 "Time stamp of Image"	""
+"Time step exceeds duration"	""
+"Time step size (yrs)"	""
 "Time step size for a day's calculation given in hours."	""
 "Time step size for a range of days calculation given in days."	""
+"Times"	""
 "Timespan (days)"	""
 "Tip of the Day..."	""
 "Tissot's Indicatrix"	""
+"To"	""
 "Tolerance"	""
 "Tolerance (Degree)"	""
 "Tolerance [Degree]"	""
 "Tool"	""
+"Tool Chain"	""
+"Tool Chain with Header"	""
 "Tool Chains"	""
 "Tool Description Source"	""
 "Tool Execution"	""
@@ -4792,12 +5300,15 @@ TEXT	TRANSLATION
 "Tool Set"	""
 "Tool execution failed"	""
 "Tool execution succeeded"	""
+"Toolbox Naming"	""
 "Tools"	""
 "Tools for (grid based) digital terrain analysis."	""
 "Tools for GPS data handling."	""
+"Tools for Soil."	""
 "Tools for Triangulated Irregular Network (TIN) processing."	""
 "Tools for digital terrain analysis."	""
 "Tools for lines."	""
+"Tools for managing weather and climate data."	""
 "Tools for point clouds."	""
 "Tools for polygons."	""
 "Tools for regression analyses."	""
@@ -4830,6 +5341,7 @@ TEXT	TRANSLATION
 "Topography"	""
 "Topograpic Wetness Index Calculation"	""
 "Total"	""
+"Total Catchment Area"	""
 "Total Catchment Area (TCA)"	""
 "Total Catchment Area [km2]"	""
 "Total Curvature"	""
@@ -4841,6 +5353,10 @@ TEXT	TRANSLATION
 "Total flow [m/dt]"	""
 "Total insolation, the sum of direct and diffuse incoming solar radiation."	""
 "Total memory size"	""
+"Total number of points: %s"	""
+"Total number of referenced datasets: %d"	""
+"Tracer"	""
+"Tracer Lines"	""
 "Tracing: Convergence"	""
 "Tracing: Max. Divergence"	""
 "Tracing: Stop after x cells with divergent flow"	""
@@ -4848,6 +5364,7 @@ TEXT	TRANSLATION
 "Track"	""
 "Train INPUT"	""
 "Training Areas"	""
+"Training Classes"	""
 "Training Options"	""
 "Training method"	""
 "Transactions"	""
@@ -4862,6 +5379,7 @@ TEXT	TRANSLATION
 "Transformed Soil Adjusted Vegetation Index (Baret et al. 1989)"	""
 "Transformed Vegetation Index"	""
 "Transitional"	""
+"Translatable Elements"	""
 "Translation"	""
 "Translation X"	""
 "Translation Y"	""
@@ -4871,12 +5389,15 @@ TEXT	TRANSLATION
 "Transmissivity"	""
 "Transparency [%]"	""
 "Transparent"	""
+"Transport"	""
 "Transport Capacity Clay"	""
 "Transport Capacity Sand"	""
 "Transport Capacity Silt"	""
 "Transport Condition Clay"	""
 "Transport Condition Sand"	""
 "Transport Condition Silt"	""
+"Transport Function"	""
+"Transportation Depth"	""
 "Transpose Grids"	""
 "Transpose Table"	""
 "Transposed Grids"	""
@@ -4906,6 +5427,7 @@ TEXT	TRANSLATION
 "Type of Slope"	""
 "Type of distance calculation"	""
 "Type of smoothing"	""
+"Type=\"%s\""	""
 "U-shaped Valleys"	""
 "UNRECOGNISED COMMAND ID"	""
 "USGS SRTM Grids (*.hgt)|*.hgt|All Files|*.*"	""
@@ -4921,22 +5443,24 @@ TEXT	TRANSLATION
 "Unable to open output file %s!"	""
 "Unable to read points from LAS file!"	""
 "Unable to save %s file!"	""
+"Unable to save file %s!"	""
 "Unclassified"	""
 "Uncond. stable"	""
 "Uncond. unstable"	""
 "Undefined"	""
 "Undefined Coordinate System"	""
+"Undefined or binary attribute field types are not supported!"	""
 "Underdip slope"	""
 "Undetermined"	""
 "Uniform"	""
 "Union"	""
 "Unique"	""
+"Unique Production Rate [m/h]"	""
 "Unit"	""
 "Unit Name"	""
 "Units"	""
 "Units for output radiation values."	""
 "Universal Kriging"	""
-"Universal Kriging (Global)"	""
 "Universal Transvers Mercator (UTM)"	""
 "Unknown"	""
 "Unknown Error"	""
@@ -4949,10 +5473,10 @@ TEXT	TRANSLATION
 "Up"	""
 "Up [-]"	""
 "Up [Home]"	""
-"Up-Scaling"	""
 "Up/Down"	""
 "Update"	""
 "Update Data"	""
+"Update Frequency"	""
 "Update Raster SRID"	""
 "Update Shapes SRID"	""
 "Update View"	""
@@ -4965,14 +5489,24 @@ TEXT	TRANSLATION
 "Upland Drainages"	""
 "Upland Drainages, Headwaters"	""
 "Upper"	""
+"Upper Half"	""
 "Upper Slopes"	""
 "Upper Slopes, Mesas"	""
 "Upper Tolerance"	""
+"Uppermost Rock Type"	""
+"Uppermost Rock Type Thickness"	""
+"Upscaling Method"	""
 "Upslope Area"	""
 "Upslope Basins"	""
+"Upslope Curv UnNormalized"	""
+"Upslope Curvature"	""
+"Upslope Curvature Normalized"	""
+"Upslope Curvatures"	""
 "Upslope Flow Width"	""
 "Upslope Length Factor"	""
 "Upslope Slope"	""
+"Upslope Weighting"	""
+"Upslope and Downslope Curvature"	""
 "Urban"	""
 "Use 5 percent confidence interval"	""
 "Use Confidence Interval"	""
@@ -4985,7 +5519,7 @@ TEXT	TRANSLATION
 "Use Target Area Polygon"	""
 "Use Z-Range"	""
 "Use a user-specified elevation range instead of min/max of the input dataset"	""
-"Use old style namings (e.g. 'modules' instead of 'tools'). Ignored if translation file is used. You need to restart SAGA to apply changes."	""
+"Use old style namings (e.g. 'modules' instead of 'tools'). Ignored if translation file is used. You need to restart SAGA to apply the changes."	""
 "Use only features selected by the minimum Redundancy Maximum Relevance (mRMR) algorithm"	""
 "Use only seed cells as starting points."	""
 "Use sky view factor based on local slope (after Oke 1988), if no sky viev factor grid is given."	""
@@ -5006,14 +5540,14 @@ TEXT	TRANSLATION
 "User Defined Polynomial"	""
 "User Defined Size"	""
 "User Name"	""
-"User defined"	""
 "User defined NoData value for output grid."	""
 "User defined Orientation"	""
 "User defined Zero Direction"	""
-"User defined grid"	""
 "User defined range"	""
 "User defined rank"	""
 "User defined rescale"	""
+"User defined tool menus"	""
+"User defined tool menus."	""
 "User specified elevation range"	""
 "Username"	""
 "Using temperature data?"	""
@@ -5021,9 +5555,11 @@ TEXT	TRANSLATION
 "V / GR"	""
 "V / V"	""
 "V / X"	""
+"V. Olaya, V. Wichmann (c) 2004-2015"	""
 "V. Wichmann (c) 2013"	""
 "V. Wichmann, M. Setiawan (c) 2009-2012"	""
 "V.Olaya (c) 2004, O.Conrad (c) 2011"	""
+"V.Olaya (c) 2004, V.Wichmann (c) 2015"	""
 "VALUE"	""
 "VAR"	""
 "VARIANCE"	""
@@ -5061,6 +5597,7 @@ TEXT	TRANSLATION
 "Van der Grinten"	""
 "Var.cum."	""
 "Variable"	""
+"Variables to Import"	""
 "Variance"	""
 "Variance (version 1)"	""
 "Variance (version 2)"	""
@@ -5068,7 +5605,7 @@ TEXT	TRANSLATION
 "Variance in Feature Space"	""
 "Variance in Position Space"	""
 "Variogram"	""
-"Variogram (Dialog))"	""
+"Variogram (Dialog)"	""
 "Variogram Cloud"	""
 "Variogram Model"	""
 "Variogram Settings"	""
@@ -5086,6 +5623,8 @@ TEXT	TRANSLATION
 "Vegetation parameters"	""
 "Velocidad del viento"	""
 "Velocidad del viento (km/h)"	""
+"Velocity"	""
+"Velocity Calculation"	""
 "Verbose"	""
 "Verbose Messages"	""
 "Verbose Output"	""
@@ -5103,10 +5642,13 @@ TEXT	TRANSLATION
 "Vertical Overland Flow Distance"	""
 "Vertical Range"	""
 "Vertical Scaling"	""
+"Vertical Tracer Density"	""
 "Vertical hatch"	""
 "Vertical scaling factor"	""
 "Vertically mirrored"	""
 "Vertices"	""
+"Vertikale Zufluesse"	""
+"Verwitterungsformeln"	""
 "ViGrA"	""
 "Victor Olaya (c) 2004"	""
 "Victor Olaya (c) 2005"	""
@@ -5136,6 +5678,9 @@ TEXT	TRANSLATION
 "WARNING: %d invalid points skipped!"	""
 "WARNING: Skipping misformatted line: %d!"	""
 "WARNING: selected attribute is not numeric; generating unique identifiers instead."	""
+"WARNING: skipping non-numeric field '%s'!"	""
+"WARNING: smoothing sensitivity is greater than the number of iterations!"	""
+"WARNING: unable to smooth line because Gaussian window too large (number of line vertices too small or sigma too big)."	""
 "WASP Map Files (*.map)"	""
 "WEDGEFAIL"	""
 "WETNESS"	""
@@ -5144,10 +5689,16 @@ TEXT	TRANSLATION
 "WHITE_RED"	""
 "WKT Files (*.wkt)"	""
 "WKT Import"	""
+"WKT: %s"	""
 "WMS Import"	""
 "WMS Map"	""
+"WRF Extract Data"	""
+"WRF Extract and Downscale to DEM"	""
+"WUse Einheit"	""
 "W_up"	""
 "Wa-Tor"	""
+"Waehlen ob TestRoutine 1 durchgefuehrt werden soll... 1) nur fuer Teileinzugsgebiet der HG-Rasterzelle oder 2) fuer das Flusseinzugsgebiet bis zum Erreichen der HG-Rasterzelle."	""
+"Wang/Liu"	""
 "Warm Cloud"	""
 "Warning"	""
 "Warning: there are more predictor variables then dependent ones, surplus will be ignored."	""
@@ -5155,14 +5706,21 @@ TEXT	TRANSLATION
 "Water"	""
 "Water Content [cm]"	""
 "Water Retention Capacity"	""
+"Water Surface Exaggeration"	""
 "Water Vapour Pressure [mbar]"	""
 "Water content change across the wetting front"	""
 "Water content of a vertical slice of atmosphere in cm: 1.5 to 1.7, average=1.68"	""
+"Water_discharge"	""
 "Watershed Basins"	""
 "Watershed Basins (Extended)"	""
 "Watershed Segmentation"	""
 "Watershed Segmentation (ViGrA)"	""
 "Weather Records"	""
+"Weathering"	""
+"Weathering Formulas"	""
+"Weathering Variables"	""
+"Weathering rate decay constant (1/m)"	""
+"Weathering threshold area"	""
 "Web Service Data Access"	""
 "Weight"	""
 "Weight for grid "	""
@@ -5174,6 +5732,7 @@ TEXT	TRANSLATION
 "Weights"	""
 "Well Known Text File"	""
 "Well Known Text Format (*.wkt)"	""
+"Well Known Text file error"	""
 "West"	""
 "West []"	""
 "West-East"	""
@@ -5207,7 +5766,12 @@ TEXT	TRANSLATION
 "Winterweizen"	""
 "Wire Frame Color"	""
 "Wischmeier & Smith 1978"	""
+"Wombling (Edge Detection)"	""
+"Wombling Direction"	""
+"Wombling Magnitude"	""
 "Wood Fuel Moisture"	""
+"World File"	""
+"World File from Flight and Camera Settings"	""
 "Write Field Names"	""
 "Write Header"	""
 "Write all calculated Time Series in a table?"	""
@@ -5238,6 +5802,8 @@ TEXT	TRANSLATION
 "X11 Pixel Map"	""
 "XML Files"	""
 "XML Files (*.xml)"	""
+"XMax: %.6f"	""
+"XMin: %.6f"	""
 "XYZ Files (*.xyz)"	""
 "XYZ files (*.xyz)"	""
 "Y"	""
@@ -5264,8 +5830,13 @@ TEXT	TRANSLATION
 "YELLOW_BLUE"	""
 "YELLOW_GREEN"	""
 "YELLOW_RED"	""
+"YMax: %.6f"	""
+"YMin: %.6f"	""
 "Year"	""
+"Year [ka BP]"	""
 "Year [ka]"	""
+"Years BP"	""
+"Yoshimasa Tsuruoka"	""
 "You can specify the number of layers in the network (including input and output layer)."	""
 "You can specify the number of neurons in each layer of the network."	""
 "You canceled printing"	""
@@ -5276,23 +5847,32 @@ TEXT	TRANSLATION
 "Z"	""
 "Z Attribute"	""
 "Z Axis"	""
+"Z Model"	""
 "Z Multiplier"	""
 "Z Value"	""
 "Z Values"	""
 "Z is Column ..."	""
+"Z+S Model"	""
 "Z-Offset"	""
 "Z-Range"	""
 "Z-Rotation"	""
 "Z-Scale"	""
+"ZMax"	""
+"ZMax: %.6f"	""
+"ZMin"	""
+"ZMin: %.6f"	""
 "ZONE"	""
+"Z_Model"	""
 "Zenith"	""
 "Zero"	""
 "Zevenbergen & Thorne"	""
 "Zevenbergen & Thorne (1987) refer to this as plan curvature"	""
 "Zevenbergen & Thorne (1987) refer to this as profile curvature"	""
+"Zonal Multiple Regression Analysis (Points and Predictor Grids)"	""
 "Zonal Statistics"	""
 "Zone"	""
 "Zone Grid"	""
+"Zones"	""
 "Zoom"	""
 "Zoom To Active Layer"	""
 "Zoom To Extent"	""
@@ -5326,12 +5906,8 @@ TEXT	TRANSLATION
 "[VAL] Bilinear"	""
 "[VAL] Inverse Distance"	""
 "[VAL] None"	""
-"[deprecated] Ordinary Kriging"	""
-"[deprecated] Ordinary Kriging (Global)"	""
 "[deprecated] Point Cloud Viewer"	""
 "[deprecated] TIN Viewer"	""
-"[deprecated] Universal Kriging"	""
-"[deprecated] Universal Kriging (Global)"	""
 "[not set]|"	""
 "\n** Error : Invalid parameters **\n"	""
 "\nError: Please verify your xMin, yMin, xMax, yMax settings!\n"	""
@@ -5343,6 +5919,33 @@ TEXT	TRANSLATION
 "\nValue of Target Function"	""
 "\n\n ** Error : Could not close PDF engine ** \n\n"	""
 "\n\n ** Error : Could not save PDF file ** \n\n"	""
+"_TL"	""
+"__ACHAN__"	""
+"__C0__"	""
+"__CHANA__"	""
+"__DOWNWT__"	""
+"__DX__"	""
+"__KCI__"	""
+"__KC__"	""
+"__KDP__"	""
+"__KT__"	""
+"__MB__"	""
+"__MCI__"	""
+"__MDP__"	""
+"__MF__"	""
+"__MW__"	""
+"__NB__"	""
+"__NCI__"	""
+"__NF__"	""
+"__OPTDIFF__"	""
+"__OPTTRANS__"	""
+"__PF__"	""
+"__PMA__"	""
+"__PPT__"	""
+"__SCR__"	""
+"__TAUC__"	""
+"__TCI__"	""
+"__WRTINT__"	""
 "a * b"	""
 "a + b * (1 - exp(-(x / c)^2))"	""
 "a + b * (1 - exp(-x / c))"	""
@@ -5355,6 +5958,7 @@ TEXT	TRANSLATION
 "a(s)"	""
 "a(s) [lower bound]"	""
 "a(s) [upper bound]"	""
+"abort"	""
 "abort export"	""
 "absolute"	""
 "absolute catchment area"	""
@@ -5364,9 +5968,9 @@ TEXT	TRANSLATION
 "accufractionflux / state"	""
 "accuthresholdflux / state"	""
 "accutriggerflux / state"	""
+"add"	""
 "add buffer (map units) to extent"	""
 "add to current selection"	""
-"add value"	""
 "added"	""
 "adjusted"	""
 "after"	""
@@ -5386,12 +5990,14 @@ TEXT	TRANSLATION
 "already in transaction"	""
 "alternating scale bar"	""
 "alternative"	""
-"analyzing known classes"	""
+"always ask what to do"	""
 "angle calculation is only available when exact two features are compared"	""
 "another grid"	""
+"append"	""
 "append records, if table structure allows"	""
 "appending to existing table"	""
-"apply linear flow routing (D8) to all cells, having a catchment area greater than the specified threshold"	""
+"apply coordinate transformation if appropriate"	""
+"apply linear flow routing (D8) to all cells, having a flow accumulation greater than the specified threshold"	""
 "approximating points..."	""
 "are completely within"	""
 "are in the specified directory.\n"	""
@@ -5410,8 +6016,11 @@ TEXT	TRANSLATION
 "attribute is identical with search expression"	""
 "attribute to be searched; if not set all attributes will be searched"	""
 "author      "	""
-"automatically save and load"	""
+"automatically"	""
 "average"	""
+"average size of the area covered by each category that occurs within search area"	""
+"averages"	""
+"averages + standard deviations"	""
 "avoids precision problems when source and target crs use different geodedtic datums."	""
 "b(q)"	""
 "b(q) [lower bound]"	""
@@ -5422,6 +6031,7 @@ TEXT	TRANSLATION
 "band width smoothing"	""
 "bar"	""
 "bar (not outlined)"	""
+"basic SIA model"	""
 "before"	""
 "begin transaction command failed"	""
 "bi-linear saddle"	""
@@ -5437,10 +6047,12 @@ TEXT	TRANSLATION
 "blending distance given in map units"	""
 "blue channel color"	""
 "bm"	""
+"both"	""
 "bottom"	""
 "bottom / left"	""
 "bottom left"	""
 "bottom right"	""
+"bottom up"	""
 "bright - dark"	""
 "built-in"	""
 "c, Percentage clays [%]"	""
@@ -5452,11 +6064,11 @@ TEXT	TRANSLATION
 "calculating variance"	""
 "cartesian"	""
 "catchment area and slope..."	""
-"catchment area threshold (cells) for linear flow routing"	""
 "catchment length (square root of catchment area)"	""
 "catchment slope"	""
 "catchment specific parameter for sediment delivery ratio calculation"	""
 "categorical"	""
+"category and library name"	""
 "cell"	""
 "cell area"	""
 "cells"	""
@@ -5468,7 +6080,6 @@ TEXT	TRANSLATION
 "center cell's aspect direction"	""
 "central"	""
 "change"	""
-"character string"	""
 "check for building parts failed"	""
 "check this in case parameter 'water' is absolute water level"	""
 "check this in case seed cells are coded with absolute water level"	""
@@ -5487,30 +6098,40 @@ TEXT	TRANSLATION
 "classification"	""
 "clay content given as percentage"	""
 "clean inner rings"	""
+"clip extent does not match extent of input grids"	""
 "clip extent does not match grid's extent"	""
 "clip features"	""
 "clipped"	""
 "clockwise"	""
+"closed"	""
 "closing"	""
 "coef0"	""
 "coef0 in kernel function"	""
+"collecting background data"	""
+"collecting elements"	""
+"collecting presence data"	""
 "color"	""
-"color (rgb)"	""
 "colors"	""
 "columns"	""
 "comma"	""
 "comma (,)"	""
+"command execution failed"	""
 "commit"	""
 "commit transaction command failed"	""
 "complete input times near points matrix"	""
 "completely contain"	""
 "completely contained"	""
+"concavity"	""
 "confirm"	""
 "confirm with options"	""
+"conrad"	""
 "constant direction into the wind blows, given as degree"	""
 "contain the centeroid of"	""
 "continue"	""
 "continuous"	""
+"conventional eight-neihbourhood"	""
+"conventional four-neighbourhood"	""
+"convexity"	""
 "coordinates (offset, range, cell size, tile size)"	""
 "copying"	""
 "copyrights (c) 2006 Stefan Liersch"	""
@@ -5520,7 +6141,9 @@ TEXT	TRANSLATION
 "corrupted file header"	""
 "corrupted record header"	""
 "corrupted shapefile."	""
+"could allocate memory for scaled grid"	""
 "could not add save point"	""
+"could not allocate memory for temporary grid."	""
 "could not allocate sufficient memory"	""
 "could not commit/rollback transactions."	""
 "could not connect ODBC source"	""
@@ -5536,19 +6159,24 @@ TEXT	TRANSLATION
 "could not disconnect PostgreSQL source"	""
 "could not execute module"	""
 "could not execute tool"	""
+"could not find any band data"	""
+"could not find level data"	""
 "could not find module"	""
 "could not find tool"	""
 "could not import random forest"	""
+"could not initialize classifier from file"	""
+"could not initialize classifier from training areas"	""
 "could not initialize cluster engine"	""
 "could not initialize data objects"	""
+"could not initialize kernel"	""
 "could not initialize module"	""
-"could not initialize point search engine"	""
 "could not initialize reference point search engine"	""
 "could not initialize search engine for hills"	""
 "could not initialize search engine for valleys"	""
 "could not initialize search kernel"	""
 "could not initialize tool"	""
 "could not load file"	""
+"could not load model from file"	""
 "could not locate line string to polygon conversion tool"	""
 "could not open GetMap stream"	""
 "could not open data source"	""
@@ -5563,6 +6191,7 @@ TEXT	TRANSLATION
 "could not save shape"	""
 "could not start transaction"	""
 "counterclockwise"	""
+"counting cells"	""
 "create data source"	""
 "create from training areas"	""
 "create layer"	""
@@ -5571,16 +6200,15 @@ TEXT	TRANSLATION
 "creating batch file example"	""
 "creating interpolator"	""
 "creating tool documentation files"	""
+"critical slope"	""
 "cross"	""
 "cubic convolution"	""
 "cubic surface"	""
 "cyan - white"	""
 "dX"	""
 "dX (Map Units)"	""
-"dX(GridUnits)"	""
 "dY"	""
 "dY (Map Units)"	""
-"dY(GridUnits)"	""
 "dZ"	""
 "dZ (Map Units)"	""
 "dark - bright"	""
@@ -5591,10 +6219,10 @@ TEXT	TRANSLATION
 "dark object subtraction 4"	""
 "data / no-data"	""
 "data file could not be openend"	""
+"data file does not exist"	""
 "data set has no attributes"	""
 "database table does not exist"	""
 "date"	""
-"date (dd.mm.yyyy)"	""
 "day"	""
 "dbf read: could not open file"	""
 "dbf read: could not read header"	""
@@ -5608,6 +6236,7 @@ TEXT	TRANSLATION
 "default (same brightness)"	""
 "default value if no attribute has been selected"	""
 "default value if no grid has been selected"	""
+"defines the maximum resolution [km] for the re-projected distance segments"	""
 "degree"	""
 "degree in kernel function"	""
 "degree to radians"	""
@@ -5615,7 +6244,11 @@ TEXT	TRANSLATION
 "delete data source"	""
 "delete feature"	""
 "delete layer"	""
+"delivery index calculation failed"	""
 "descending"	""
+"diffuse pollution risk calculation failed"	""
+"diffusive"	""
+"diffusive and fluvial"	""
 "digital elevation model"	""
 "digital elevation model [m]"	""
 "digitzing a polygon"	""
@@ -5647,6 +6280,8 @@ TEXT	TRANSLATION
 "edge detection"	""
 "edge of flight line flag"	""
 "effective flow length"	""
+"eight-neihbourhood"	""
+"eight-neihbourhood (distance based weighting)"	""
 "elevation"	""
 "elevation and roughness"	""
 "elevation threshold used to identify hills/valleys"	""
@@ -5668,7 +6303,6 @@ TEXT	TRANSLATION
 "error saving index file"	""
 "exclude range"	""
 "executing tool"	""
-"existing grid system"	""
 "expand"	""
 "expand and shrink"	""
 "expected"	""
@@ -5676,7 +6310,6 @@ TEXT	TRANSLATION
 "explained cumulative variance"	""
 "explained variance"	""
 "exponential"	""
-"exponential weighting scheme"	""
 "export grid"	""
 "extent of lake, coded with local water depth"	""
 "extent of lake, coded with water depth"	""
@@ -5689,19 +6322,29 @@ TEXT	TRANSLATION
 "failed to estimate target extent"	""
 "failed to initialise search engine"	""
 "failed to initialize target grid"	""
+"failed to launch default application"	""
+"failed to load KML ground overlay icon"	""
+"failed to load data"	""
+"failed to load file"	""
+"failed to load georeference for KML ground overlay"	""
+"failed to load or parse xml file"	""
 "failed to project target grid"	""
 "failed to set radius"	""
 "failed: could not find a suitable import driver"	""
 "fat"	""
 "feathering"	""
+"feature has been dropped"	""
 "feature space"	""
 "feature space and position"	""
 "field cannot be mapped to binary object"	""
+"fields layer does not contain any records"	""
 "file could not be opened"	""
 "file could not be opened."	""
 "file does not exist."	""
 "file not found"	""
 "file path, name and type used to save frames to image files"	""
+"fill sinks permanently"	""
+"fill sinks temporarily"	""
 "find inner rings"	""
 "find local minima"	""
 "first"	""
@@ -5720,21 +6363,28 @@ TEXT	TRANSLATION
 "fixed value"	""
 "floating"	""
 "floating point"	""
+"flow accumulation threshold (cells) for linear flow routing"	""
 "flow depth [m] for flow travel time estimation"	""
 "flow directions..."	""
 "flow travel time to channel expressed in hours based on Manning's Equation"	""
 "flow width (original)"	""
+"fluvial"	""
 "forward"	""
+"found less than two categories, nothing to do"	""
+"four-neighbourhood"	""
+"from line center"	""
 "from list"	""
 "full frame"	""
 "function fitting failed !"	""
 "function not found"	""
+"function parameters"	""
+"function parameters + trend quality"	""
 "function table full"	""
 "gamma in kernel function"	""
+"gaps filled"	""
 "gaussian"	""
 "gaussian kernel"	""
 "gaussian weighting"	""
-"gaussian weighting scheme"	""
 "geographical"	""
 "give output of an edge twice, i.e. once for each of the two adjacent polygons"	""
 "given as map units or meters if polar coordinates switch is on; ignored if set to zero"	""
@@ -5772,7 +6422,9 @@ TEXT	TRANSLATION
 "hh:mm:ss"	""
 "hhmmss, fix size"	""
 "high"	""
+"highest"	""
 "highest z"	""
+"hillslope length-to-channel"	""
 "histogram match"	""
 "horizontal"	""
 "hours"	""
@@ -5788,6 +6440,7 @@ TEXT	TRANSLATION
 "immediate"	""
 "importing line strings"	""
 "improper function syntax"	""
+"improved SIA model"	""
 "in the formula these grids are addressed in order of the list as 'g1, g2, g3, ...'"	""
 "in the formula these grids are addressed in order of the list as 'h1, h2, h3, ...'"	""
 "include all"	""
@@ -5800,12 +6453,16 @@ TEXT	TRANSLATION
 "index file could not be opened"	""
 "index number"	""
 "index out of bounds"	""
+"index out of range"	""
+"initial map window arrangement after a project is loaded"	""
 "initial number of lag distance classes"	""
+"initial number of lag distance classes for variogram estimation"	""
 "initialisation error"	""
 "initialising gradient..."	""
 "initialising planetary bending..."	""
 "initialization"	""
-"initializing"	""
+"initialization failed"	""
+"initialize grid cells"	""
 "input"	""
 "input file"	""
 "instable (thawing)"	""
@@ -5825,6 +6482,7 @@ TEXT	TRANSLATION
 "invalid control points"	""
 "invalid data"	""
 "invalid division size"	""
+"invalid features"	""
 "invalid field selection"	""
 "invalid file code"	""
 "invalid filter matrix"	""
@@ -5849,7 +6507,9 @@ TEXT	TRANSLATION
 "invalid project file."	""
 "invalid snap features"	""
 "invalid table"	""
+"invalid target grid"	""
 "invalid tool definition"	""
+"invalid training data"	""
 "invalid user specified value range."	""
 "invalid utm zone"	""
 "invalid word size"	""
@@ -5858,15 +6518,24 @@ TEXT	TRANSLATION
 "inverse transformation not available"	""
 "is ignored if set to zero"	""
 "j-shaped"	""
+"ja; bestimmen anhand eines Hauptgerinnerasters (HG Raster)"	""
+"ja; bestimmen ueber das Wasserflussvolumen (P:RFlow)"	""
+"ja; bestimmen ueber die jeweilige Anzahl der ZuflussRasterzellen (IR:NumInFlowCells, P:NumCells"	""
 "k factor"	""
 "k-fold"	""
+"keep accumulated weights above zero; useful e.g. when accumulating measures of water balance."	""
 "keep maxima (with tolerance)"	""
 "keep minima (with tolerance)"	""
 "keep original line attributes"	""
+"keine"	""
+"kernel size defined as radius number of cells"	""
+"kml and image files"	""
+"kmz file"	""
+"kmz, kml and image files"	""
 "label minima"	""
 "last"	""
-"last opened"	""
 "last point"	""
+"last state"	""
 "last value"	""
 "layer uses undefined coordinate system, assuming geographic coordinates"	""
 "learning"	""
@@ -5874,17 +6543,18 @@ TEXT	TRANSLATION
 "least squares fitted plane (Horn 1981, Costa-Cabral & Burgess 1996)"	""
 "leave one out"	""
 "left"	""
+"less than two classes in model"	""
 "less than two polygons in layer, nothing to do!"	""
 "level"	""
 "level 1"	""
 "level 2"	""
 "library     "	""
+"library file name"	""
 "library name"	""
 "library path"	""
 "line simplification can only be applied to lines and polygons"	""
 "linear"	""
 "linear: u'*v\npolynomial: (gamma*u'*v + coef0)^degree\nradial basis function: exp(-gamma*|u-v|^2)\nsigmoid: tanh(gamma*u'*v + coef0)"	""
-"linearly decreasing within search radius"	""
 "lines"	""
 "lines with same attribute value(s)"	""
 "list order"	""
@@ -5910,11 +6580,15 @@ TEXT	TRANSLATION
 "lower cell's value to neighbours minimum value minus epsilon"	""
 "lower left and upper right center coordinates"	""
 "lower left and upper right corner coordinates"	""
+"lowest"	""
 "lowest z"	""
 "m"	""
 "m2"	""
 "m2/h"	""
-"m_Flow Path Length"	""
+"m3/Monat"	""
+"m3/s"	""
+"m_pBoundary"	""
+"m_pRock_Top_Idx"	""
 "magenta - white"	""
 "main basins..."	""
 "majority"	""
@@ -5934,6 +6608,8 @@ TEXT	TRANSLATION
 "max_sd"	""
 "maxima of variance"	""
 "maximum"	""
+"maximum difference between original and median filtered elevation (3x3 moving window) that still is recognized flat"	""
+"maximum distance for variogram estimation"	""
 "maximum number of calculated first components; set to zero to get all"	""
 "maximum number of iterations, ignored if set to zero (default)"	""
 "maximum number of nearest points"	""
@@ -5960,21 +6636,28 @@ TEXT	TRANSLATION
 "minima of variance"	""
 "minimum"	""
 "minimum number of points to use"	""
+"minimum number of upslope contributing cells to start a channel"	""
 "minimum requirement"	""
 "minimum slope angle preserved from one cell to the next, zero results in flat areas [Degree]"	""
+"minimum sub-time step size in years"	""
 "minimum value"	""
 "minimum value of all duplicates"	""
 "minimum x value"	""
 "minimum y value"	""
 "minutes"	""
+"missing icon tags"	""
 "missing operand"	""
+"missing tool chain tags"	""
+"missing year"	""
 "model application"	""
 "model creation"	""
 "moment"	""
+"month"	""
 "more than one field in selection"	""
 "morpological gradient"	""
 "most significant first"	""
 "multi scale"	""
+"multiple"	""
 "multiple flow direction"	""
 "multiplicative"	""
 "n"	""
@@ -5984,6 +6667,7 @@ TEXT	TRANSLATION
 "nearest neigbhour"	""
 "nearest neighbour"	""
 "needs at least two attributes in selection"	""
+"nein"	""
 "neon"	""
 "new"	""
 "new selection"	""
@@ -5999,6 +6683,7 @@ TEXT	TRANSLATION
 "no class definitions for initial state"	""
 "no conversion (areas already given as specific catchment area)"	""
 "no data entries in project file."	""
+"no data objects"	""
 "no data values"	""
 "no database connection"	""
 "no description"	""
@@ -6009,9 +6694,11 @@ TEXT	TRANSLATION
 "no features to buffer."	""
 "no fields in selection"	""
 "no fields to add"	""
+"no files in selection"	""
 "no gaps"	""
 "no geometry in selection"	""
 "no grid in list"	""
+"no grids have been imported"	""
 "no grids in list"	""
 "no grids in selection"	""
 "no histogram for unclassified data"	""
@@ -6021,12 +6708,14 @@ TEXT	TRANSLATION
 "no layers in data source"	""
 "no lines for splitting"	""
 "no memory"	""
+"no output"	""
 "no output parameter in selection"	""
 "no parameter output specified"	""
+"no points in input layer"	""
 "no points in layer"	""
 "no points removed"	""
 "no polygons in input"	""
-"no polygons in polygon layer"	""
+"no polygons in input layer"	""
 "no predictors available"	""
 "no predictors have been selected"	""
 "no predictors in selection"	""
@@ -6044,6 +6733,7 @@ TEXT	TRANSLATION
 "no shapes for intersection found"	""
 "no shapes in selection"	""
 "no sinks"	""
+"no spatial intersection between grid(s) and points layer"	""
 "no spatial intersection between grid(s) and polygon layer"	""
 "no target specified"	""
 "no target variable in selection"	""
@@ -6073,7 +6763,6 @@ TEXT	TRANSLATION
 "not enough points for interpolation"	""
 "not enough points to perform pattern analysis"	""
 "not enough reference points"	""
-"not entries in statistics table."	""
 "not in transaction"	""
 "not more than one point in layer"	""
 "not supported by PostGIS versions less than 2.1"	""
@@ -6082,25 +6771,32 @@ TEXT	TRANSLATION
 "nothing to do. transformation needs at least two components."	""
 "nothing to do: input format is same as output format"	""
 "nothing to do: no data in selection"	""
+"nothing to do: no output to memory or file has been specified"	""
 "nothing to do: original and desired field types are identical"	""
 "nu-SVC"	""
 "nu-SVR"	""
 "number of added polygons"	""
+"number of categories"	""
+"number of cells"	""
 "number of cells in S-N direction"	""
 "number of cells in W-E direction"	""
+"number of different categories (unique values) within search area"	""
 "number of dropped observations"	""
 "number of dropped shapes"	""
 "number of grid cells per tile"	""
 "number of initial and final state grids differs"	""
 "number of inner rings"	""
+"number of model features do not fit input features list"	""
 "number of order"	""
 "number of pits above threshold level"	""
 "number of points"	""
 "number of processed sinks"	""
 "number of replacements"	""
 "number of returns of given pulse"	""
+"number of scanned files"	""
 "number of subsamples for k-fold cross validation"	""
 "number of the return"	""
+"number of translatable elements"	""
 "object"	""
 "objects"	""
 "offset in minutes relative to 00:00 (midnight)"	""
@@ -6118,16 +6814,18 @@ TEXT	TRANSLATION
 "only during start up phase"	""
 "only entities with layer definition"	""
 "only entities without layer definition"	""
+"only one class in training data"	""
 "only points with given minimum number of points in search radius will be processed"	""
 "only show within scale range; values are given as extent measured in map units"	""
 "only z"	""
+"open"	""
 "open transactions committed"	""
 "open transactions rollbacked"	""
 "open transactions rolled back"	""
 "opening"	""
 "operator"	""
 "optional"	""
-"optional grid providing values to be compared with linear flow threshold instead of catchment area"	""
+"optional grid providing values to be compared with linear flow threshold instead of flow accumulation"	""
 "optional input"	""
 "optional output"	""
 "origin adjustment for Z axis (heading)"	""
@@ -6143,14 +6841,18 @@ TEXT	TRANSLATION
 "output of intermediate results to execution message window"	""
 "ovalooblonga-rectangularoblonga"	""
 "ovaloredonda-ovalooblonga"	""
+"overwrite previous output if adequate"	""
 "p-value"	""
 "parallel"	""
 "parameter C (cost) of C-SVC, epsilon-SVR, and nu-SVR"	""
+"parameter not found"	""
 "parameter nu of nu-SVC, one-class SVM, and nu-SVR"	""
 "parameters"	""
 "pass"	""
 "patch size"	""
 "pdf"	""
+"per line"	""
+"per line segment"	""
 "percent"	""
 "percentiles"	""
 "perform region growing"	""
@@ -6181,19 +6883,23 @@ TEXT	TRANSLATION
 "polynomial"	""
 "polynomial trend"	""
 "polynomial trend (coefficient interpolation)"	""
+"polyonom fit"	""
 "post-processing..."	""
 "power of distance"	""
 "prediction"	""
 "preparing distance calculation..."	""
 "press any key"	""
 "processed DEM"	""
+"processing"	""
 "processors  "	""
+"projection initialization failed"	""
 "projection initialization failure"	""
 "proportional"	""
 "quadrants"	""
 "quadratic surface"	""
 "quantiles"	""
 "quartic kernel"	""
+"r2"	""
 "radial basis function"	""
 "radians"	""
 "radians to degree"	""
@@ -6201,8 +6907,10 @@ TEXT	TRANSLATION
 "radius given in map units used to fill valleys"	""
 "radius in map units"	""
 "rainbow"	""
+"random"	""
 "random read"	""
 "random write"	""
+"range"	""
 "range of days"	""
 "raster"	""
 "re-projection"	""
@@ -6219,15 +6927,12 @@ TEXT	TRANSLATION
 "red > grey > blue"	""
 "red > grey > green"	""
 "red channel color"	""
-"red=1, green=2, blue=this"	""
-"red=1, green=this, blue=2"	""
-"red=2, green=1, blue=this"	""
-"red=2, green=this, blue=1"	""
 "red=this, green=1, blue=2"	""
-"red=this, green=2, blue=1"	""
 "redonda-ovaloredonda"	""
 "regression"	""
 "regression analysis could not detect a significant predictor"	""
+"regression model applied to predictor grids"	""
+"regression model applied to predictor grids with interpolated residuals added"	""
 "relative"	""
 "remove above percentile"	""
 "remove below percentile"	""
@@ -6235,6 +6940,7 @@ TEXT	TRANSLATION
 "remove maxima (with tolerance)"	""
 "remove minima (with tolerance)"	""
 "removed"	""
+"replace"	""
 "replace existing table"	""
 "replacements"	""
 "resampling"	""
@@ -6260,7 +6966,6 @@ TEXT	TRANSLATION
 "rotation clockwise in degree"	""
 "roughness"	""
 "rows"	""
-"running classification"	""
 "s, Percentage sand [%]"	""
 "same as in graphical user interface"	""
 "same as input grid"	""
@@ -6274,6 +6979,7 @@ TEXT	TRANSLATION
 "scale line"	""
 "scale to size range"	""
 "scan angle"	""
+"scanning"	""
 "search distance is less than half of grid cell size"	""
 "seconds"	""
 "sectors"	""
@@ -6292,7 +6998,9 @@ TEXT	TRANSLATION
 "separate layer for each polygon"	""
 "separate lines"	""
 "sequential write"	""
-"set constant value"	""
+"set"	""
+"set greater one for line smoothing"	""
+"set input"	""
 "sgbm"	""
 "shading"	""
 "shading (fixed light source)"	""
@@ -6302,7 +7010,9 @@ TEXT	TRANSLATION
 "shapes extent"	""
 "shapes have been dropped"	""
 "shapes layer extent"	""
+"shear stress coefficient Kt:"	""
 "show direct insolation for each time step."	""
+"show mouse position in statusbar using geographic coordinates if possible"	""
 "shows cell values when zoomed"	""
 "shrink"	""
 "shrink and expand"	""
@@ -6317,10 +7027,12 @@ TEXT	TRANSLATION
 "simple planar surface"	""
 "simply decrease cell's value by epsilon"	""
 "sin(x*x + y*y)"	""
+"single"	""
 "single class"	""
 "single flow direction"	""
 "single|range|simple table|user supplied table|"	""
 "size range as percentage of step"	""
+"skewness of the area size per category distribution"	""
 "slim"	""
 "slope threshold must not be zero!"	""
 "slope value has to be greater than zero"	""
@@ -6350,6 +7062,10 @@ TEXT	TRANSLATION
 "standard kernel 2"	""
 "standardize"	""
 "standardized"	""
+"statistics table does not contain any records"	""
+"statistics table is missing required fields"	""
+"stddev"	""
+"steepest neighbour"	""
 "step"	""
 "step size should not exceed number of cells in x or y direction"	""
 "stepwise"	""
@@ -6358,7 +7074,7 @@ TEXT	TRANSLATION
 "stretch to specified value range"	""
 "string"	""
 "subbasins..."	""
-"subtract value"	""
+"subtract"	""
 "success"	""
 "sum"	""
 "sums-of-squares-and-cross-products matrix"	""
@@ -6388,7 +7104,7 @@ TEXT	TRANSLATION
 "tolerance of termination criterion"	""
 "too few parameters"	""
 "too many constants"	""
-"too many input grids"	""
+"too many input variables"	""
 "too many parameters"	""
 "tool        "	""
 "tool execution failed"	""
@@ -6397,6 +7113,7 @@ TEXT	TRANSLATION
 "tools"	""
 "top"	""
 "top / right"	""
+"top down"	""
 "top hat"	""
 "top left"	""
 "top right"	""
@@ -6405,7 +7122,7 @@ TEXT	TRANSLATION
 "topography"	""
 "total catchment area"	""
 "trace stream network downstream"	""
-"training areas"	""
+"training"	""
 "training failed"	""
 "transaction started"	""
 "triangle (down)"	""
@@ -6437,6 +7154,7 @@ TEXT	TRANSLATION
 "unsorted"	""
 "unsupported file version"	""
 "unsupported shape type."	""
+"unsupported tool chain version"	""
 "unsupported vector type"	""
 "until user closes it"	""
 "up"	""
@@ -6444,14 +7162,15 @@ TEXT	TRANSLATION
 "update, fixed colour stretch"	""
 "upscaling of predictors"	""
 "upsetting model domain"	""
+"use a zero value for hillslopes, any other value for channel cells."	""
 "use more averaged elevations when looking at increasing distances"	""
 "use old version for constant wind direction (no acceleration and averaging option)"	""
 "use this for (linear) flow routing, if the value is a valid direction (0-7 = N, NE, E, SE, S, SW, W, NW)"	""
 "use this grid's system for output grids"	""
+"use values in selected cold air height output grid"	""
 "user data"	""
 "user defined"	""
 "user defined NoData value"	""
-"user defined grid system"	""
 "user defined kernel"	""
 "user defined reference"	""
 "user defined size"	""
@@ -6466,12 +7185,18 @@ TEXT	TRANSLATION
 "variance-covariance matrix"	""
 "variogram model"	""
 "vertical"	""
+"virus 1"	""
+"virus 2"	""
+"von Neumann (4)"	""
 "w"	""
+"wang/liu"	""
 "warning"	""
 "warning, input uses less than 4 bytes per value"	""
 "warning: albedo is ignored"	""
+"warning: local sink detected"	""
 "warning: number of Eigen vectors and components differs."	""
 "warning: number of component grids and components differs."	""
+"weathering only"	""
 "weighting factor for slope in index calculation"	""
 "whether to train a SVC or SVR model for probability estimates"	""
 "whether to use the shrinking heuristics"	""
@@ -6499,6 +7224,8 @@ TEXT	TRANSLATION
 "y Position"	""
 "yMax"	""
 "yMin"	""
+"years"	""
+"years before present"	""
 "yellow - white"	""
 "yellow > blue"	""
 "yellow > green"	""
diff --git a/src/saga_core/saga_gui/saga.cpp b/src/saga_core/saga_gui/saga.cpp
index 530c452..078cb3c 100644
--- a/src/saga_core/saga_gui/saga.cpp
+++ b/src/saga_core/saga_gui/saga.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga.cpp 2510 2015-06-17 13:21:54Z oconrad $
+ * Version $Id: saga.cpp 2582 2015-09-16 18:53:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -78,6 +78,7 @@
 #include "saga_frame.h"
 
 #include "wksp.h"
+#include "wksp_data_manager.h"
 
 
 ///////////////////////////////////////////////////////////
@@ -266,6 +267,10 @@ bool CSAGA::OnInit(void)
 			g_pWKSP->Open(argv[i]);
 		}
 	}
+	else
+	{
+		g_pData->Initialise();
+	}
 
 	//-----------------------------------------------------
 	g_pSAGA_Frame->Show_Tips(false);
@@ -297,32 +302,31 @@ void CSAGA::_Init_Config(void)
 	wxConfigBase	*pConfig;
 
 #if defined(_SAGA_MSW)
-	wxString	fPath;
+	wxFileName	fLocal(Get_App_Path(), "saga_gui", "ini");
 
+	if( ( fLocal.FileExists() && (!fLocal.IsFileReadable() || !fLocal.IsFileWritable()))
+	||  (!fLocal.FileExists() && (!fLocal.IsDirReadable () || !fLocal.IsDirWritable ())) )
 	{
-		wxFileName	fLocal(Get_App_Path(), "saga_gui", "ini");
 		wxFileName	fUser (wxGetHomeDir(), "saga_gui", "ini");
 	//	wxFileName	fUser (wxStandardPaths::Get().GetUserConfigDir(), "saga_gui", "ini");
 
-		if(	fLocal.FileExists() && fLocal.IsFileReadable() && !fLocal.IsFileWritable() && !fUser.FileExists() )
+		if(	fLocal.FileExists() && fLocal.IsFileReadable() && !fUser.FileExists() )	// create a copy in user's home directory
 		{
 			wxFileInputStream	is(fLocal.GetFullPath());
 			wxFileOutputStream	os(fUser .GetFullPath());
 			wxFileConfig		ic(is);	ic.Save(os);
 		}
 
-		fPath	=  ( fLocal.FileExists() && (!fLocal.IsFileReadable() || !fLocal.IsFileWritable()))
-				|| (!fLocal.FileExists() && (!fLocal.IsDirReadable () || !fLocal.IsDirWritable ()))
-				? fUser.GetFullPath() : fLocal.GetFullPath();
+		fLocal	= fUser;
 	}
 
-	if( wxFileExists(fPath) )
+	if( (fLocal.FileExists() && fLocal.IsFileWritable()) || (!fLocal.FileExists() && fLocal.IsDirWritable()) )
 	{
-		pConfig = new wxFileConfig(wxEmptyString, wxEmptyString, fPath, fPath, wxCONFIG_USE_LOCAL_FILE|wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_RELATIVE_PATH);
+		pConfig = new wxFileConfig(wxEmptyString, wxEmptyString, fLocal.GetFullPath(), fLocal.GetFullPath(), wxCONFIG_USE_LOCAL_FILE|wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_RELATIVE_PATH);
 	}
 	else
 	{
-		pConfig	= new wxConfig;
+		pConfig	= new wxConfig;	// this might go to registry
 	}
 #else
 	pConfig	= new wxConfig;
diff --git a/src/saga_core/saga_gui/saga_frame.cpp b/src/saga_core/saga_gui/saga_frame.cpp
index f0578b2..3106a6b 100644
--- a/src/saga_core/saga_gui/saga_frame.cpp
+++ b/src/saga_core/saga_gui/saga_frame.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: saga_frame.cpp 2482 2015-04-30 15:34:11Z oconrad $
+ * Version $Id: saga_frame.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -349,14 +349,6 @@ CSAGA_Frame::CSAGA_Frame(void)
 #endif
 
 	Update();
-
-	//-----------------------------------------------------
-	if( g_pSAGA->argc <= 1 && g_pData->Initialise() )
-	{
-		Refresh(false);
-	}
-
-	ProgressBar_Set_Position(0);
 }
 
 //---------------------------------------------------------
@@ -420,7 +412,7 @@ void CSAGA_Frame::On_Close(wxCloseEvent &event)
 {
 	if( event.CanVeto() )
 	{
-		if( !g_pModule && DLG_Message_Confirm(ID_DLG_CLOSE) && g_pData->Close(true) )
+		if( !g_pModule && DLG_Message_Confirm(ID_DLG_CLOSE) && g_pData->Finalise() && g_pData->Close(true) )
 		{
 			g_pModules->Finalise();
 
diff --git a/src/saga_core/saga_gui/view_histogram.cpp b/src/saga_core/saga_gui/view_histogram.cpp
index 6ac215f..83b1e24 100644
--- a/src/saga_core/saga_gui/view_histogram.cpp
+++ b/src/saga_core/saga_gui/view_histogram.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_histogram.cpp 2431 2015-03-03 17:21:59Z oconrad $
+ * Version $Id: view_histogram.cpp 2549 2015-08-13 13:10:34Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -609,8 +609,8 @@ void CVIEW_Histogram::On_AsTable(wxCommandEvent &event)
 			CSG_Table_Record	*pRecord	= pTable->Add_Record();
 
 			pRecord->Set_Value(0, i + 1);
-			pRecord->Set_Value(2, pClassifier->Histogram_Get_Count     (i, false) * dArea);
-			pRecord->Set_Value(1, pClassifier->Histogram_Get_Count     (i, false));
+			pRecord->Set_Value(1, pClassifier->Histogram_Get_Count     (i, false) * dArea);
+			pRecord->Set_Value(2, pClassifier->Histogram_Get_Count     (i, false));
 			pRecord->Set_Value(3, pClassifier->Histogram_Get_Cumulative(i, false));
 			pRecord->Set_Value(4, pClassifier->Get_Class_Name          (i).wx_str());
 			pRecord->Set_Value(5, pClassifier->Get_Class_Value_Minimum (i));
diff --git a/src/saga_core/saga_gui/view_layout_info.cpp b/src/saga_core/saga_gui/view_layout_info.cpp
index b839af8..3fd87fe 100644
--- a/src/saga_core/saga_gui/view_layout_info.cpp
+++ b/src/saga_core/saga_gui/view_layout_info.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_layout_info.cpp 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: view_layout_info.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -399,7 +399,7 @@ bool CVIEW_Layout_Info::Draw(wxDC &dc)
 		//-------------------------------------------------
 		if( dc_rMap.GetWidth() > 0 )
 		{
-			m_pMap->Draw_Map(dc, dPaperToDC, dc_rMap, false);
+			m_pMap->Draw_Map(dc, dPaperToDC, dc_rMap, LAYER_DRAW_FLAG_NOEDITS);
 
 			if( dc_MapFrame > 0 )
 			{
diff --git a/src/saga_core/saga_gui/view_map_control.cpp b/src/saga_core/saga_gui/view_map_control.cpp
index b1963be..3337fad 100644
--- a/src/saga_core/saga_gui/view_map_control.cpp
+++ b/src/saga_core/saga_gui/view_map_control.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: view_map_control.cpp 2482 2015-04-30 15:34:11Z oconrad $
+ * Version $Id: view_map_control.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -574,7 +574,7 @@ void CVIEW_Map_Control::Refresh_Map(void)
 		wxMemoryDC	dc;
 
 		dc.SelectObject(m_Bitmap);
-		m_pMap->Draw_Map(dc, 1.0, _Get_Client(), true);
+		m_pMap->Draw_Map(dc, 1.0, _Get_Client());
 		dc.SelectObject(wxNullBitmap);
 
 		m_pParent->Ruler_Refresh();
diff --git a/src/saga_core/saga_gui/wksp_base_item.h b/src/saga_core/saga_gui/wksp_base_item.h
index e01b0e0..74ce44b 100644
--- a/src/saga_core/saga_gui/wksp_base_item.h
+++ b/src/saga_core/saga_gui/wksp_base_item.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_base_item.h 2275 2014-10-02 15:48:59Z oconrad $
+ * Version $Id: wksp_base_item.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -85,6 +85,17 @@
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define LAYER_DRAW_FLAG_NOEDITS		0x01
+#define LAYER_DRAW_FLAG_NOLABELS	0x02
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
 typedef enum
 {
 	WKSP_ITEM_Module_Manager,
diff --git a/src/saga_core/saga_gui/wksp_data_manager.cpp b/src/saga_core/saga_gui/wksp_data_manager.cpp
index a93a3be..443aff8 100644
--- a/src/saga_core/saga_gui/wksp_data_manager.cpp
+++ b/src/saga_core/saga_gui/wksp_data_manager.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_manager.cpp 2511 2015-06-17 13:22:42Z oconrad $
+ * Version $Id: wksp_data_manager.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -135,12 +135,12 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 	pNode	= m_Parameters.Add_Node(NULL, "NODE_GENERAL", _TL("General"), _TL(""));
 
 	m_Parameters.Add_Choice(
-		pNode	, "PROJECT_START"			, _TL("Start Project"),
+		pNode	, "PROJECT_START"			, _TL("Startup Project"),
 		_TL(""),
 		CSG_String::Format(SG_T("%s|%s|%s|"),
 			_TL("empty"),
-			_TL("last opened"),
-			_TL("automatically save and load")
+			_TL("last state"),
+			_TL("always ask what to do")
 		), 2
 	);
 
@@ -275,6 +275,8 @@ CWKSP_Data_Manager::CWKSP_Data_Manager(void)
 //---------------------------------------------------------
 CWKSP_Data_Manager::~CWKSP_Data_Manager(void)
 {
+	CONFIG_Write("/DATA", &m_Parameters);
+
 	delete(m_pProject);
 	delete(m_pMenu_Files);
 
@@ -289,31 +291,8 @@ CWKSP_Data_Manager::~CWKSP_Data_Manager(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-bool CWKSP_Data_Manager::Initialise(void)
+wxFileName Get_SAGA_GUI_CFG(void)
 {
-	wxString	FileName;
-
-	if( m_pProject->Has_File_Name() )
-	{
-		return( m_pProject->Load(false) );
-	}
-	else if( CONFIG_Read("/DATA", "PROJECT_FILE", FileName) )
-	{
-		FileName	= Get_FilePath_Absolute(g_pSAGA->Get_App_Path(), FileName);
-
-		return( wxFileExists(FileName) && m_pProject->Load(FileName, false, false) );
-	}
-
-	return( false );
-}
-
-//---------------------------------------------------------
-bool CWKSP_Data_Manager::Finalise(void)
-{
-	//-----------------------------------------------------
-	CONFIG_Write("/DATA", &m_Parameters);
-
-	//-----------------------------------------------------
 #ifdef _SAGA_LINUX
 //	wxFileName	fProject(wxString(getenv( "HOME"), wxConvFile ), wxT("saga_gui"), wxT("cfg"));
 	CSG_String	sHome(getenv("HOME"));
@@ -330,38 +309,82 @@ bool CWKSP_Data_Manager::Finalise(void)
 
 	fProject.Normalize();
 
+	return( fProject );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Manager::Initialise(void)
+{
+	//-----------------------------------------------------
+	if( m_pProject->Has_File_Name() )	{	return( m_pProject->Load(false) );	}
+	//-----------------------------------------------------
+
 	//-----------------------------------------------------
-	if( Get_Count() == 0 || m_Parameters("PROJECT_START")->asInt() == 0 )
-	{	// empty
-		if( fProject.FileExists() )
-		{
-			wxRemoveFile(fProject.GetFullPath());
-		}
+	wxFileName	fProject, fLastState	= Get_SAGA_GUI_CFG();
 
-		CONFIG_Write("/DATA", "PROJECT_FILE", "");
-	}
-	else if( m_Parameters("PROJECT_START")->asInt() == 1 )
-	{	// last opened
-        if( fProject.FileExists() )
+	switch( m_Parameters("PROJECT_START")->asInt() )
+	{
+	case 0:	// empty
+		return( true );
+
+	case 1:	// last state
+		return( m_pProject->Load(fLastState.GetFullPath(), false, false) );
+
+	case 2:	// always ask what to do
 		{
-            wxRemoveFile(fProject.GetFullPath());
-		}
+			wxArrayString	Projects;
+
+			Projects.Add(wxString::Format("[%s]", _TL("empty")));
+
+			if( fLastState.FileExists() )
+			{
+				Projects.Add(wxString::Format("[%s]", _TL("last state")));
+			}
+
+			m_pMenu_Files->Recent_Get(DATAOBJECT_TYPE_Undefined, Projects, true);
+
+			wxSingleChoiceDialog	dlg(MDI_Get_Top_Window(), _TL("Startup Project"), _TL("Select Startup Project"), Projects);
 
-		CONFIG_Write("/DATA", "PROJECT_FILE", m_pProject->Get_File_Name());
+			if( Projects.Count() <= 1 || dlg.ShowModal() != wxID_OK || dlg.GetSelection() == 0 )
+			{	// empty
+				return( true );
+			}
+
+			if( fLastState.FileExists() && dlg.GetSelection() == 1 )
+			{	// last state
+				return( m_pProject->Load(fLastState.GetFullPath(), false, false) );
+			}
+			else
+			{	// recently opened project
+				return( m_pProject->Load(dlg.GetStringSelection(), false, false) );
+			}
+		}
 	}
-	else
-	{	// automatically save and load
+
+	//-----------------------------------------------------
+	//wxString	FileName	= Get_FilePath_Absolute(g_pSAGA->Get_App_Path(), fProject.GetFullPath());
+
+	return( false );
+}
+
+//---------------------------------------------------------
+bool CWKSP_Data_Manager::Finalise(void)
+{
+	wxFileName	fProject	= Get_SAGA_GUI_CFG();
+
+	if( Get_Count() > 0 )
+	{	// last state
 		m_pProject->Save(fProject.GetFullPath(), false);
 
 		if( fProject.GetPath().Find(g_pSAGA->Get_App_Path()) == 0 )
 		{
 			fProject.MakeRelativeTo(g_pSAGA->Get_App_Path());
 		}
-
-		CONFIG_Write("/DATA", "PROJECT_FILE", fProject.GetFullPath());
 	}
-
-	m_pProject->Clr_File_Name();
+	else if( fProject.FileExists() )
+	{
+		wxRemoveFile(fProject.GetFullPath());
+	}
 
 	return( true );
 }
@@ -1028,14 +1051,14 @@ bool CWKSP_Data_Manager::Close(bool bSilent)
 {
 	if( Get_Count() == 0 )
 	{
-		Finalise();
+		m_pProject->Clr_File_Name();
 
 		return( true );
 	}
 
 	if( (bSilent || DLG_Message_Confirm(_TL("Close all data sets"), _TL("Close"))) && Save_Modified(this) )
 	{
-		Finalise();
+		m_pProject->Clr_File_Name();
 
 		g_pACTIVE->Get_Parameters()->Restore_Parameters();
 		g_pMaps->Close(true);
diff --git a/src/saga_core/saga_gui/wksp_data_menu_file.cpp b/src/saga_core/saga_gui/wksp_data_menu_file.cpp
index 1333c9f..d9d2052 100644
--- a/src/saga_core/saga_gui/wksp_data_menu_file.cpp
+++ b/src/saga_core/saga_gui/wksp_data_menu_file.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_file.cpp 2501 2015-06-12 10:02:42Z oconrad $
+ * Version $Id: wksp_data_menu_file.cpp 2583 2015-09-16 18:55:03Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -174,11 +174,18 @@ wxMenu * CWKSP_Data_Menu_File::Create(TSG_Data_Object_Type DataType)
 
 	if( m_Recent_Count > 0 )
 	{
-		m_Recent		= new wxString[m_Recent_Count];
+		m_Recent	= new wxString[m_Recent_Count];
 
-		for(int i=0; i<m_Recent_Count; i++)
+		for(int i=0, n=0; i<m_Recent_Count; i++)
 		{
-			CONFIG_Read(wxString::Format(wxT("RECENT_FILES/%s"), m_Recent_Group.c_str()), wxString::Format(wxT("FILE_%02d"), i + 1), m_Recent[i]);
+			wxString	Recent;
+
+			CONFIG_Read(wxString::Format(wxT("RECENT_FILES/%s"), m_Recent_Group.c_str()), wxString::Format(wxT("FILE_%02d"), i + 1), Recent);
+
+			if( wxFileExists(Recent) )
+			{
+				m_Recent[n++]	= Recent;
+			}
 		}
 	}
 
@@ -321,6 +328,29 @@ void CWKSP_Data_Menu_File::_Del(int Cmd_ID)
 }
 
 
+//---------------------------------------------------------
+bool CWKSP_Data_Menu_File::Get(wxArrayString &FileNames, bool bAppend)
+{
+	if( !bAppend )
+	{
+		FileNames.Clear();
+	}
+
+	if( m_Recent )
+	{
+		for(int i=0; i<m_Recent_Count; i++)
+		{
+			if( wxFileExists(m_Recent[i]) )
+			{
+				FileNames.Add(m_Recent[i]);
+			}
+		}
+	}
+
+	return( FileNames.Count() > 0 );
+}
+
+
 ///////////////////////////////////////////////////////////
 //														 //
 //														 //
diff --git a/src/saga_core/saga_gui/wksp_data_menu_file.h b/src/saga_core/saga_gui/wksp_data_menu_file.h
index 8b97f4e..0bb398f 100644
--- a/src/saga_core/saga_gui/wksp_data_menu_file.h
+++ b/src/saga_core/saga_gui/wksp_data_menu_file.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_file.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_menu_file.h 2551 2015-08-14 15:24:25Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -95,6 +95,7 @@ public:
 
 	void						Add			(const wxString &FileName);
 	void						Del			(const wxString &FileName);
+	bool						Get			(wxArrayString &FileNames, bool bAppend);
 
 	bool						Open		(int Cmd_ID);
 
diff --git a/src/saga_core/saga_gui/wksp_data_menu_files.cpp b/src/saga_core/saga_gui/wksp_data_menu_files.cpp
index 94827eb..e9fe7f2 100644
--- a/src/saga_core/saga_gui/wksp_data_menu_files.cpp
+++ b/src/saga_core/saga_gui/wksp_data_menu_files.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_files.cpp 2029 2014-02-27 16:00:28Z oconrad $
+ * Version $Id: wksp_data_menu_files.cpp 2551 2015-08-14 15:24:25Z oconrad $
  *********************************************************/
 	
 ///////////////////////////////////////////////////////////
@@ -147,6 +147,17 @@ void CWKSP_Data_Menu_Files::Recent_Del(int DataType, const wxString &FileName)
 }
 
 //---------------------------------------------------------
+bool CWKSP_Data_Menu_Files::Recent_Get(int DataType, wxArrayString &FileNames, bool bAppend)
+{
+	if( _Get_Menu(DataType) )
+	{
+		return( _Get_Menu(DataType)->Get(FileNames, bAppend) );
+	}
+
+	return( false );
+}
+
+//---------------------------------------------------------
 inline CWKSP_Data_Menu_File * CWKSP_Data_Menu_Files::_Get_Menu(int DataType)
 {
 	switch( DataType )
diff --git a/src/saga_core/saga_gui/wksp_data_menu_files.h b/src/saga_core/saga_gui/wksp_data_menu_files.h
index 984d5b8..025970f 100644
--- a/src/saga_core/saga_gui/wksp_data_menu_files.h
+++ b/src/saga_core/saga_gui/wksp_data_menu_files.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_data_menu_files.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_data_menu_files.h 2551 2015-08-14 15:24:25Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -95,6 +95,7 @@ public:
 	bool							Recent_Open		(int Cmd_ID);
 	void							Recent_Add		(int DataType, const wxString &FileName);
 	void							Recent_Del		(int DataType, const wxString &FileName);
+	bool							Recent_Get		(int DataType, wxArrayString &FileNames, bool bAppend);
 
 
 private:
diff --git a/src/saga_core/saga_gui/wksp_grid.cpp b/src/saga_core/saga_gui/wksp_grid.cpp
index 5cecaf9..b727966 100644
--- a/src/saga_core/saga_gui/wksp_grid.cpp
+++ b/src/saga_core/saga_gui/wksp_grid.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid.cpp 2512 2015-06-19 15:16:18Z oconrad $
+ * Version $Id: wksp_grid.cpp 2590 2015-09-18 15:42:35Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -121,7 +121,11 @@ wxString CWKSP_Grid::Get_Description(void)
 
 	DESC_ADD_STR (_TL("Name")				, m_pObject->Get_Name());
 	DESC_ADD_STR (_TL("Description")		, m_pObject->Get_Description());
-	DESC_ADD_STR (_TL("File")				, SG_File_Exists(m_pObject->Get_File_Name()) ? m_pObject->Get_File_Name() : _TL("memory"));
+	DESC_ADD_STR (_TL("File")				, SG_File_Exists(m_pObject->Get_File_Name(false)) ? m_pObject->Get_File_Name(false) : _TL("memory"));
+	if( m_pObject->Get_MetaData()("GDAL_DRIVER") )
+	{
+		DESC_ADD_STR (_TL("Driver")			, m_pObject->Get_MetaData()["GDAL_DRIVER"].Get_Content().c_str());
+	}
 	DESC_ADD_STR (_TL("Modified")			, m_pObject->is_Modified() ? _TL("yes") : _TL("no"));
 	DESC_ADD_STR (_TL("Projection")			, m_pObject->Get_Projection().Get_Description().c_str());
 	DESC_ADD_FLT (_TL("West")				, Get_Grid()->Get_XMin());
@@ -1347,7 +1351,7 @@ bool CWKSP_Grid::Get_Image_Legend(wxBitmap &BMP, double Zoom)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Grid::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
+void CWKSP_Grid::On_Draw(CWKSP_Map_DC &dc_Map, int Flags)
 {
 	int		Interpolation;
 	double	Transparency;
@@ -1382,9 +1386,12 @@ void CWKSP_Grid::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 
 			dc_Map.IMG_Draw_End();
 
-			_Draw_Values(dc_Map);
+			if( (Flags & LAYER_DRAW_FLAG_NOLABELS) == 0 )
+			{
+				_Draw_Values(dc_Map);
+			}
 
-			if( bEdit )
+			if( (Flags & LAYER_DRAW_FLAG_NOEDITS) == 0 )
 			{
 				_Draw_Edit(dc_Map);
 			}
diff --git a/src/saga_core/saga_gui/wksp_grid.h b/src/saga_core/saga_gui/wksp_grid.h
index 6d0f59d..2986428 100644
--- a/src/saga_core/saga_gui/wksp_grid.h
+++ b/src/saga_core/saga_gui/wksp_grid.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_grid.h 2512 2015-06-19 15:16:18Z oconrad $
+ * Version $Id: wksp_grid.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -125,7 +125,7 @@ protected:
 	virtual void				On_Parameters_Changed	(void);
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
+	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, int Flags);
 
 
 private:
diff --git a/src/saga_core/saga_gui/wksp_layer.cpp b/src/saga_core/saga_gui/wksp_layer.cpp
index 39b21f0..8e0210c 100644
--- a/src/saga_core/saga_gui/wksp_layer.cpp
+++ b/src/saga_core/saga_gui/wksp_layer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer.cpp 2208 2014-08-27 16:00:51Z oconrad $
+ * Version $Id: wksp_layer.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -460,7 +460,7 @@ bool CWKSP_Layer::_Set_Thumbnail(bool bRefresh)
 		wxRect			r(0, 0, m_Thumbnail.GetWidth(), m_Thumbnail.GetHeight());
 		CWKSP_Map_DC	dc_Map(Get_Extent(), r, 1.0, SG_GET_RGB(255, 255, 255));
 
-		Draw(dc_Map, false);
+		Draw(dc_Map, LAYER_DRAW_FLAG_NOEDITS|LAYER_DRAW_FLAG_NOLABELS);
 
 		dc.SelectObject(m_Thumbnail);
 		dc.SetBackground(*wxWHITE_BRUSH);
@@ -628,9 +628,9 @@ bool CWKSP_Layer::do_Show(CSG_Rect const &rMap)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Layer::Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
+void CWKSP_Layer::Draw(CWKSP_Map_DC &dc_Map, int Flags)
 {
-	On_Draw(dc_Map, bEdit);
+	On_Draw(dc_Map, Flags);
 }
 
 
diff --git a/src/saga_core/saga_gui/wksp_layer.h b/src/saga_core/saga_gui/wksp_layer.h
index 14ef9b1..278eebc 100644
--- a/src/saga_core/saga_gui/wksp_layer.h
+++ b/src/saga_core/saga_gui/wksp_layer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_layer.h 2061 2014-03-20 11:48:01Z oconrad $
+ * Version $Id: wksp_layer.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -104,7 +104,7 @@ public:
 	virtual wxString				Get_Value				(CSG_Point ptWorld, double Epsilon)	= 0;
 	virtual double					Get_Value_Range			(void)								= 0;
 
-	void							Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
+	void							Draw					(CWKSP_Map_DC &dc_Map, int Flags = 0);
 
 	class CWKSP_Layer_Classify *	Get_Classifier			(void)	{	return( m_pClassify );	}
 
@@ -163,7 +163,7 @@ protected:
 	virtual void					On_Update_Views			(bool bAll);
 	virtual void					On_Update_Views			(void)			{}
 
-	virtual void					On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit)	= 0;
+	virtual void					On_Draw					(CWKSP_Map_DC &dc_Map, int Flags)	= 0;
 
 
 private:
diff --git a/src/saga_core/saga_gui/wksp_map.cpp b/src/saga_core/saga_gui/wksp_map.cpp
index ae8590d..5e4ef9e 100644
--- a/src/saga_core/saga_gui/wksp_map.cpp
+++ b/src/saga_core/saga_gui/wksp_map.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map.cpp 2495 2015-05-21 14:14:52Z oconrad $
+ * Version $Id: wksp_map.cpp 2552 2015-08-14 15:25:36Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -842,6 +842,14 @@ void CWKSP_Map::_Set_Extent(const CSG_Rect &Extent)
 	{
 		View_Refresh(true);
 
+		for(int i=0; i<Get_Count(); i++)
+		{
+			if( Get_Item(i)->Get_Type() == WKSP_ITEM_Map_Layer )
+			{
+				((CWKSP_Map_Layer *)Get_Item(i))->Fit_Colors(Extent);
+			}
+		}
+
 		if( m_Parameters("SYNC_MAPS")->asBool() )
 		{
 			_Synchronise_Extents();
@@ -1246,7 +1254,7 @@ bool CWKSP_Map::Get_Image(wxImage &Image, CSG_Rect &rWorld)
 		wxMemoryDC	dc;
 
 		dc.SelectObject(BMP);
-		Draw_Map(dc, 1.0, wxRect(0, 0, Image.GetWidth(), Image.GetHeight()), false, SG_GET_RGB(MASK_R, MASK_G, MASK_B));
+		Draw_Map(dc, 1.0, wxRect(0, 0, Image.GetWidth(), Image.GetHeight()), LAYER_DRAW_FLAG_NOEDITS, SG_GET_RGB(MASK_R, MASK_G, MASK_B));
 		dc.SelectObject(wxNullBitmap);
 
 		rWorld	= Get_World(wxRect(0, 0, Image.GetWidth(), Image.GetHeight()));
@@ -1355,7 +1363,7 @@ void CWKSP_Map::SaveAs_Image_Clipboard(int nx, int ny, int frame)
 	dc.SetBackground(*wxWHITE_BRUSH);
 	dc.Clear();
 
-	Draw_Map(dc, 1.0, r, false);
+	Draw_Map(dc, 1.0, r, LAYER_DRAW_FLAG_NOEDITS);
 
 	if( frame > 0 )
 	{
@@ -1505,7 +1513,7 @@ void CWKSP_Map::_Img_Save(wxString file, int type)
 	dc.SetBackground(*wxWHITE_BRUSH);
 	dc.Clear();
 
-	Draw_Map(dc, 1.0, r, false);
+	Draw_Map(dc, 1.0, r, LAYER_DRAW_FLAG_NOEDITS);
 	Draw_Frame(dc, r, Frame);
 
 	dc.SelectObject(wxNullBitmap);
@@ -1632,7 +1640,7 @@ bool CWKSP_Map::_Set_Thumbnail(void)
 		dc.SetBackground(*wxWHITE_BRUSH);
 		dc.Clear();
 
-		Draw_Map(dc, Get_Extent(), 1.0, r, false);
+		Draw_Map(dc, Get_Extent(), 1.0, r, LAYER_DRAW_FLAG_NOEDITS|LAYER_DRAW_FLAG_NOLABELS);
 
 		dc.SelectObject(wxNullBitmap);
 
@@ -1650,16 +1658,18 @@ bool CWKSP_Map::_Set_Thumbnail(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Map::Draw_Map(wxDC &dc, double Zoom, const wxRect &rClient, bool bEdit, int Background)
+void CWKSP_Map::Draw_Map(wxDC &dc, double Zoom, const wxRect &rClient, int Flags, int Background)
 {
-	Draw_Map(dc, Get_World(rClient), Zoom, rClient, bEdit, Background);
+	Draw_Map(dc, Get_World(rClient), Zoom, rClient, Flags, Background);
 }
 
 //---------------------------------------------------------
-void CWKSP_Map::Draw_Map(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wxRect &rClient, bool bEdit, int Background)
+void CWKSP_Map::Draw_Map(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wxRect &rClient, int Flags, int Background)
 {
 	CWKSP_Map_DC	dc_Map(rWorld, rClient, Zoom, Background);
 
+	int	Flag_Labels	= !(Flags & LAYER_DRAW_FLAG_NOLABELS) ? 0 : LAYER_DRAW_FLAG_NOLABELS;
+
 	//-----------------------------------------------------
 	for(int i=Get_Count()-1; i>=0; i--)
 	{
@@ -1671,7 +1681,7 @@ void CWKSP_Map::Draw_Map(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wx
 
 				if( pLayer->do_Show() && pLayer->Get_Layer()->do_Show(Get_Extent()) )
 				{
-					pLayer->Get_Layer()->Draw(dc_Map, bEdit && pLayer->Get_Layer() == Get_Active_Layer());
+					pLayer->Get_Layer()->Draw(dc_Map, !(Flags & LAYER_DRAW_FLAG_NOEDITS) && pLayer->Get_Layer() == Get_Active_Layer() ? Flags : Flag_Labels);
 				}
 			}
 			break;
diff --git a/src/saga_core/saga_gui/wksp_map.h b/src/saga_core/saga_gui/wksp_map.h
index 655852c..709e40b 100644
--- a/src/saga_core/saga_gui/wksp_map.h
+++ b/src/saga_core/saga_gui/wksp_map.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map.h 2333 2014-11-10 15:30:41Z oconrad $
+ * Version $Id: wksp_map.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -184,8 +184,8 @@ public:
 	void						SaveAs_Image_On_Change	(void);
 	void						SaveAs_Image_To_Grid	(CSG_Grid &Grid, int Size);
 
-	void						Draw_Map				(wxDC &dc, double Zoom, const wxRect &rClient, bool bEdit, int Background = -1);
-	void						Draw_Map				(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wxRect &rClient, bool bEdit, int Background = -1);
+	void						Draw_Map				(wxDC &dc                        , double Zoom, const wxRect &rClient, int Flags = 0, int Background = -1);
+	void						Draw_Map				(wxDC &dc, const CSG_Rect &rWorld, double Zoom, const wxRect &rClient, int Flags = 0, int Background = -1);
 	void						Draw_Frame				(wxDC &dc, wxRect rMap, int Width);
 	void						Draw_Frame				(wxDC &dc, const CSG_Rect &rWorld, wxRect rMap, int Width);
 	bool						Draw_Legend				(wxDC &dc, double Zoom_Map, double Zoom, wxPoint Position, wxSize *pSize = NULL);
diff --git a/src/saga_core/saga_gui/wksp_map_layer.cpp b/src/saga_core/saga_gui/wksp_map_layer.cpp
index 782cc61..11fbf6f 100644
--- a/src/saga_core/saga_gui/wksp_map_layer.cpp
+++ b/src/saga_core/saga_gui/wksp_map_layer.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_layer.cpp 2513 2015-06-19 15:30:32Z oconrad $
+ * Version $Id: wksp_map_layer.cpp 2547 2015-08-10 13:53:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -85,14 +85,12 @@
 //---------------------------------------------------------
 CWKSP_Map_Layer::CWKSP_Map_Layer(CWKSP_Layer *pLayer)
 {
-	m_pLayer	= pLayer;
+	m_pLayer		= pLayer;
 
-	m_bShow		= true;
-}
+	m_bShow			= true;
 
-//---------------------------------------------------------
-CWKSP_Map_Layer::~CWKSP_Map_Layer(void)
-{}
+	m_bFitColors	= false;
+}
 
 
 ///////////////////////////////////////////////////////////
@@ -135,7 +133,7 @@ wxMenu * CWKSP_Map_Layer::Get_Menu(void)
 
 	case WKSP_ITEM_Grid:
 		pMenu->AppendSeparator();
-		CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_GRID_FITCOLORS);
+		CMD_Menu_Add_Item(pMenu, true, ID_CMD_MAPS_GRID_FITCOLORS);
 		break;
 	}
 
@@ -201,30 +199,9 @@ bool CWKSP_Map_Layer::On_Command(int Cmd_ID)
 		break;
 
 	case ID_CMD_MAPS_GRID_FITCOLORS:
-		if( m_pLayer->Get_Type() == WKSP_ITEM_Grid )
+		if( (m_bFitColors = !m_bFitColors) == true )
 		{
-			CSG_Rect	rWorld	= ((CWKSP_Map *)Get_Manager())->Get_Extent();
-			CWKSP_Grid	*pGrid	= (CWKSP_Grid *)m_pLayer;
-
-			pGrid->Fit_Color_Range(rWorld);
-
-			if( m_pLayer->Get_Parameter("COLORS_TYPE")->asInt() == CLASSIFY_OVERLAY )
-			{
-				if( m_pLayer->Get_Parameter("OVERLAY_R")->is_Enabled() && (pGrid = (CWKSP_Grid *)g_pData->Get(m_pLayer->Get_Parameter("OVERLAY_R")->asGrid())) != NULL )
-				{
-					pGrid->Fit_Color_Range(rWorld);
-				}
-
-				if( m_pLayer->Get_Parameter("OVERLAY_G")->is_Enabled() && (pGrid = (CWKSP_Grid *)g_pData->Get(m_pLayer->Get_Parameter("OVERLAY_R")->asGrid())) != NULL )
-				{
-					pGrid->Fit_Color_Range(rWorld);
-				}
-
-				if( m_pLayer->Get_Parameter("OVERLAY_B")->is_Enabled() && (pGrid = (CWKSP_Grid *)g_pData->Get(m_pLayer->Get_Parameter("OVERLAY_B")->asGrid())) != NULL )
-				{
-					pGrid->Fit_Color_Range(rWorld);
-				}
-			}
+			Fit_Colors(((CWKSP_Map *)Get_Manager())->Get_Extent());
 		}
 		break;
 	}
@@ -263,6 +240,10 @@ bool CWKSP_Map_Layer::On_Command_UI(wxUpdateUIEvent &event)
 	case ID_CMD_MAPS_MOVE_BOTTOM:
 		event.Enable(Get_Index() < Get_Manager()->Get_Count() - 1);
 		break;
+
+	case ID_CMD_MAPS_GRID_FITCOLORS:
+		event.Check(m_bFitColors);
+		break;
 	}
 
 	return( true );
@@ -297,3 +278,40 @@ void CWKSP_Map_Layer::Parameters_Changed(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
+#define	FIT_OVERLAY_GRID_COLORS(band, extent)	{\
+	CWKSP_Grid	*pGrid	= (CWKSP_Grid *)g_pData->Get(m_pLayer->Get_Parameter(band)->asGrid());\
+	if( pGrid && m_pLayer->Get_Parameter(band)->is_Enabled() )\
+	{	pGrid->Fit_Color_Range(extent);	}\
+}
+
+//---------------------------------------------------------
+bool CWKSP_Map_Layer::Fit_Colors(const CSG_Rect &rWorld)
+{
+	if( m_bFitColors )
+	{
+		if( m_pLayer->Get_Type() == WKSP_ITEM_Grid )
+		{
+			((CWKSP_Grid *)m_pLayer)->Fit_Color_Range(rWorld);
+
+			if( m_pLayer->Get_Parameter("COLORS_TYPE")->asInt() == CLASSIFY_OVERLAY )
+			{
+				FIT_OVERLAY_GRID_COLORS("OVERLAY_R", rWorld);
+				FIT_OVERLAY_GRID_COLORS("OVERLAY_G", rWorld);
+				FIT_OVERLAY_GRID_COLORS("OVERLAY_B", rWorld);
+			}
+
+			return( true );
+		}
+	}
+
+	return( false );
+}
+
+
+///////////////////////////////////////////////////////////
+//														 //
+//														 //
+//														 //
+///////////////////////////////////////////////////////////
+
+//---------------------------------------------------------
diff --git a/src/saga_core/saga_gui/wksp_map_layer.h b/src/saga_core/saga_gui/wksp_map_layer.h
index f1a169e..11a7508 100644
--- a/src/saga_core/saga_gui/wksp_map_layer.h
+++ b/src/saga_core/saga_gui/wksp_map_layer.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_map_layer.h 1921 2014-01-09 10:24:11Z oconrad $
+ * Version $Id: wksp_map_layer.h 2547 2015-08-10 13:53:29Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -86,7 +86,6 @@ class CWKSP_Map_Layer : public CWKSP_Base_Item
 {
 public:
 	CWKSP_Map_Layer(class CWKSP_Layer *pLayer);
-	virtual ~CWKSP_Map_Layer(void);
 
 	virtual TWKSP_Item			Get_Type			(void)	{	return( WKSP_ITEM_Map_Layer );	}
 
@@ -105,10 +104,12 @@ public:
 
 	bool						do_Show				(void)	{	return( m_bShow );	}
 
+	bool						Fit_Colors			(const CSG_Rect &rWorld);
+
 
 private:
 
-	bool						m_bShow;
+	bool						m_bShow, m_bFitColors;
 
 	class CWKSP_Layer			*m_pLayer;
 
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.cpp b/src/saga_core/saga_gui/wksp_pointcloud.cpp
index e2f77a7..932637f 100644
--- a/src/saga_core/saga_gui/wksp_pointcloud.cpp
+++ b/src/saga_core/saga_gui/wksp_pointcloud.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud.cpp 2003 2014-02-19 17:08:18Z oconrad $
+ * Version $Id: wksp_pointcloud.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -886,7 +886,7 @@ bool CWKSP_PointCloud::Edit_Set_Attributes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_PointCloud::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
+void CWKSP_PointCloud::On_Draw(CWKSP_Map_DC &dc_Map, int Flags)
 {
 	if( Get_Extent().Intersects(dc_Map.m_rWorld) != INTERSECTION_None && dc_Map.IMG_Draw_Begin(m_Parameters("DISPLAY_TRANSPARENCY")->asDouble() / 100.0) )
 	{
diff --git a/src/saga_core/saga_gui/wksp_pointcloud.h b/src/saga_core/saga_gui/wksp_pointcloud.h
index ac5989d..304c214 100644
--- a/src/saga_core/saga_gui/wksp_pointcloud.h
+++ b/src/saga_core/saga_gui/wksp_pointcloud.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_pointcloud.h 2003 2014-02-19 17:08:18Z oconrad $
+ * Version $Id: wksp_pointcloud.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -132,7 +132,7 @@ protected:
 
 	void						_LUT_Create				(void);
 
-	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
+	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, int Flags);
 
 	void						_Draw_Point				(CWKSP_Map_DC &dc_Map, int x, int y, double z, int Color);
 	void						_Draw_Point				(CWKSP_Map_DC &dc_Map, int x, int y, double z, int Color, int Radius);
diff --git a/src/saga_core/saga_gui/wksp_shapes.cpp b/src/saga_core/saga_gui/wksp_shapes.cpp
index 13d630b..c7e6b9a 100644
--- a/src/saga_core/saga_gui/wksp_shapes.cpp
+++ b/src/saga_core/saga_gui/wksp_shapes.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes.cpp 2503 2015-06-12 12:44:14Z oconrad $
+ * Version $Id: wksp_shapes.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -918,7 +918,7 @@ wxString CWKSP_Shapes::Get_Name_Attribute(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
+void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, int Flags)
 {
 	//-----------------------------------------------------
 	if( Get_Extent().Intersects(dc_Map.m_rWorld) != INTERSECTION_None )
@@ -936,7 +936,7 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 		Draw_Initialize(dc);
 
 		//-------------------------------------------------
-		if( bEdit && (m_Edit_pShape || Get_Shapes()->Get_Selection_Count() > 0) )
+		if( (Flags & LAYER_DRAW_FLAG_NOEDITS) == 0 && (m_Edit_pShape || Get_Shapes()->Get_Selection_Count() > 0) )
 		{
 			for(iShape=0; iShape<Get_Shapes()->Get_Count(); iShape++)
 			{
@@ -1007,7 +1007,7 @@ void CWKSP_Shapes::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 		}
 
 		//-------------------------------------------------
-		if( m_iLabel >= 0 )
+		if( (Flags & LAYER_DRAW_FLAG_NOLABELS) == 0 && m_iLabel >= 0 )
 		{
 			int		iSize	= m_Parameters("LABEL_ATTRIB_SIZE_BY"  )->asInt();
 			double	dSize	= m_Parameters("LABEL_ATTRIB_SIZE_TYPE")->asInt() == 1 ?
diff --git a/src/saga_core/saga_gui/wksp_shapes.h b/src/saga_core/saga_gui/wksp_shapes.h
index 3fbe222..26c5e07 100644
--- a/src/saga_core/saga_gui/wksp_shapes.h
+++ b/src/saga_core/saga_gui/wksp_shapes.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_shapes.h 2329 2014-11-05 19:32:43Z oconrad $
+ * Version $Id: wksp_shapes.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -156,7 +156,7 @@ protected:
 
 	virtual void				On_Update_Views			(void);
 
-	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
+	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, int Flags);
 
 	bool						Get_Class_Color			(CSG_Shape *pShape, int &Color);
 
diff --git a/src/saga_core/saga_gui/wksp_tin.cpp b/src/saga_core/saga_gui/wksp_tin.cpp
index 59faa97..aa6b04f 100644
--- a/src/saga_core/saga_gui/wksp_tin.cpp
+++ b/src/saga_core/saga_gui/wksp_tin.cpp
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin.cpp 2053 2014-03-18 09:47:18Z oconrad $
+ * Version $Id: wksp_tin.cpp 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -401,7 +401,7 @@ bool CWKSP_TIN::Edit_Set_Attributes(void)
 ///////////////////////////////////////////////////////////
 
 //---------------------------------------------------------
-void CWKSP_TIN::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
+void CWKSP_TIN::On_Draw(CWKSP_Map_DC &dc_Map, int Flags)
 {
 	if( Get_Extent().Intersects(dc_Map.m_rWorld) != INTERSECTION_None )
 	{
@@ -410,12 +410,12 @@ void CWKSP_TIN::On_Draw(CWKSP_Map_DC &dc_Map, bool bEdit)
 			_Draw_Triangles	(dc_Map);
 		}
 
-		if( m_Parameters("DISPLAY_EDGES")	->asBool() )
+		if( m_Parameters("DISPLAY_EDGES" )->asBool() )
 		{
 			_Draw_Edges		(dc_Map);
 		}
 
-		if( m_Parameters("DISPLAY_POINTS")	->asBool() )
+		if( m_Parameters("DISPLAY_POINTS")->asBool() )
 		{
 			_Draw_Points	(dc_Map);
 		}
diff --git a/src/saga_core/saga_gui/wksp_tin.h b/src/saga_core/saga_gui/wksp_tin.h
index dbcb05a..a55b3ba 100644
--- a/src/saga_core/saga_gui/wksp_tin.h
+++ b/src/saga_core/saga_gui/wksp_tin.h
@@ -1,5 +1,5 @@
 /**********************************************************
- * Version $Id: wksp_tin.h 2003 2014-02-19 17:08:18Z oconrad $
+ * Version $Id: wksp_tin.h 2548 2015-08-13 13:07:55Z oconrad $
  *********************************************************/
 
 ///////////////////////////////////////////////////////////
@@ -137,7 +137,7 @@ protected:
 	virtual void				On_Parameters_Changed	(void);
 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
 
-	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, bool bEdit);
+	virtual void				On_Draw					(CWKSP_Map_DC &dc_Map, int Flags);
 
 
 private:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/saga.git



More information about the Pkg-grass-devel mailing list